|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgnu.app.Application
gnu.x11.Application
gnu.app.displayhack.DisplayHack
public abstract class DisplayHack
Base class for display hacks.
The implementation uses two threads so that one can be painting and
one can be waiting for user input. Only with two threads can sleep(long)
be interrupted (with restart()
or exit()
) to give responsive user interface.
Field Summary | |
---|---|
boolean |
clear
Clear window before the first iteration. |
Color[] |
colors
|
long |
delay
|
boolean |
erase
Erase window between iterations. |
long |
eraser_delay
|
int |
eraser_delta
|
GC |
eraser_gc
|
int |
eraser_mode
|
GC |
gc
|
GC.Values |
gc_values
|
static java.util.Random |
random
|
boolean |
stop_now
|
java.lang.Thread |
thread
|
Window |
window
|
Fields inherited from class gnu.x11.Application |
---|
display |
Constructor Summary | |
---|---|
DisplayHack(java.lang.String[] args,
boolean clear,
boolean erase,
boolean rainbow_color,
int default_color_count,
int default_delay)
|
Method Summary | |
---|---|
void |
about(java.lang.String version,
java.lang.String description,
java.lang.String author,
java.lang.String url)
#about(String, String, String, String, String) |
static boolean |
chance(float probability)
|
void |
dispatch_event()
|
void |
erase()
|
void |
exec()
Main method. |
void |
exit()
|
abstract void |
paint()
|
Color |
random_color()
|
int |
random_int(int n)
Random.nextInt(int) accepting zero as argument. |
int |
random_sign()
|
void |
restart()
|
void |
run()
|
boolean |
sleep(long millis)
|
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public boolean stop_now
public static final java.util.Random random
public int eraser_delta
public int eraser_mode
public long delay
public long eraser_delay
public Color[] colors
public GC gc
public GC eraser_gc
public GC.Values gc_values
public Window window
public java.lang.Thread thread
public boolean clear
Deco
) should set this to false.
public boolean erase
Constructor Detail |
---|
public DisplayHack(java.lang.String[] args, boolean clear, boolean erase, boolean rainbow_color, int default_color_count, int default_delay)
Method Detail |
---|
public abstract void paint()
public void about(java.lang.String version, java.lang.String description, java.lang.String author, java.lang.String url)
Application
public static boolean chance(float probability)
public void dispatch_event()
public void erase()
public void exec()
Expose
. It is responsible for user interaction.
public void exit()
public Color random_color()
public int random_int(int n)
Random.nextInt(int)
accepting zero as argument.
public int random_sign()
public void restart()
public void run()
run
in interface java.lang.Runnable
public boolean sleep(long millis)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |