|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
com.threerings.media.MediaPanel
com.threerings.media.VirtualMediaPanel
com.threerings.puzzle.client.PuzzleBoardView
public abstract class PuzzleBoardView
The puzzle board view displays a view of a puzzle game.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.threerings.media.MediaPanel |
|---|
com.threerings.media.MediaPanel.Obscurer |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class com.threerings.media.VirtualMediaPanel |
|---|
CENTER_ON_PATHABLE, ENCLOSE_PATHABLE, TRACK_PATHABLE |
| Fields inherited from class javax.swing.JComponent |
|---|
TOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface com.threerings.media.MediaConstants |
|---|
ALL, BACK, FRONT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
PuzzleBoardView(PuzzleContext ctx)
Constructs a puzzle board view. |
|
| Method Summary | |
|---|---|
void |
abortAnimation(com.threerings.media.animation.Animation anim)
|
void |
addActionAnimation(com.threerings.media.animation.Animation anim)
Adds the given animation to the set of animations currently present on the board. |
void |
addActionSprite(com.threerings.media.sprite.Sprite sprite)
Adds the given sprite to the set of sprites currently present on the board. |
void |
clearAnimations()
|
void |
clearSprites()
|
ScoreAnimation |
createScoreAnimation(String score,
Color color,
Font font,
int x,
int y)
Creates and returns an animation displaying the given string with the specified parameters, floating it a short distance up the view. |
void |
dumpActors()
Dumps to the logs, a list of interesting sprites and animations currently active on the puzzle board. |
int |
getActionAnimationCount()
Returns the number of action animations on the board. |
int |
getActionCount()
Returns the count of action sprites and animations on the board. |
int |
getActionSpriteCount()
Returns the number of action sprites on the board. |
void |
init(GameConfig config)
Initializes the board with the board dimensions. |
void |
paintBehind(Graphics2D gfx,
Rectangle dirty)
|
void |
paintBetween(Graphics2D gfx,
Rectangle dirty)
|
void |
removeSprite(com.threerings.media.sprite.Sprite sprite)
|
void |
setBackgroundImage(com.threerings.media.image.Mirage image)
Sets the background image displayed by the board view. |
void |
setBoard(Board board)
Sets the board to be displayed. |
void |
setController(PuzzleController pctrl)
Provides the board view with a reference to its controller so that it may communicate directly rather than by posting actions up the interface hierarchy which sometimes fails if the puzzle board view is hidden before we get a chance to post our actions. |
void |
setPaused(boolean paused)
Set whether this puzzle is paused or not. |
void |
trackAvoidAnimation(com.threerings.media.animation.Animation anim)
Positions the supplied animation so as to avoid any active animations previously registered with this method, and adds the animation to the list of animations to be avoided by any future avoid animations. |
| Methods inherited from class com.threerings.media.VirtualMediaPanel |
|---|
addViewTracker, clearPathable, doLayout, getViewBounds, removeViewTracker, setBackground, setBounds, setFollowsPathable, setViewLocation |
| Methods inherited from class com.threerings.media.MediaPanel |
|---|
addAnimation, addObscurer, addSprite, createGraphics, getAnimationManager, getComponent, getRegionManager, getSpriteManager, getTimeStamp, isManaged, isManaged, needsPaint, paint, removeObscurer, repaint, setOpaque, tick |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public PuzzleBoardView(PuzzleContext ctx)
| Method Detail |
|---|
public void init(GameConfig config)
public void setBoard(Board board)
public void setController(PuzzleController pctrl)
public void setBackgroundImage(com.threerings.media.image.Mirage image)
public void setPaused(boolean paused)
setPaused in class com.threerings.media.MediaPanelpublic void addActionAnimation(com.threerings.media.animation.Animation anim)
getActionAnimationCount(). The animation will automatically be removed from the
action list when it completes.
public void abortAnimation(com.threerings.media.animation.Animation anim)
abortAnimation in class com.threerings.media.MediaPanelpublic void addActionSprite(com.threerings.media.sprite.Sprite sprite)
getActionSpriteCount(). Callers should be sure to remove the sprite when their work
with it is done via removeSprite(com.threerings.media.sprite.Sprite).
public void removeSprite(com.threerings.media.sprite.Sprite sprite)
removeSprite in class com.threerings.media.MediaPanelpublic void clearSprites()
clearSprites in class com.threerings.media.MediaPanelpublic void clearAnimations()
clearAnimations in class com.threerings.media.MediaPanelpublic int getActionAnimationCount()
public int getActionSpriteCount()
public int getActionCount()
public void dumpActors()
public ScoreAnimation createScoreAnimation(String score,
Color color,
Font font,
int x,
int y)
score - the score text to display.color - the color of the text.font - the font with which to create the score animation.x - the x-position at which the score is to be placed.y - the y-position at which the score is to be placed.public void trackAvoidAnimation(com.threerings.media.animation.Animation anim)
public void paintBehind(Graphics2D gfx,
Rectangle dirty)
paintBehind in class com.threerings.media.VirtualMediaPanel
public void paintBetween(Graphics2D gfx,
Rectangle dirty)
paintBetween in class com.threerings.media.MediaPanel
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||