public abstract class PuzzleBoardView
extends com.threerings.media.VirtualMediaPanel
com.threerings.media.MediaPanel.ObscurerJComponent.AccessibleJComponentComponent.BaselineResizeBehaviorCENTER_ON_PATHABLE, ENCLOSE_PATHABLE, TRACK_PATHABLETOOL_TIP_TEXT_KEY, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOWBOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENTABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH| Constructor and Description |
|---|
PuzzleBoardView(PuzzleContext ctx)
Constructs a puzzle board view.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
addViewTracker, clearPathable, doLayout, getViewBounds, removeViewTracker, setBackground, setBounds, setFollowsPathable, setViewLocationaddAnimation, addObscurer, addSprite, createGraphics, getAnimationManager, getComponent, getRegionManager, getSpriteManager, getTimeStamp, isManaged, isManaged, needsPaint, paint, removeObscurer, repaint, setOpaque, tickaddAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUIadd, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validateaction, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, createImage, createImage, createVolatileImage, createVolatileImage, dispatchEvent, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCyclepublic PuzzleBoardView(PuzzleContext ctx)
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.VirtualMediaPanelpublic void paintBetween(Graphics2D gfx, Rectangle dirty)
paintBetween in class com.threerings.media.MediaPanelCopyright © 2015. All rights reserved.