com.threerings.stage.tools.viewer
Class ViewerScenePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by com.threerings.media.MediaPanel
                  extended by com.threerings.media.VirtualMediaPanel
                      extended by com.threerings.miso.client.MisoScenePanel
                          extended by com.threerings.stage.client.StageScenePanel
                              extended by com.threerings.stage.tools.viewer.ViewerScenePanel
All Implemented Interfaces:
ControllerProvider, RadialMenu.Host, PlaceView, com.threerings.media.FrameParticipant, com.threerings.media.MediaConstants, com.threerings.media.MediaHost, com.threerings.media.sprite.PathObserver, com.threerings.media.util.AStarPathUtil.TraversalPred, com.threerings.media.util.PerformanceObserver, KeyListener, MouseListener, MouseMotionListener, ImageObserver, MenuContainer, Serializable, EventListener

public class ViewerScenePanel
extends StageScenePanel
implements com.threerings.media.util.PerformanceObserver, com.threerings.media.sprite.PathObserver

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.stage.client.StageScenePanel
StageScenePanel.PortalObjectTile
 
Nested classes/interfaces inherited from class com.threerings.miso.client.MisoScenePanel
com.threerings.miso.client.MisoScenePanel.PaintTileOp
 
Nested classes/interfaces inherited from class com.threerings.media.MediaPanel
com.threerings.media.MediaPanel.ActionSpriteHandler, com.threerings.media.MediaPanel.Obscurer
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  com.threerings.cast.CharacterManager _charmgr
          Provides character sprite data.
protected  com.threerings.cast.CharacterSprite[] _decoys
          The test sprites that meander about aimlessly.
protected  StageLocation _defloc
          The current scene's default entrance.
protected  com.threerings.cast.CharacterDescriptor _descDecoy
          The character descriptor for the decoy characters.
protected  com.threerings.cast.CharacterDescriptor _descUser
          The character descriptor for the user character.
protected  com.threerings.cast.CharacterSprite _sprite
          The sprite we're manipulating within the view.
protected static String[] COLOR_CLASSES
          Defines the colorization classes used in the character component images.
protected static String[] COMP_CLASSES
          Defines our various character component classes.
protected static int DEFAULT_NUM_DECOYS
          The number of decoy characters milling about.
 
Fields inherited from class com.threerings.stage.client.StageScenePanel
_clusters, _clusterWells, _ctrl, _ctx, _portobjs, _rizer, _scene, CLUSTER_CLICKED, CLUSTER_COLOR, CLUSTER_PAD, CLUSTER_SLOP, CLUSTER_STROKE, HIGHLIGHT_ALPHA, INACTIVE_PORTAL_ALPHA, LOCATION_CLICKED, MAX_LOCATION_DIST, PORTAL_ICON_HEIGHT, PORTAL_ICON_WIDTH, SHOW_CLUSTERS, SHOW_PLOTS, SHOWN_ALPHA
 
Fields inherited from class com.threerings.miso.client.MisoScenePanel
_activeMenu, _applicator, _armedItem, _blocks, _coordsDebug, _delayRepaint, _dframe, _dirtyItems, _dirtySprites, _dpanel, _fringes, _hcoords, _hitList, _hitSprites, _hobject, _ibounds, _indicators, _indicatorsLaidOut, _masks, _metrics, _model, _paintOp, _pathsDebug, _pendingBlocks, _resolveDebug, _resolver, _resolvers, _rethinkOp, _rsize, _showFlags, _tcoords, _traverseDebug, _ulpos, _vibounds, _visiBlocks, _vizobjs, ALPHA_FILL_TILE, DEF_RADIAL_RECT, DIRTY_RECT_STROKE, SHOW_TIPS
 
Fields inherited from class com.threerings.media.VirtualMediaPanel
_abounds, _background, _dx, _dy, _fmode, _fpath, _nx, _ny, _trackers, _vbounds, CENTER_ON_PATHABLE, ENCLOSE_PATHABLE, TRACK_PATHABLE
 
Fields inherited from class com.threerings.media.MediaPanel
_actionHandler, _actionSpriteCount, _animmgr, _metamgr, _obscurerList, _remgr, _spritemgr, _tickPaintPending
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, 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
ViewerScenePanel(StageContext ctx, com.threerings.cast.CharacterManager charmgr)
          Construct the panel and initialize it with a context.
 
Method Summary
 void checkpoint(String name, int ticks)
           
protected  void createDecoyPaths()
          Creates paths for the decoy sprites.
 void createDecoys()
          Creates the decoy sprites.
protected  boolean createPath(com.threerings.cast.CharacterSprite s, int x, int y)
          Assigns the sprite a path leading to the given destination screen coordinates.
protected  void createRandomPath(com.threerings.cast.CharacterSprite s)
          Assigns a new random path to the given sprite.
protected  com.threerings.cast.CharacterSprite createSprite(com.threerings.cast.CharacterDescriptor desc)
          Creates a new sprite.
 void mousePressed(MouseEvent e)
           
 void paint(Graphics g)
           
 void pathCancelled(com.threerings.media.sprite.Sprite sprite, com.threerings.media.util.Path path)
           
 void pathCompleted(com.threerings.media.sprite.Sprite sprite, com.threerings.media.util.Path path, long when)
           
 void setScene(StageScene scene, Location defloc)
           
 
Methods inherited from class com.threerings.stage.client.StageScenePanel
clusterUpdated, computeOverHover, computeUnderHover, containsPoint, defaultShowTips, didLeavePlace, dirtyCluster, dirtyCluster, drawCluster, getColorizer, getColorizer, getController, getPortal, getScene, handleMousePressed, hoverObjectChanged, isPortal, keyPressed, keyReleased, keyTyped, loadPortalTileSet, paintBaseDecorations, paintClusters, recomputePortals, recomputeVisible, removeCluster, sceneUpdated, setScene, showFlagsDidChange, updateCluster, willEnterPlace
 
Methods inherited from class com.threerings.miso.client.MisoScenePanel
addNotify, allBlocksFinished, appendDirtySprite, blockAbandoned, blockFinished, blockResolved, blockResolving, canTraverse, canTraverseUnresolved, centerOnTile, changeHoverObject, checkShowFlag, clearRadialMenu, clearScene, compose, computeFringeTile, computeIndicators, computeInfluentialBounds, computeInfluentialBounds, dirtyIndicator, enumerateResolvedBlocks, fillTile, fireObjectAction, getBaseTile, getBlock, getComponent, getFringeTile, getFullCoords, getHitObjects, getHoverCoords, getHoverObject, getInfluentialBounds, getObjectRadialSize, getPath, getRadialMenuBounds, getSceneMetrics, getSceneModel, getScreenCoords, getTileCoords, getTileManager, getTipIcon, getTipText, getViewBounds, handleObjectPressed, handleSpritePressed, isResponsive, menuDeactivated, mouseClicked, mouseDragged, mouseEntered, mouseExited, mouseMoved, mouseReleased, paintBetween, paintBits, paintDirtyItems, paintExtras, paintIndicator, paintIndicators, paintInFront, paintTiles, pressObject, refreshScene, removeNotify, repaintRect, reportMemoryUsage, rethink, setBounds, setSceneModel, setShowFlags, skipHitObject, updateTileCoords, viewLocationDidChange, warnVisible
 
Methods inherited from class com.threerings.media.VirtualMediaPanel
addObscurerDirtyRegion, addViewTracker, adjustBoundsCenter, clearPathable, constrainToBounds, didTick, dirtyScreenRect, doLayout, findRootBounds, paint, paintBehind, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeViewTracker, setBackground, setFollowsPathable, setViewLocation, trackPathable
 
Methods inherited from class com.threerings.media.MediaPanel
abortAnimation, addAnimation, addObscurer, addObscurerDirtyRegions, addSprite, clearAnimations, clearSprites, clipToDirtyRegion, createActionSpriteHandler, createGraphics, getAnimationManager, getRegionManager, getSpriteManager, getTimeStamp, isManaged, isManaged, needsPaint, paintDirtyRect, removeObscurer, removeSprite, repaint, setOpaque, setPaused, tick, willTick
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, 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, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, 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, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, 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, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, 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, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, 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, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_NUM_DECOYS

protected static final int DEFAULT_NUM_DECOYS
The number of decoy characters milling about.

See Also:
Constant Field Values

_defloc

protected StageLocation _defloc
The current scene's default entrance.


_charmgr

protected com.threerings.cast.CharacterManager _charmgr
Provides character sprite data.


_descUser

protected com.threerings.cast.CharacterDescriptor _descUser
The character descriptor for the user character.


_descDecoy

protected com.threerings.cast.CharacterDescriptor _descDecoy
The character descriptor for the decoy characters.


_sprite

protected com.threerings.cast.CharacterSprite _sprite
The sprite we're manipulating within the view.


_decoys

protected com.threerings.cast.CharacterSprite[] _decoys
The test sprites that meander about aimlessly.


COMP_CLASSES

protected static final String[] COMP_CLASSES
Defines our various character component classes.


COLOR_CLASSES

protected static final String[] COLOR_CLASSES
Defines the colorization classes used in the character component images.

Constructor Detail

ViewerScenePanel

public ViewerScenePanel(StageContext ctx,
                        com.threerings.cast.CharacterManager charmgr)
Construct the panel and initialize it with a context.

Method Detail

setScene

public void setScene(StageScene scene,
                     Location defloc)

createSprite

protected com.threerings.cast.CharacterSprite createSprite(com.threerings.cast.CharacterDescriptor desc)
Creates a new sprite.


createDecoys

public void createDecoys()
Creates the decoy sprites.


createDecoyPaths

protected void createDecoyPaths()
Creates paths for the decoy sprites.


paint

public void paint(Graphics g)
Overrides:
paint in class com.threerings.miso.client.MisoScenePanel

checkpoint

public void checkpoint(String name,
                       int ticks)
Specified by:
checkpoint in interface com.threerings.media.util.PerformanceObserver

mousePressed

public void mousePressed(MouseEvent e)
Specified by:
mousePressed in interface MouseListener
Overrides:
mousePressed in class com.threerings.miso.client.MisoScenePanel

createPath

protected boolean createPath(com.threerings.cast.CharacterSprite s,
                             int x,
                             int y)
Assigns the sprite a path leading to the given destination screen coordinates. Returns whether a path was successfully assigned.


createRandomPath

protected void createRandomPath(com.threerings.cast.CharacterSprite s)
Assigns a new random path to the given sprite.


pathCancelled

public void pathCancelled(com.threerings.media.sprite.Sprite sprite,
                          com.threerings.media.util.Path path)
Specified by:
pathCancelled in interface com.threerings.media.sprite.PathObserver

pathCompleted

public void pathCompleted(com.threerings.media.sprite.Sprite sprite,
                          com.threerings.media.util.Path path,
                          long when)
Specified by:
pathCompleted in interface com.threerings.media.sprite.PathObserver