public abstract class Displayable extends Object implements EventHandler
Displayable
is an abstract class which defines the very objects that can be shown on the
Display
.Displayable
may be shown or hidden, but at most one Displayable
is shown on the
Display
.Displayable
contents and their possible interactions with the user.Displayable
object is not visible on the display.Display
Constructor and Description |
---|
Displayable() |
Modifier and Type | Method and Description |
---|---|
protected void |
onHidden()
This method is called by system as soon as the displayable becomes hidden.
|
protected void |
onShown()
This method is called by system as soon as the displayable becomes visible.
|
protected abstract void |
render(GraphicsContext gc)
Renders the displayable.
|
void |
requestRender()
Requests a rendering for the entire displayable.
|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
handleEvent
public void requestRender()
render(GraphicsContext)
on the displayable.
The call to render(GraphicsContext)
occurs asynchronously to this call. That is, this method will not
block waiting for render(GraphicsContext)
to finish. After render action (after call to
render(GraphicsContext)
), a call to Display.flush()
is synchronously performed.
This call may have no effect under certain conditions:
Display.isShown(Displayable)
): the request is
refused.Display.requestShow(Displayable)
has been performed with another displayable): the request is abandoned
(this displayable is no longer the current displayable).protected void onShown()
Display.requestShow(Displayable)
protected void onHidden()
Display.requestHide(Displayable)
protected abstract void render(GraphicsContext gc)
gc
- the graphics context of display.