Class FrameHandler
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a canvas to the frame handler.void
addUpdater
(Updater updater) Add an updater to the frame handler.long
getTimer()
void
init()
boolean
removeCanvas
(Canvas canvas) Remove a canvas from the frame handler.boolean
removeUpdater
(Updater updater) Remove an updater from the frame handler.void
setTimeoutSeconds
(long timeoutSeconds) void
-
Constructor Details
-
FrameHandler
-
-
Method Details
-
updateFrame
public void updateFrame() -
addUpdater
Add an updater to the frame handler.The frame handler calls the
update
method of each updater that has been added to it once per frame, before rendering begins.Note: that is the frame handler has already been initialized then the updater will not have it's
init
method called automatically, it is up to the client code to perform any initialization explicitly under this scenario.- Parameters:
updater
- the updater to add.
-
removeUpdater
Remove an updater from the frame handler.- Parameters:
updater
- the updater to remove.- Returns:
true
if the updater was removed,false
otherwise (which will happen if, for example, the updater had not previously been added to the frame handler).
-
addCanvas
Add a canvas to the frame handler.The frame handler calls the
Canvas.draw(java.util.concurrent.CountDownLatch)
draw} method of each canvas that has been added to it once per frame, after updating is complete.Note: that is the frame handler has already been initialized then the canvas will not have it's
init
method called automatically, it is up to the client code to perform any initialization explicitly under this scenario.- Parameters:
canvas
- the canvas to add.
-
removeCanvas
Remove a canvas from the frame handler.- Parameters:
canvas
- the canvas to remove.- Returns:
true
if the canvas was removed,false
otherwise (which will happen if, for example, the canvas had not previously been added to the frame handler).
-
init
public void init() -
getTimeoutSeconds
public long getTimeoutSeconds() -
setTimeoutSeconds
public void setTimeoutSeconds(long timeoutSeconds) -
getTimer
-