com.threerings.puzzle.client
Class PuzzlePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by com.threerings.puzzle.client.PuzzlePanel
All Implemented Interfaces:
ControllerProvider, com.threerings.crowd.client.PlaceView, com.threerings.presents.data.InvocationCodes, PuzzleCodes, PuzzleGameCodes, ImageObserver, MenuContainer, Serializable, Accessible

public abstract class PuzzlePanel
extends JPanel
implements com.threerings.crowd.client.PlaceView, ControllerProvider, PuzzleCodes, PuzzleGameCodes

The puzzle panel class should be extended by classes that provide a view for a puzzle game. The PuzzleController calls these methods as necessary to perform its duties in managing the logical actions of a puzzle game.

See Also:
Serialized Form

Nested Class Summary
 
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 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.puzzle.data.PuzzleCodes
DEBUG_PUZZLE, DEFAULT_DIFFICULTY, PUZZLE_MESSAGE_BUNDLE
 
Fields inherited from interface com.threerings.presents.data.InvocationCodes
ACCESS_DENIED, E_ACCESS_DENIED, E_INTERNAL_ERROR, GLOBAL_GROUP, INTERNAL_ERROR
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PuzzlePanel(PuzzleContext ctx, PuzzleController controller)
          Constructs a puzzle panel.
 
Method Summary
 void addNotify()
           
 void clearAction()
          Called by the controller when the action stops.
 void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
           
 PuzzleBoardView getBoardView()
          Returns a reference to the PuzzleBoardView in use.
 Controller getController()
           
 boolean hasOverlay()
          Returns true if an overlay panel is currently being displayed.
 void init(GameConfig config)
          Initializes the puzzle panel with the puzzle config of the puzzle whose user interface is being displayed by the panel
static boolean isRobotTesting()
          Returns true if the robot tester is activated.
static boolean isSyncingBoards()
          Returns true if board syncing is activated.
 void popOverlayPanel()
          Pops the overlay panel off of the main puzzle board display.
 boolean pushOverlayPanel(JPanel opanel)
          Temporarily replaces the puzzle board display with the supplied overlay panel.
 void removeNotify()
           
 void setPuzzleGrabsKeys(boolean puzgrabs)
          Sets whether the puzzle grabs keys or if they should go to the chat window.
 void setRobotPlayer(boolean isrobot)
          Sets whether this panel receives events periodically from a robot player.
 void startAction()
          Called by the controller when the action starts.
 void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, 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, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintImmediately, paintImmediately, print, printAll, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, 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, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, 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, transferFocusBackward, transferFocusDownCycle, validate
 
Methods inherited from class java.awt.Component
action, 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, 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, hide, 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, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PuzzlePanel

public PuzzlePanel(PuzzleContext ctx,
                   PuzzleController controller)
Constructs a puzzle panel.

Method Detail

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent

removeNotify

public void removeNotify()
Overrides:
removeNotify in class JComponent

pushOverlayPanel

public boolean pushOverlayPanel(JPanel opanel)
Temporarily replaces the puzzle board display with the supplied overlay panel. The panel can be removed and the board display restored by calling popOverlayPanel().

Returns:
true if the specified panel will be displayed, false if it was not able to be pushed because another overlay panel is already pushed onto the primary panel.

popOverlayPanel

public void popOverlayPanel()
Pops the overlay panel off of the main puzzle board display.


hasOverlay

public boolean hasOverlay()
Returns true if an overlay panel is currently being displayed.


init

public void init(GameConfig config)
Initializes the puzzle panel with the puzzle config of the puzzle whose user interface is being displayed by the panel


setRobotPlayer

public void setRobotPlayer(boolean isrobot)
Sets whether this panel receives events periodically from a robot player.


setPuzzleGrabsKeys

public void setPuzzleGrabsKeys(boolean puzgrabs)
Sets whether the puzzle grabs keys or if they should go to the chat window.


startAction

public void startAction()
Called by the controller when the action starts.


clearAction

public void clearAction()
Called by the controller when the action stops.


willEnterPlace

public void willEnterPlace(com.threerings.crowd.data.PlaceObject plobj)
Specified by:
willEnterPlace in interface com.threerings.crowd.client.PlaceView

didLeavePlace

public void didLeavePlace(com.threerings.crowd.data.PlaceObject plobj)
Specified by:
didLeavePlace in interface com.threerings.crowd.client.PlaceView

getBoardView

public PuzzleBoardView getBoardView()
Returns a reference to the PuzzleBoardView in use.


getController

public Controller getController()
Specified by:
getController in interface ControllerProvider

isRobotTesting

public static boolean isRobotTesting()
Returns true if the robot tester is activated.


isSyncingBoards

public static boolean isSyncingBoards()
Returns true if board syncing is activated.



Copyright © 2011. All Rights Reserved.