gnu.app.displayhack
Class Squiral

java.lang.Object
  extended by gnu.app.Application
      extended by gnu.x11.Application
          extended by gnu.app.displayhack.DisplayHack
              extended by gnu.app.displayhack.Squiral
All Implemented Interfaces:
java.lang.Runnable

public class Squiral
extends DisplayHack

Square spirals. It displays interacting, spiral-producing automata.

Modified from squiral.c in xscreensaver by Jeff Epler . Object-oriented-ized. Cyclic color not yet implemented.

See Also:
screenshot 8, help output

Nested Class Summary
 class Squiral.Worm
           
 
Field Summary
 float disorder
           
 long draw_delay
           
static int[] DX
          x increment values for different directions.
static int[] DY
          y increment values for different directions.
static int EAST
           
 boolean[] EMPTY_FILLED
          If a pixel in window is filled.
 float fill
           
 boolean[] filled
          If a pixel in window is filled.
 int filled_count
           
 float left_handed
           
static int NORTH
           
static int SOUTH
           
static int WEST
           
 int worm_count
           
 Squiral.Worm[] worms
           
 
Fields inherited from class gnu.app.displayhack.DisplayHack
clear, colors, delay, erase, eraser_delay, eraser_delta, eraser_gc, eraser_mode, gc, gc_values, random, stop_now, thread, window
 
Fields inherited from class gnu.x11.Application
display
 
Constructor Summary
Squiral(java.lang.String[] args)
           
 
Method Summary
 boolean clear(int x, int y)
          If a pixel is not filled.
 void init()
           
static void main(java.lang.String[] args)
           
 void paint()
           
 
Methods inherited from class gnu.app.displayhack.DisplayHack
about, chance, dispatch_event, erase, exec, exit, random_color, random_int, random_sign, restart, run, sleep
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NORTH

public static final int NORTH
See Also:
Constant Field Values

EAST

public static final int EAST
See Also:
Constant Field Values

SOUTH

public static final int SOUTH
See Also:
Constant Field Values

WEST

public static final int WEST
See Also:
Constant Field Values

DX

public static final int[] DX
x increment values for different directions.


DY

public static final int[] DY
y increment values for different directions.


disorder

public float disorder

fill

public float fill

left_handed

public float left_handed

draw_delay

public long draw_delay

worm_count

public int worm_count

filled_count

public int filled_count

worms

public Squiral.Worm[] worms

filled

public boolean[] filled
If a pixel in window is filled.


EMPTY_FILLED

public boolean[] EMPTY_FILLED
If a pixel in window is filled.

Constructor Detail

Squiral

public Squiral(java.lang.String[] args)
Method Detail

clear

public boolean clear(int x,
                     int y)
If a pixel is not filled.


init

public void init()

paint

public void paint()
Specified by:
paint in class DisplayHack

main

public static void main(java.lang.String[] args)