public class MetaMediaManager extends Object implements MediaConstants, Iterable<AbstractMedia>
MediaPanel has been around a long
time and is thoroughly out in the wild and now that we need to abstract out a bunch of its
functionality, we're constrained by all the extant usages and derivations.ALL, BACK, FRONT| Constructor and Description |
|---|
MetaMediaManager(FrameManager framemgr,
MediaHost host) |
| Modifier and Type | Method and Description |
|---|---|
void |
abortAnimation(Animation anim)
Aborts a currently running animation and removes it from this panel.
|
void |
addAnimation(Animation anim)
Adds an animation to this panel.
|
void |
addSprite(Sprite sprite)
Adds a sprite to this panel.
|
void |
clearAnimations()
Removes all animations from this panel.
|
void |
clearSprites()
Removes all sprites from this panel.
|
AnimationManager |
getAnimationManager()
Returns a reference to the animation manager used by this media panel.
|
FrameManager |
getFrameManager()
Returns the frame manager with which we are coordinating.
|
RegionManager |
getRegionManager()
Returns the region manager used to coordinate our dirty regions.
|
SpriteManager |
getSpriteManager()
Returns a reference to the sprite manager used by this media panel.
|
long |
getTimeStamp()
Returns a timestamp from the
MediaTimer used to track time intervals for this media
panel. |
boolean |
isManaged(Animation anim) |
boolean |
isManaged(Sprite sprite) |
boolean |
isPaused()
Returns true if we are paused, false if we are running normally.
|
Iterator<AbstractMedia> |
iterator() |
boolean |
needsPaint()
Our media front end should implement
FrameParticipant and call this method in their
FrameParticipant.needsPaint() method. |
void |
noteDirty(int regions)
Called by the host to coordinate dirty region tracking.
|
void |
paintMedia(Graphics2D gfx,
int layer,
Rectangle dirty)
Renders the sprites and animations that intersect the supplied dirty region in the specified
layer.
|
void |
paintPerf(Graphics2D gfx)
Renders our performance debugging information if enabled.
|
void |
removeSprite(Sprite sprite)
Removes a sprite from this panel.
|
void |
setPaused(boolean paused)
Pauses the sprites and animations that are currently active on this media panel.
|
void |
tick(long tickStamp)
Our media front end should implement
FrameParticipant and call this method in their
FrameParticipant.tick(long) method. |
void |
viewLocationDidChange(int dx,
int dy)
If our host supports scrolling around in a virtual view, it should call this method when the
view origin changes.
|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEach, spliteratorpublic MetaMediaManager(FrameManager framemgr, MediaHost host)
public FrameManager getFrameManager()
public AnimationManager getAnimationManager()
public SpriteManager getSpriteManager()
public RegionManager getRegionManager()
public boolean isPaused()
public void setPaused(boolean paused)
public long getTimeStamp()
MediaTimer used to track time intervals for this media
panel. Note: this should only be called from the AWT thread.public void addSprite(Sprite sprite)
public boolean isManaged(Sprite sprite)
public void removeSprite(Sprite sprite)
public void clearSprites()
public void addAnimation(Animation anim)
public boolean isManaged(Animation anim)
public void abortAnimation(Animation anim)
public void clearAnimations()
public void noteDirty(int regions)
public void tick(long tickStamp)
FrameParticipant and call this method in their
FrameParticipant.tick(long) method. They must also first check isPaused() and not
call this method if we are paused. As they will probably want to have willTick() and
didTick() calldown methods, we cannot handle pausedness for them.public boolean needsPaint()
FrameParticipant and call this method in their
FrameParticipant.needsPaint() method.public void paintMedia(Graphics2D gfx, int layer, Rectangle dirty)
public void paintPerf(Graphics2D gfx)
public void viewLocationDidChange(int dx,
int dy)
public Iterator<AbstractMedia> iterator()
iterator in interface Iterable<AbstractMedia>Copyright © 2015. All rights reserved.