|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.media.FrameInterval
public abstract class FrameInterval
| Field Summary | |
|---|---|
protected long |
_initDelay
Time between expirations. |
protected FrameManager |
_mgr
The context whose FrameManager we are using. |
protected long |
_nextTime
Time of the next expiration. |
protected long |
_repeatDelay
Time between expirations. |
| Constructor Summary | |
|---|---|
FrameInterval(FrameManager mgr)
Constructor - registers the interval as a frame participant |
|
| Method Summary | |
|---|---|
void |
cancel()
Cancel the current schedule, and ensure that any expirations that are queued up but have not yet run do not run. |
abstract void |
expired()
The main method where your interval should do its work. |
Component |
getComponent()
If a frame participant wishes also to be actively rendered every frame rather than use passive rendering (which for Swing, at least, is hijacked when using the frame manager such that we take care of repainting dirty Swing components every frame into our off-screen buffer), it can return a component here which will have Component.paint(java.awt.Graphics) called on it once per frame with a translated but
unclipped graphics object. |
boolean |
needsPaint()
Called immediately prior to FrameParticipant.getComponent() and then Component.paint(java.awt.Graphics) on said component, to determine whether or not
this frame participant needs to be painted. |
void |
schedule(long delay)
Schedule the interval to execute once, after the specified delay. |
void |
schedule(long delay,
boolean repeat)
Schedule the interval to execute repeatedly, with the same delay. |
void |
schedule(long initialDelay,
long repeatDelay)
Schedule the interval to execute repeatedly with the specified initial delay and repeat delay. |
void |
tick(long tickStamp)
This is called on all registered frame participants, one for every frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long _nextTime
protected long _repeatDelay
protected long _initDelay
protected FrameManager _mgr
| Constructor Detail |
|---|
public FrameInterval(FrameManager mgr)
| Method Detail |
|---|
public Component getComponent()
FrameParticipantComponent.paint(java.awt.Graphics) called on it once per frame with a translated but
unclipped graphics object.
Because clipping is expensive in terms of rectangle object allocation, frame participants are given the opportunity to do their own clipping because they are likely to want to clip to a more fine grained region than their entire bounds. If a participant does not wish to be actively rendered, it can safely return null.
getComponent in interface FrameParticipantpublic boolean needsPaint()
FrameParticipantFrameParticipant.getComponent() and then Component.paint(java.awt.Graphics) on said component, to determine whether or not
this frame participant needs to be painted.
needsPaint in interface FrameParticipantpublic void tick(long tickStamp)
FrameParticipant
tick in interface FrameParticipantpublic abstract void expired()
public final void schedule(long delay)
public final void schedule(long delay,
boolean repeat)
public final void schedule(long initialDelay,
long repeatDelay)
public final void cancel()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||