|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.hdcookbook.grin.animator.AnimationEngine com.hdcookbook.grin.animator.ClockBasedEngine com.hdcookbook.grin.animator.DirectDrawEngine com.hdcookbook.grinxlet.DebugDirectDrawEngine
public class DebugDirectDrawEngine
A double-buffered animation engine that uses direct draw, and can be set in "debug draw" mode.
DirectDrawEngine
Field Summary |
---|
Fields inherited from class com.hdcookbook.grin.animator.AnimationEngine |
---|
modelTimeSkipped, renderContext, repaintBounds, targetsCanOverlap, transparent |
Constructor Summary | |
---|---|
DebugDirectDrawEngine()
Create a new DebugDirectDrawEngine. |
Method Summary | |
---|---|
protected void |
callPaintTargets()
Paint the current frame into the right graphics buffer. |
void |
initContainer(java.awt.Container container,
java.awt.Rectangle bounds)
Initialize this engine with its parent container and the position and size of the engine within the container. |
void |
setDebugDraw(boolean debugDraw)
Tell us if we should step through each frame showing erase, paint areas, then painted result |
void |
setFps(int fps)
Set the frame rate of the animation, in 1001sts of a second. |
Methods inherited from class com.hdcookbook.grin.animator.DirectDrawEngine |
---|
clearArea, finishedFrame, getComponent, getHeight, getWidth, needsFullRedrawInAnimationLoop, terminatingEraseScreen, toString |
Methods inherited from class com.hdcookbook.grin.animator.ClockBasedEngine |
---|
getFps, pause, runAnimationLoop, skipFrames, start |
Methods inherited from class com.hdcookbook.grin.animator.AnimationEngine |
---|
advanceModel, checkDestroy, checkNewClients, destroy, destroyRequested, getAnimationClients, getDrawTargets, getEraseTargets, getModelTimeSkipped, getNumDrawTargets, getNumEraseTargets, initClients, initialize, paintFrame, paintNextFrameFully, paintTargets, repaintFrame, resetAnimationClients, run, setAllowOverlappingTargets, setDrawTargetCollapseThreshold, setThreadPriority, showFrame |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public DebugDirectDrawEngine()
Method Detail |
---|
public void initContainer(java.awt.Container container, java.awt.Rectangle bounds)
The Component will be set to the specified bounds, and an internal double buffer may be created to these bounds. The container is expected to have a null layout; if it doesn't, this might change the widget's size to be different than the bounds passed in (and therefore the double buffer). The container must be visible when this is called.
initContainer
in class DirectDrawEngine
AnimationEngine.initialize(com.hdcookbook.grin.animator.AnimationContext)
,
AnimationContext.animationInitialize()
public void setDebugDraw(boolean debugDraw)
protected void callPaintTargets() throws java.lang.InterruptedException
callPaintTargets
in class DirectDrawEngine
java.lang.InterruptedException
AnimationEngine.paintFrame(java.awt.Graphics2D)
public void setFps(int fps)
Desired framerate fps value ================= ========= 23.976 24,000 24.000 24,024 29.970 30,000 30.000 30,030 59.940 60,000 60.000 60,060If you find yourself asking "why 1001," read the HD Handbook starting from page 2-2 (ISBN 978-0-07-149585-1). Long story short: NTSC video's frame rate is 30*1000/1001 frames/second, due to issues around the transition from B&W to color. Fun fact: 1001 isn't prime, it's 7*11*13
The frame rate must be greater than 0 fps. To stop the animation, call pause().
If the animation is paused when this method is called, it will stay paused.
setFps
in class ClockBasedEngine
ClockBasedEngine.skipFrames(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |