|
|||||||||
| 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.miso.client.MisoScenePanel
com.threerings.stage.client.StageScenePanel
public class StageScenePanel
Extends the basic Miso scene panel with Stage fun stuff like portals, clusters and locations.
| Nested Class Summary | |
|---|---|
protected class |
StageScenePanel.PortalObjectTile
Used to render portals as objects in a scene. |
| 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 Map<Cluster,Shape> |
_clusters
Shapes describing the clusters, indexed by cluster. |
protected Map<Cluster,Shape> |
_clusterWells
Shapes describing the clusters, indexed by cluster. |
protected Controller |
_ctrl
The controller with which we work in tandem. |
protected StageContext |
_ctx
A reference to our client context. |
protected List<com.threerings.miso.client.SceneObject> |
_portobjs
Contains scene objects for our portals. |
protected SceneColorizer |
_rizer
Handles scene object colorization. |
protected StageScene |
_scene
Our currently displayed scene. |
static String |
CLUSTER_CLICKED
An action command generated when a cluster is clicked. |
protected static Color |
CLUSTER_COLOR
The color used to render clusters. |
protected static int |
CLUSTER_PAD
The amount the stroke a cluster. |
protected static int |
CLUSTER_SLOP
The number of pixels outside a cluster when we assume the mouse is "over" that cluster. |
protected static Stroke |
CLUSTER_STROKE
The width with which to draw the cluster. |
protected static Composite |
HIGHLIGHT_ALPHA
Alpha level used to hightlight locations or clusters. |
protected static Composite |
INACTIVE_PORTAL_ALPHA
The alpha with which to render inactive portals. |
static String |
LOCATION_CLICKED
An action command generated when the user clicks on a location within the scene. |
protected static int |
MAX_LOCATION_DIST
The distance within which the mouse must be from a location in order to highlight it. |
protected static int |
PORTAL_ICON_HEIGHT
The height of the portal icons. |
protected static int |
PORTAL_ICON_WIDTH
The width of the portal icons. |
static int |
SHOW_CLUSTERS
Show flag that indicates we should show all clusters. |
static int |
SHOW_PLOTS
Show flag that indicates we should render known land plots (expensive, don't turn this on willy nilly). |
protected static Composite |
SHOWN_ALPHA
Alpha level used to render clusters when they're not selected. |
| 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 | |
|---|---|
StageScenePanel(StageContext ctx,
Controller ctrl)
Constructs a stage scene view panel. |
|
| Method Summary | |
|---|---|
protected void |
clusterUpdated(Cluster cluster)
Called when a real cluster is created or updated in the scene. |
protected Object |
computeOverHover(int mx,
int my)
Gives derived classes a chance to compute a hover object that takes precedence over sprites and actionable objects. |
protected Object |
computeUnderHover(int mx,
int my)
Gives derived classes a chance to compute a hover object that is used if the mouse is not hovering over a sprite or actionable object. |
protected boolean |
containsPoint(Cluster cluster,
int mx,
int my)
Returns true if the specified cluster contains the supplied screen coordinate. |
protected boolean |
defaultShowTips()
Returns true if we should always show the object tooltips by default, false if they should only be shown while the 'Alt' key is depressed. |
void |
didLeavePlace(PlaceObject plobj)
|
protected void |
dirtyCluster(Cluster cluster)
Dirties the supplied cluster. |
protected void |
dirtyCluster(Shape shape)
Dirties the supplied cluster rectangle. |
protected void |
drawCluster(Graphics2D gfx,
Rectangle clip,
Cluster cluster)
Draw the cluster specified by the rectangle. |
SceneColorizer |
getColorizer()
Get the tileset colorizer in use in this scene. |
protected com.threerings.media.tile.TileSet.Colorizer |
getColorizer(com.threerings.miso.data.ObjectInfo oinfo)
|
Controller |
getController()
|
Portal |
getPortal(int fullX,
int fullY)
Returns the portal at the specified full coordinates or null if no portal exists at said coordinates. |
StageScene |
getScene()
Returns the scene being displayed by this panel. |
protected boolean |
handleMousePressed(Object hobject,
MouseEvent event)
|
protected void |
hoverObjectChanged(Object oldHover,
Object newHover)
A place for subclasses to react to the hover object changing. |
protected boolean |
isPortal(Location loc)
Returns true if the specified location is associated with a portal. |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
void |
keyTyped(KeyEvent e)
|
protected com.threerings.media.tile.UniformTileSet |
loadPortalTileSet()
Loads up the tileset used to render the portal arrows. |
protected void |
paintBaseDecorations(Graphics2D gfx,
Rectangle clip)
|
protected void |
paintClusters(Graphics2D gfx,
Rectangle clip)
Paints any visible clusters. |
protected void |
recomputePortals()
Computes a set of display objects for the portals in this scene. |
protected void |
recomputeVisible()
|
boolean |
removeCluster(int clusterOid)
Removes the specified cluster from the view. |
void |
sceneUpdated(SceneUpdate update)
Called when we have received a scene update from the server. |
void |
setScene(StageScene scene)
Sets the scene managed by the panel. |
protected void |
showFlagsDidChange(int oldflags)
Called when our show flags have changed. |
void |
updateCluster(Cluster cluster,
Rectangle bounds)
Adds or updates the specified cluster in the view. |
void |
willEnterPlace(PlaceObject plobj)
|
| 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, mousePressed, mouseReleased, paint, 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String LOCATION_CLICKED
public static final String CLUSTER_CLICKED
public static final int SHOW_CLUSTERS
public static final int SHOW_PLOTS
protected StageContext _ctx
protected Controller _ctrl
protected StageScene _scene
protected List<com.threerings.miso.client.SceneObject> _portobjs
protected Map<Cluster,Shape> _clusters
protected Map<Cluster,Shape> _clusterWells
protected SceneColorizer _rizer
protected static final int PORTAL_ICON_WIDTH
protected static final int PORTAL_ICON_HEIGHT
protected static final int MAX_LOCATION_DIST
protected static final int CLUSTER_PAD
protected static final Stroke CLUSTER_STROKE
protected static final Color CLUSTER_COLOR
protected static final Composite HIGHLIGHT_ALPHA
protected static final Composite SHOWN_ALPHA
protected static final Composite INACTIVE_PORTAL_ALPHA
protected static final int CLUSTER_SLOP
| Constructor Detail |
|---|
public StageScenePanel(StageContext ctx,
Controller ctrl)
| Method Detail |
|---|
public SceneColorizer getColorizer()
protected com.threerings.media.tile.TileSet.Colorizer getColorizer(com.threerings.miso.data.ObjectInfo oinfo)
getColorizer in class com.threerings.miso.client.MisoScenePanelpublic StageScene getScene()
public void setScene(StageScene scene)
public void sceneUpdated(SceneUpdate update)
protected void recomputePortals()
protected void recomputeVisible()
recomputeVisible in class com.threerings.miso.client.MisoScenePanelpublic Controller getController()
getController in interface ControllerProviderpublic void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerpublic void willEnterPlace(PlaceObject plobj)
willEnterPlace in interface PlaceViewpublic void didLeavePlace(PlaceObject plobj)
didLeavePlace in interface PlaceViewprotected boolean defaultShowTips()
public void keyTyped(KeyEvent e)
keyTyped in interface KeyListener
protected boolean handleMousePressed(Object hobject,
MouseEvent event)
handleMousePressed in class com.threerings.miso.client.MisoScenePanelprotected void showFlagsDidChange(int oldflags)
showFlagsDidChange in class com.threerings.miso.client.MisoScenePanelprotected void clusterUpdated(Cluster cluster)
public void updateCluster(Cluster cluster,
Rectangle bounds)
cluster - the cluster record to be added.bounds - the screen coordinates that bound the occupants of the cluster.public boolean removeCluster(int clusterOid)
protected void hoverObjectChanged(Object oldHover,
Object newHover)
hoverObjectChanged in class com.threerings.miso.client.MisoScenePanel
protected Object computeOverHover(int mx,
int my)
computeOverHover in class com.threerings.miso.client.MisoScenePanel
protected Object computeUnderHover(int mx,
int my)
computeUnderHover in class com.threerings.miso.client.MisoScenePanel
protected boolean containsPoint(Cluster cluster,
int mx,
int my)
protected void dirtyCluster(Cluster cluster)
protected void dirtyCluster(Shape shape)
public Portal getPortal(int fullX,
int fullY)
protected void paintBaseDecorations(Graphics2D gfx,
Rectangle clip)
paintBaseDecorations in class com.threerings.miso.client.MisoScenePanel
protected void paintClusters(Graphics2D gfx,
Rectangle clip)
protected void drawCluster(Graphics2D gfx,
Rectangle clip,
Cluster cluster)
protected boolean isPortal(Location loc)
protected com.threerings.media.tile.UniformTileSet loadPortalTileSet()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||