|
|||||||||
| 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
com.threerings.stage.tools.editor.EditorScenePanel
public class EditorScenePanel
Displays the scene view and handles UI events on the scene. Various actions may be performed on the scene depending on the selected action mode, including placing and deleting tiles or locations and creating portals.
| Nested Class Summary | |
|---|---|
static interface |
EditorScenePanel.SceneModelListener
|
protected class |
EditorScenePanel.UndoStack
|
| 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 Rectangle |
_area
The virtual screen rectangle around which we scroll. |
protected EditorScrollBox |
_box
The scrollbox that tracks our view. |
protected boolean |
_coordHighlighting
Whether or not coordinate highlighting is enabled. |
protected EditorContext |
_ctx
Provides access to stuff. |
protected PortalDialog |
_dialogPortal
The dialog providing portal edit functionality. |
protected Point |
_drag
The location of the start of a tile drag in tile coords. |
protected EditorModel |
_emodel
Our editor model. |
protected com.threerings.miso.client.SceneObject |
_eobject
The object currently being edited by the object editor dialog. |
protected ArrayList<ExtrasPainter> |
_extras
A list of things that will do some extra painting for us. |
protected JFrame |
_frame
We need this to create our dialogs when they are needed. |
protected Point |
_hfull
The currently highlighted full coordinate. |
protected BoundedRangeModel |
_horizRange
Allows scrolling horizontally. |
protected static Polygon |
_locTri
The triangle used to render a portal on-screen. |
protected ObjectEditorDialog |
_objEditor
The dialog providing object edit functionality. |
protected Point |
_ppos
The position of the tile currently being placed. |
protected com.threerings.miso.client.SceneObject |
_pscobj
Metrics for the tile currently being placed if it is an object tile. |
protected com.threerings.media.tile.Tile |
_ptile
The tile currently being placed. |
protected EditorScenePanel.UndoStack |
_redo
|
protected boolean |
_refreshBox
Do we need to refresh the image being displayed in our scrollbox? |
protected EditorScenePanel.SceneModelListener |
_sceneListener
|
protected EditorScenePanel.UndoStack |
_undo
|
protected boolean |
_validPlacement
Used to track whether or not the current "placing" tile is in a valid position. |
protected BoundedRangeModel |
_vertRange
Allows scrolling vertically. |
protected static Composite |
ALPHA_PLACING
Alpha level used to render transparent placing tile image. |
protected static Stroke |
HIGHLIGHT_STROKE
The stroke object used to draw highlighted tiles and coordinates. |
protected static int |
MAX_UNDO_SIZE
|
| Fields inherited from class com.threerings.stage.client.StageScenePanel |
|---|
_clusters, _clusterWells, _ctrl, _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.stage.tools.editor.EditorModelListener |
|---|
ACTION_MODE_CHANGED, LAYER_INDEX_CHANGED, TILE_CHANGED |
| 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 | |
|---|---|
EditorScenePanel(EditorContext ctx,
JFrame frame,
EditorModel model,
EditorScenePanel.SceneModelListener sceneListener)
Constructs the editor scene view panel. |
|
| Method Summary | |
|---|---|
protected void |
addExtrasPainter(ExtrasPainter painter)
Add an extras painter. |
com.threerings.miso.data.ObjectInfo |
addObject(com.threerings.miso.data.ObjectInfo oinfo)
Adds the given object to the scene. |
com.threerings.miso.data.ObjectInfo |
addObject(com.threerings.media.tile.ObjectTile tile,
int fqTileId,
int x,
int y)
Sets an object tile at the specified position in the scene (in tile coordinates). |
protected void |
adjustObjectCoordsAccordingToGrip(Point p,
com.threerings.media.tile.ObjectTile tile)
Alter the position of the object according to which corner we are holding it by. |
Rectangle |
clearTileSelectRegion(int x,
int y)
Clear and return the drag rectangle for selecting a rectangular region. |
protected void |
computeScrollArea()
Computes the area in which the view is allowed to scroll. |
boolean |
deleteObject(com.threerings.miso.data.ObjectInfo info)
Delete the given object from the scene. |
boolean |
deleteObject(com.threerings.miso.client.SceneObject scobj)
Deletes the object tile at the specified tile coordinates. |
void |
deletePortal(int x,
int y)
Deletes the portal at the specified full coordinates. |
protected void |
deleteTile(int x,
int y)
Handle deleting the tile at the given screen coordinates from the scene. |
protected void |
editPortal(EditablePortal portal)
Pop up the portal dialog for the specified location. |
protected void |
editTile(int x,
int y)
Handle editing the tile at the given screen coordinates from the scene. |
void |
enableCoordHighlighting(boolean enabled)
Enables or disables highlighting of the tile over which the mouse is currently positioned. |
protected void |
fireObjectAction(com.threerings.miso.client.ObjectActionHandler handler,
com.threerings.miso.client.SceneObject scobj,
ActionEvent event)
|
Portal |
getEntrance()
Returns the portal that serves as the default entrance to this scene or null if no default is set. |
BoundedRangeModel |
getHorizModel()
Returns a range model that controls the scrollability of the scene in the horizontal direction. |
BoundedRangeModel |
getVertModel()
Returns a range model that controls the scrollability of the scene in the vertical direction. |
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 |
isTilePlacementValid(int x,
int y,
com.threerings.media.tile.Tile tile)
Returns whether placing a tile at the given coordinates in the scene is valid. |
void |
keyPressed(KeyEvent e)
|
void |
keyReleased(KeyEvent e)
|
protected void |
markCheckpoint()
|
void |
modelChanged(int event)
Called by the EditorModel when the model is changed. |
void |
mouseDragged(MouseEvent e)
|
void |
mouseExited(MouseEvent e)
|
void |
mouseMoved(MouseEvent e)
|
void |
mousePressed(MouseEvent event)
|
void |
mouseReleased(MouseEvent e)
|
protected void |
objectEditorDismissed()
Called by the ObjectEditorDialog when it is dismissed. |
protected boolean |
overlaps(com.threerings.miso.client.SceneObject tobj)
Helper function for recomputeVisible(). |
protected void |
paint(Graphics2D gfx,
Rectangle[] dirty)
|
protected void |
paintExtras(Graphics2D gfx,
Rectangle dirty)
|
protected void |
paintHighlights(Graphics2D gfx,
Rectangle dirty)
|
protected void |
paintLocation(Graphics2D gfx,
StageLocation loc,
Color color,
boolean highlight)
Paint the specified StageLocation |
protected void |
paintPlacingTile(Graphics2D gfx)
Paints a transparent image of the tile being placed and draws a highlight around the bounds of the tile's current prospective position. |
protected void |
paintPortal(Graphics2D gfx,
EditablePortal port)
Paint the specified portal. |
protected void |
paintPortals(Graphics2D gfx)
Paint demarcations at all portals in the scene. |
protected void |
placeTile(int x,
int y)
Handle placing the currently selected tile at the given screen coordinates in the scene. |
protected void |
recomputeVisible()
|
void |
redo()
|
protected void |
removeExtrasPainter(ExtrasPainter painter)
Remove the specified extras painter. |
protected void |
selectTile(int x,
int y)
|
boolean |
setBaseTile(int fqTileId,
int x,
int y)
Sets a base tile at the specified position in the scene (in tile coordinates). |
void |
setBaseTiles(Rectangle r,
int setId,
int tileCount)
Set a region of tiles to a random selection from the supplied tileset. |
void |
setBounds(int x,
int y,
int width,
int height)
|
protected void |
setEditorModel(EditorModel model)
Sets the editor model. |
void |
setEditorScrollBox(EditorScrollBox box)
Set the scroll box that tracks our view. |
void |
setEntrance(Portal port)
Makes the specified portal the default entrance to this scene. |
void |
setPlacingTile(com.threerings.media.tile.Tile tile)
Sets the tile that is currently being placed. |
void |
setSceneModel(com.threerings.miso.data.MisoSceneModel model)
|
void |
setTileSelectRegion(Point drag)
Sets the start (in tile coords) of a mouse drag when placing a rectangular area of base tiles. |
protected boolean |
skipHitObject(com.threerings.miso.client.SceneObject scobj)
|
void |
stateChanged(ChangeEvent e)
|
void |
undo()
|
protected void |
updateBaseTiles(int x,
int y,
Rectangle drag,
int fqTileId,
int tileSetId,
int tileCount)
Used to place or delete base tiles. |
boolean |
updateCoordPos(int x,
int y,
Point cpos)
Updates the coordinate position and returns true if it has changed. |
void |
updateDefaultTileSet(int tileSetId)
Updates the default tileset in the currently edited scene. |
protected boolean |
updateObjectTileCoords(int sx,
int sy,
Point tpos,
com.threerings.media.tile.ObjectTile otile)
Converts the supplied screen coordinates into tile coordinates for an object tile. |
protected void |
updateScrollArea(int hval,
int vval)
Updates our bounded range models to reflect potential changes in the viewable area and the scrollable area. |
protected void |
warnVisible(com.threerings.miso.client.SceneBlock block,
Rectangle sbounds)
|
| Methods inherited from class com.threerings.stage.client.StageScenePanel |
|---|
clusterUpdated, computeOverHover, computeUnderHover, containsPoint, defaultShowTips, didLeavePlace, dirtyCluster, dirtyCluster, drawCluster, getColorizer, getColorizer, getController, getPortal, getScene, isPortal, keyTyped, loadPortalTileSet, paintBaseDecorations, paintClusters, recomputePortals, 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, 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, mouseEntered, paint, paintBetween, paintBits, paintDirtyItems, paintIndicator, paintIndicators, paintInFront, paintTiles, pressObject, refreshScene, removeNotify, repaintRect, reportMemoryUsage, rethink, setShowFlags, updateTileCoords, viewLocationDidChange |
| Methods inherited from class com.threerings.media.VirtualMediaPanel |
|---|
addObscurerDirtyRegion, addViewTracker, adjustBoundsCenter, clearPathable, constrainToBounds, didTick, dirtyScreenRect, doLayout, findRootBounds, 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 |
|---|
protected static final int MAX_UNDO_SIZE
protected EditorContext _ctx
protected EditorModel _emodel
protected EditorScrollBox _box
protected boolean _refreshBox
protected JFrame _frame
protected BoundedRangeModel _horizRange
protected BoundedRangeModel _vertRange
protected Rectangle _area
protected boolean _coordHighlighting
protected Point _hfull
protected Point _drag
protected Point _ppos
protected boolean _validPlacement
protected com.threerings.media.tile.Tile _ptile
protected com.threerings.miso.client.SceneObject _pscobj
protected ArrayList<ExtrasPainter> _extras
protected PortalDialog _dialogPortal
protected ObjectEditorDialog _objEditor
protected com.threerings.miso.client.SceneObject _eobject
protected EditorScenePanel.UndoStack _undo
protected EditorScenePanel.UndoStack _redo
protected EditorScenePanel.SceneModelListener _sceneListener
protected static Polygon _locTri
protected static final Stroke HIGHLIGHT_STROKE
protected static final Composite ALPHA_PLACING
| Constructor Detail |
|---|
public EditorScenePanel(EditorContext ctx,
JFrame frame,
EditorModel model,
EditorScenePanel.SceneModelListener sceneListener)
| Method Detail |
|---|
public BoundedRangeModel getHorizModel()
public BoundedRangeModel getVertModel()
public void stateChanged(ChangeEvent e)
stateChanged in interface ChangeListenerpublic void setSceneModel(com.threerings.miso.data.MisoSceneModel model)
setSceneModel in class com.threerings.miso.client.MisoScenePanelpublic void updateDefaultTileSet(int tileSetId)
public void setBounds(int x,
int y,
int width,
int height)
setBounds in class com.threerings.miso.client.MisoScenePanelprotected void computeScrollArea()
protected void updateScrollArea(int hval,
int vval)
protected void placeTile(int x,
int y)
protected void deleteTile(int x,
int y)
protected void updateBaseTiles(int x,
int y,
Rectangle drag,
int fqTileId,
int tileSetId,
int tileCount)
protected void editTile(int x,
int y)
protected void selectTile(int x,
int y)
protected void objectEditorDismissed()
ObjectEditorDialog when it is dismissed.
protected void editPortal(EditablePortal portal)
public void modelChanged(int event)
EditorModelListenerEditorModel when the model is changed.
modelChanged in interface EditorModelListenerpublic void mousePressed(MouseEvent event)
mousePressed in interface MouseListenermousePressed in class com.threerings.miso.client.MisoScenePanel
protected boolean handleMousePressed(Object hobject,
MouseEvent event)
handleMousePressed in class StageScenePanelpublic void mouseReleased(MouseEvent e)
mouseReleased in interface MouseListenermouseReleased in class com.threerings.miso.client.MisoScenePanelpublic void mouseMoved(MouseEvent e)
mouseMoved in interface MouseMotionListenermouseMoved in class com.threerings.miso.client.MisoScenePanelpublic void mouseDragged(MouseEvent e)
mouseDragged in interface MouseMotionListenermouseDragged in class com.threerings.miso.client.MisoScenePanelpublic void mouseExited(MouseEvent e)
mouseExited in interface MouseListenermouseExited in class com.threerings.miso.client.MisoScenePanelpublic void keyPressed(KeyEvent e)
keyPressed in interface KeyListenerkeyPressed in class StageScenePanelpublic void keyReleased(KeyEvent e)
keyReleased in interface KeyListenerkeyReleased in class StageScenePanel
protected void fireObjectAction(com.threerings.miso.client.ObjectActionHandler handler,
com.threerings.miso.client.SceneObject scobj,
ActionEvent event)
fireObjectAction in class com.threerings.miso.client.MisoScenePanel
protected void hoverObjectChanged(Object oldHover,
Object newHover)
hoverObjectChanged in class StageScenePanel
public boolean setBaseTile(int fqTileId,
int x,
int y)
public void setBaseTiles(Rectangle r,
int setId,
int tileCount)
public com.threerings.miso.data.ObjectInfo addObject(com.threerings.media.tile.ObjectTile tile,
int fqTileId,
int x,
int y)
public com.threerings.miso.data.ObjectInfo addObject(com.threerings.miso.data.ObjectInfo oinfo)
public boolean deleteObject(com.threerings.miso.client.SceneObject scobj)
public boolean deleteObject(com.threerings.miso.data.ObjectInfo info)
public void setPlacingTile(com.threerings.media.tile.Tile tile)
MisoScenePanel.updateTileCoords(int, int, java.awt.Point) on the
placing tile (which happens automatically when the mouse moves).
public void setTileSelectRegion(Point drag)
public Rectangle clearTileSelectRegion(int x,
int y)
public void enableCoordHighlighting(boolean enabled)
public void deletePortal(int x,
int y)
public Portal getEntrance()
public void setEntrance(Portal port)
protected void recomputeVisible()
recomputeVisible in class StageScenePanel
protected void warnVisible(com.threerings.miso.client.SceneBlock block,
Rectangle sbounds)
warnVisible in class com.threerings.miso.client.MisoScenePanelprotected boolean overlaps(com.threerings.miso.client.SceneObject tobj)
recomputeVisible().
protected void paintHighlights(Graphics2D gfx,
Rectangle dirty)
protected void paintExtras(Graphics2D gfx,
Rectangle dirty)
paintExtras in class com.threerings.miso.client.MisoScenePanelprotected void addExtrasPainter(ExtrasPainter painter)
protected void removeExtrasPainter(ExtrasPainter painter)
protected void paintPlacingTile(Graphics2D gfx)
gfx - the graphics context.protected void paintPortals(Graphics2D gfx)
gfx - the graphics context.
protected void paintPortal(Graphics2D gfx,
EditablePortal port)
protected void paintLocation(Graphics2D gfx,
StageLocation loc,
Color color,
boolean highlight)
public boolean updateCoordPos(int x,
int y,
Point cpos)
protected boolean isTilePlacementValid(int x,
int y,
com.threerings.media.tile.Tile tile)
protected boolean skipHitObject(com.threerings.miso.client.SceneObject scobj)
skipHitObject in class com.threerings.miso.client.MisoScenePanel
protected boolean updateObjectTileCoords(int sx,
int sy,
Point tpos,
com.threerings.media.tile.ObjectTile otile)
MisoScenePanel.updateTileCoords(int, int, java.awt.Point).)
protected void adjustObjectCoordsAccordingToGrip(Point p,
com.threerings.media.tile.ObjectTile tile)
protected void setEditorModel(EditorModel model)
public void setEditorScrollBox(EditorScrollBox box)
protected void paint(Graphics2D gfx,
Rectangle[] dirty)
paint in class com.threerings.media.VirtualMediaPanelprotected void markCheckpoint()
public void undo()
public void redo()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||