public abstract class AbstractMediaManager extends Object implements MediaConstants
AbstractMedia.ALL, BACK, FRONT| Constructor and Description |
|---|
AbstractMediaManager() |
| Modifier and Type | Method and Description |
|---|---|
Graphics2D |
createGraphics()
Creates a graphics that can be used to compute metrics or whatever else a media might need.
|
void |
fastForward(long timeDelta)
If the manager is paused for some length of time, it should be fast forwarded by the
appropriate number of milliseconds.
|
RegionManager |
getRegionManager()
Returns region manager in use by this manager.
|
void |
init(MediaHost host,
RegionManager remgr)
Provides this media manager with its host and region manager.
|
boolean |
isManaged(AbstractMedia media)
Returns true if the specified media is being managed by this media manager.
|
void |
paint(Graphics2D gfx,
int layer,
Shape clip)
Renders all registered media in the given layer that intersect the supplied clipping
rectangle to the given graphics context.
|
void |
queueNotification(ObserverList<Object> observers,
ObserverList.ObserverOp<Object> event)
Queues the notification for dispatching after we've ticked all the media.
|
void |
renderOrderDidChange(AbstractMedia media)
Called by a
AbstractMedia when its render order has changed. |
void |
tick(long tickStamp)
Must be called every frame so that the media can be properly updated.
|
void |
viewLocationDidChange(int dx,
int dy)
Called by a
VirtualMediaPanel when the view that contains our media is scrolled. |
void |
willPaint()
This will always be called prior to the
paint(java.awt.Graphics2D, int, java.awt.Shape) calls for a particular tick. |
public void init(MediaHost host, RegionManager remgr)
public RegionManager getRegionManager()
public Graphics2D createGraphics()
Graphics.dispose() on the returned object when it is done
with it.public void tick(long tickStamp)
public void willPaint()
paint(java.awt.Graphics2D, int, java.awt.Shape) calls for a particular tick. Because
it is possible that there will be no dirty regions and thus no calls to paint(java.awt.Graphics2D, int, java.awt.Shape) this
method exists so that the media manager can guarantee that it will be notified when all
ticking is complete and the painting phase has begun.public void paint(Graphics2D gfx, int layer, Shape clip)
layer - the layer to render; one of MediaConstants.FRONT, MediaConstants.BACK, or MediaConstants.ALL.
The front layer contains all animations with a positive render order; the back layer
contains all animations with a negative render order; all, both.public void fastForward(long timeDelta)
public boolean isManaged(AbstractMedia media)
public void viewLocationDidChange(int dx,
int dy)
VirtualMediaPanel when the view that contains our media is scrolled.dx - the scrolled distance in the x direction (in pixels).dy - the scrolled distance in the y direction (in pixels).public void renderOrderDidChange(AbstractMedia media)
AbstractMedia when its render order has changed.public void queueNotification(ObserverList<Object> observers, ObserverList.ObserverOp<Object> event)
Copyright © 2015. All rights reserved.