|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object universe.world.BigBang<Msg>
public class BigBang<Msg extends java.io.Serializable>
A Class representing the creation of a World/System that communicates by passing messages of some type (Msg), and the related methods and Function-Objects (call-backs) for drawing the world and handling various events. Handlers are parameterized so they are statically checked.
The name and types of handlers are given in the table below:
Event Name | BigBang Method | Handler Signature | Required? |
---|---|---|---|
OnDraw | onDraw(OnDraw) | Scene apply(World<Msg> w) | yes |
OnTick | onTick(OnTick<Msg>) or onTick(OnTick<Msg>, double) | World apply(World<Msg> w) | no |
OnMouse | onMouse(OnMouse<Msg>) | World<Msg> apply(World<Msg> w, int x, int y, String what) | no |
OnKey | onKey(OnKey<Msg>) | World<Msg> apply(World<Msg> w, String key) | no |
OnRelease | onRelease(OnRelease<Msg>) | World<Msg> apply(World<Msg> w, String key) | no |
StopWhen | stopWhen(StopWhen) | boolean apply(World<Msg> w) | no |
LastScene | lastScene(LastScene) | Scene apply(World<Msg> w) | no |
Field Summary | |
---|---|
static double |
DEFAULT_TICK_RATE
Default Tick rate for the world: ~33 frames per second |
static java.lang.String |
KEY_ARROW_DOWN
Key arrow-down event String |
static java.lang.String |
KEY_ARROW_LEFT
Key arrow-left event String |
static java.lang.String |
KEY_ARROW_RIGHT
Key arrow-right event String |
static java.lang.String |
KEY_ARROW_UP
Key arrow-up event String |
static java.lang.String |
KEY_ESCAPE
Key escape event String |
static java.lang.String |
MOUSE_DOWN
Mouse down (button-down) event String |
static java.lang.String |
MOUSE_DRAG
Mouse down & move (drag) event String |
static java.lang.String |
MOUSE_ENTER
Mouse window enter (enter) event String |
static java.lang.String |
MOUSE_LEAVE
Mouse window leave (leave) event String |
static java.lang.String |
MOUSE_MOVE
Mouse motion (move) event String |
static java.lang.String |
MOUSE_UP
Mouse up (button-up) event String |
Constructor Summary | |
---|---|
BigBang(World<Msg> initial)
|
Method Summary | |
---|---|
World<Msg> |
bigBang()
Construct and run the animation/interaction system. |
World<Msg> |
bigBang(java.lang.String title)
Open a window and run the animation with the given title |
BigBang<Msg> |
lastScene(LastScene lastscene)
Install a LastScene Handler into this BigBang. |
BigBang<Msg> |
name(java.lang.String name)
Install the name of this client, to be used with the Universe server |
BigBang<Msg> |
onDraw(OnDraw ondraw)
Install a Draw Handler into this BigBang. |
BigBang<Msg> |
onKey(OnKey<Msg> onkey)
Install a Key Handler into this BigBang. |
BigBang<Msg> |
onMouse(OnMouse<Msg> onmouse)
Install a Mouse Handler into this BigBang. |
BigBang<Msg> |
onReceive(OnReceive<Msg> onreceive)
|
BigBang<Msg> |
onRelease(OnRelease<Msg> onrelease)
Install a Key Release Handler into this BigBang. |
BigBang<Msg> |
onTick(OnTick<Msg> ontick)
Install a Tick Handler at a tick rate of 1/20th of a second. |
BigBang<Msg> |
onTick(OnTick<Msg> ontick,
double time)
Install a Tick Handler into this BigBang at the given tick rate (per-seconds). |
BigBang<Msg> |
register(java.lang.String server)
Install the name of the Universe server to connect to once bigBang is called |
BigBang<Msg> |
stopWhen(StopWhen stopwhen)
Install a StopWhen Handler into this BigBang. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static double DEFAULT_TICK_RATE
public static java.lang.String MOUSE_DOWN
public static java.lang.String MOUSE_UP
public static java.lang.String MOUSE_ENTER
public static java.lang.String MOUSE_LEAVE
public static java.lang.String MOUSE_MOVE
public static java.lang.String MOUSE_DRAG
public static java.lang.String KEY_ARROW_UP
public static java.lang.String KEY_ARROW_DOWN
public static java.lang.String KEY_ARROW_LEFT
public static java.lang.String KEY_ARROW_RIGHT
public static java.lang.String KEY_ESCAPE
Constructor Detail |
---|
public BigBang(World<Msg> initial)
Method Detail |
---|
public BigBang<Msg> onDraw(OnDraw ondraw)
public BigBang<Msg> onTick(OnTick<Msg> ontick)
public BigBang<Msg> onTick(OnTick<Msg> ontick, double time)
public BigBang<Msg> onMouse(OnMouse<Msg> onmouse)
public BigBang<Msg> onKey(OnKey<Msg> onkey)
public BigBang<Msg> onRelease(OnRelease<Msg> onrelease)
public BigBang<Msg> onReceive(OnReceive<Msg> onreceive)
public BigBang<Msg> stopWhen(StopWhen stopwhen)
public BigBang<Msg> lastScene(LastScene lastscene)
public BigBang<Msg> register(java.lang.String server)
bigBang
is called
public BigBang<Msg> name(java.lang.String name)
public World<Msg> bigBang()
public World<Msg> bigBang(java.lang.String title)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |