com.threerings.tudey.tools
Class SceneEditor

java.lang.Object
  extended by com.threerings.expr.DynamicScope
      extended by com.threerings.opengl.GlApp
          extended by com.threerings.opengl.GlCanvasApp
              extended by com.threerings.opengl.GlCanvasTool
                  extended by com.threerings.tudey.tools.TudeyTool
                      extended by com.threerings.tudey.tools.SceneEditor
All Implemented Interfaces:
CrowdContext, EditorContext, Scope, ScopeUpdateListener, AlContext, Enqueueable, GlContext, PresentsContext, TudeySceneModel.Observer, EntryManipulator, TudeyContext, WhirledContext, ClipboardOwner, ActionListener, MouseListener, KeyEventDispatcher, EventListener

public class SceneEditor
extends TudeyTool
implements EntryManipulator, TudeySceneModel.Observer, KeyEventDispatcher, MouseListener, ClipboardOwner

The scene editor application.


Nested Class Summary
protected  class SceneEditor.SceneEditorPrefs
          The preferences for the scene editor.
 
Nested classes/interfaces inherited from class com.threerings.opengl.GlCanvasTool
GlCanvasTool.CanvasToolPrefs
 
Field Summary
protected  EditorTool _activeTool
          The active tool.
protected  boolean _altDown
          Whether or not the shift, control, and/or alt keys are being held down.
protected  AreaDefiner _areaDefiner
          The area definer tool.
protected  Arrow _arrow
          The arrow tool.
protected  JFileChooser _chooser
          The file chooser for opening and saving scene files.
protected  boolean _compassEnabled
          Whether or not the compass/grid are enabled.
protected  boolean _controlDown
          Whether or not the shift, control, and/or alt keys are being held down.
protected  Action _copy
          The edit menu actions.
protected  Action _cut
          The edit menu actions.
protected  Action _delete
          The edit menu actions.
protected  int _divsize
          The size of the divider.
protected  int _editId
          The current edit id.
protected  JPanel _epanel
          The panel that holds the editor bits.
protected  JFileChooser _exportChooser
          The file chooser for importing and exporting scene files.
protected  JMenuItem _exportSelection
          The selection export menu item.
protected  File _file
          The loaded scene file.
protected  boolean _firstButtonDown
          Whether or not each of the mouse buttons are being held down on the canvas.
protected  JToggleButton _fog
          Toggle buttons.
protected  boolean _fogEnabled
          Whether or not fog is enabled.
protected  GlobalEditor _globalEditor
          The global editor tool.
protected  EditorGrid _grid
          A casted reference to the editor grid.
protected  boolean _gridEnabled
          Whether or not the compass/grid are enabled.
protected  GroundBrush _groundBrush
          The ground brush tool.
protected  File _initScene
          The file to attempt to load on initialization, if any.
protected  int _layerDividerPos
          The last position of the layer divider.
protected  Layers _layers
          The layer display tool.
protected  JSplitPane _layerSplit
          The pane splitting layers from the other tools.
protected  JToggleButton _light
          Toggle buttons.
protected  boolean _lightingEnabled
          Whether or not lighting is enabled.
protected  JMenuItem _lower
          The raise/lower menu items.
protected  JToggleButton _markers
          Toggle buttons.
protected  boolean _markersVisible
          Whether or not markers are visible.
protected  Mover _mover
          The mover tool.
protected  JPanel _opanel
          The panel that holds the tool options.
protected  SimpleTransformable _origin
          Draws the coordinate system origin.
protected  Palette _palette
          The palette tool.
protected  JSplitPane _pane
          The split pane containing the canvas, toolbar, etc.
protected  Action _paste
          The edit menu actions.
protected  PathDefiner _pathDefiner
          The path definer tool.
protected  Ray3D _pick
          Used for picking.
protected  Placer _placer
          The placer tool.
protected static Preferences _prefs
          The application preferences.
protected  Vector3f _pt
          Holds the location of the pick result.
protected  JMenuItem _raise
          The raise/lower menu items.
protected static List<String> _recentFiles
          Recently opened files.
protected  JMenu _recents
          The recently-opened files.
protected  Action _redo
          The undo and redo actions.
protected  JMenuItem _revert
          The revert menu item.
protected  JMenuItem _rotateCCW
          The rotate menu items.
protected  JMenuItem _rotateCW
          The rotate menu items.
protected  JMenuItem _saveToPalette
          The save-to-palette menu item.
protected  TudeySceneModel _scene
          The scene being edited.
protected  int _sceneId
          The scene id used for testing.
protected  boolean _secondButtonDown
          Whether or not each of the mouse buttons are being held down on the canvas.
protected  TudeySceneModel.Entry[] _selection
          The selected elements.
protected  JFileChooser _selectionChooser
          The file chooser for importing and exporting selections.
protected  Vector2f _selectionPivot
          The center of rotation for the selection.
protected  Selector _selector
          The selector tool.
protected  boolean _shiftDown
          Whether or not the shift, control, and/or alt keys are being held down.
protected  JToggleButton _sound
          Toggle buttons.
protected  boolean _soundEnabled
          Whether or not sound is enabled.
protected  boolean _testing
          Set when we are in test mode.
protected  boolean _thirdButtonDown
          Whether or not each of the mouse buttons are being held down on the canvas.
protected  TileBrush _tileBrush
          The tile brush tool.
protected  JToolBar _toolbar
          The tool bar.
protected  Map<String,EditorTool> _tools
          Tools mapped by name.
protected  Action _undo
          The undo and redo actions.
protected  UndoManager _undomgr
          The undo manager.
protected  UndoableEditSupport _undoSupport
          The undoable edit support object.
protected  TudeySceneView _view
          The scene view.
protected  WallBrush _wallBrush
          The wall brush tool.
static com.google.common.base.Predicate<Object> DEFAULT_ENTRY_FILTER
          Allows all entries except globals.
static com.google.common.base.Function<TudeySceneModel.Entry,Object> ENTRY_TO_KEY
          A function that transforms an Entry to its key.
protected static int MAX_RECENT_FILES
          The maximum number of recently opened files to show.
static com.google.common.base.Predicate<Object> PLACEABLE_ENTRY_FILTER
          Allows only placeable entries.
static com.google.common.base.Predicate<Object> TILE_ENTRY_FILTER
          Allows only tile entries.
protected static Dimension TOOL_BUTTON_SIZE
          The size of the tool buttons.
 
Fields inherited from class com.threerings.tudey.tools.TudeyTool
_chatdir, _client, _config, _locdir, _occdir, _root, _scenedir, _server
 
Fields inherited from class com.threerings.opengl.GlCanvasTool
_bounds, _compass, _eprefs, _msgs, _pdialog, _showBounds, _showCompass, _showGrid, _showStats, _stats
 
Fields inherited from class com.threerings.opengl.GlCanvasApp
_canvas, _canvasRoot, _frame, _keymgr
 
Fields inherited from class com.threerings.opengl.GlApp
_at, _billboardRotation, _camhand, _cfgmgr, _clipprov, _colorpos, _compatibilityMode, _compositor, _epoch, _imgcache, _msgmgr, _now, _renderEffects, _renderer, _renderScheme, _rsrcmgr, _shadcache, _soundmgr, _streamGain, _up, _viewTransform, _viewTransformState, _worldTransform, PIXEL_FORMATS
 
Fields inherited from class com.threerings.expr.DynamicScope
_compoundDepth, _listeners, _owner, _parentScope, _scopeName, _symbols, INVALID_SCOPE
 
Fields inherited from interface com.threerings.expr.Scope
EPOCH, NOW
 
Constructor Summary
SceneEditor(String scene)
          Creates the scene editor with (optionally) the path to a scene to load.
 
Method Summary
 void actionPerformed(ActionEvent event)
           
 void addEntries(TudeySceneModel.Entry... entries)
          Adds entries to the scene.
protected  void addTool(JPanel tpanel, ButtonGroup tgroup, String name, EditorTool tool)
          Adds a tool to the tool panel.
protected  void bindAction(JComponent comp, int keyCode, int modifiers, String action)
          Binds a keystroke to an action on the specified component.
protected  void clearPaint(TudeySceneModel.TileEntry entry)
          Clears any paint underneath the specified tile entry.
 void clearPlaceView(PlaceView view)
           
 void clearSelection()
          Clears the selection.
protected  void compositeView()
          Gives the application a chance to composite anything it might want rendered.
protected  void copySelection()
          Copies the selected entries to the clipboard.
protected  CameraHandler createCameraHandler()
          Creates and returns the camera handler.
protected  JComponent createCanvasContainer()
          Creates and returns the component that contains the canvas (after the canvas has been created).
protected  GlCanvasTool.CanvasToolPrefs createEditablePrefs()
          Creates and returns the editable preferences.
protected  Grid createGrid()
          Creates the grid object.
protected  ImageIcon createIcon(String name)
          Creates the named icon.
protected  JButton createIconButton(String name)
          Creates an icon button with the specified name.
protected  JToggleButton createToggleButton(String name)
          Creates a toggle button with different icons for the unselected and selected states.
protected  void deleteErrors()
          Deletes all entries whose configurations are null or missing.
 void deleteMouseEntry()
          Attempts to delete the entry under the mouse cursor on the currently selected layer.
 void deleteMouseEntry(com.google.common.base.Predicate<? super TudeySceneModel.Entry> filter)
          Attempts to delete the entry under the mouse cursor on the currently selected layer.
protected  void deleteSelection()
          Deletes the entries under the selected region.
protected  void didInit()
          Override to perform custom initialization after the render context is valid.
 boolean dispatchKeyEvent(KeyEvent event)
           
 void editMouseEntry()
          Attempts to edit the entry under the mouse cursor on the currently selected layer.
 void entryAdded(TudeySceneModel.Entry entry)
          Notes that an entry has been added to the scene.
 void entryRemoved(TudeySceneModel.Entry oentry)
          Notes that an entry has been removed from the scene.
 void entryUpdated(TudeySceneModel.Entry oentry, TudeySceneModel.Entry nentry)
          Notes that an entry has been updated within the scene.
protected  void exportScene()
          Brings up the export dialog.
protected  void exportSelection()
          Brings up the selection export dialog.
 ConfigManager getConfigManager()
          Returns a reference to the configuration manager.
 EditorGrid getGrid()
          Returns a reference to the editor grid.
 com.google.common.base.Predicate<TudeySceneModel.Entry> getLayerPredicate()
          Returns a Predicate that selects entries only on the current layer.
 TudeySceneModel.Entry getMouseEntry()
          Returns a reference to the entry under the mouse cursor on the currently selected layer.
 TudeySceneModel.Entry getMouseEntry(com.google.common.base.Predicate<? super TudeySceneModel.Entry> filter)
          Returns a reference to the entry under the mouse cursor on the currently selected layer.
 TudeySceneModel.Entry[] getSelection()
          Returns the selected elements.
protected  int getSelectionIndex(TudeySceneModel.Entry entry)
          Returns the index of the specified entry within the selection, or -1 if it is not selected.
 TudeySceneView getView()
          Returns a reference to the scene view.
protected  void importScene()
          Brings up the import dialog.
protected  void importSelection()
          Brings up the selection import dialog.
 void incrementEditId()
          Increments the edit id, ensuring that any further edits will not be merged with previous ones.
 boolean isAltDown()
          Checks whether the alt key is being held down.
 boolean isControlDown()
          Checks whether the control key is being held down.
 boolean isFirstButtonDown()
          Checks whether the first mouse button is being held down on the canvas.
 boolean isSecondButtonDown()
          Checks whether the second mouse button is being held down on the canvas.
 boolean isSelected(TudeySceneModel.Entry entry)
          Determines whether the specified entry is selected.
 boolean isShiftDown()
          Checks whether the shift key is being held down.
 boolean isSpecialDown()
          Checks whether either of the special modifiers (control or alt) is down.
 boolean isThirdButtonDown()
          Checks whether the third mouse button is being held down on the canvas.
 void lostOwnership(Clipboard clipboard, Transferable contents)
           
static void main(String[] args)
          The program entry point.
protected  boolean mouseCameraEnabled()
          Determines whether mouse camera control is enabled.
 void mouseClicked(MouseEvent event)
           
 void mouseEntered(MouseEvent event)
           
 void mouseExited(MouseEvent event)
           
 void mousePressed(MouseEvent event)
           
 void mouseReleased(MouseEvent event)
           
 void move(TudeySceneModel.Entry... entries)
          Activates the supplied entries in the mover tool.
 void moveSelection()
          Starts moving the current selection.
protected  void newScene()
          Creates a new scene.
protected  void open()
          Brings up the open dialog.
protected  void open(File file)
          Attempts to open the specified scene file.
 void overwriteEntries(TudeySceneModel.Entry... entries)
          Adds an entry, removing any conflicting entries if necessary.
protected  void raiseSelection(int amount)
          Raises or lowers the entries under the selection region by the specified amount.
 void removeAndMove(TudeySceneModel.Entry... entries)
          Removes the specified entries, then activates them in the mover tool.
 void removeEntries(Collection<? extends TudeySceneModel.Entry> coll)
          Removes the specified entries from the scene.
 void removeEntries(Object... keys)
          Removes entries from the scene.
protected  void rotateSelection(int amount)
          Rotates the entries under the selection region by the specified amount.
protected  void save()
          Brings up the save dialog.
protected  void save(File file)
          Attempts to save to the specified file.
protected  boolean saveWarning(String message)
          Show a warning if the scene is unsaved.
 void select(TudeySceneModel.Entry... selection)
          Selects the specified entries and switches to either the selector tool or the arrow tool, depending on whether multiple entries are selected.
protected  void setActiveTool(EditorTool tool)
          Sets the active tool.
protected  void setFile(File file)
          Sets the file and updates the revert item and title bar.
 void setPaint(Rectangle region, TudeySceneModel.Paint paint)
          Sets or clears the paint for a region in the scene.
 void setPlaceView(PlaceView view)
           
protected  void setScene(TudeySceneModel scene)
          Initializes the scene.
 void setSelection(TudeySceneModel.Entry... selection)
          Sets the selected elements.
protected  void setupMacSupport()
          Configure Mac support, if we're running on a Mac.
 void shutdown()
          Shuts down the application.
protected  void testScene()
          Enters the scene test mode.
protected  void transformSelection(Transform3D xform)
          Transforms the selection.
 void updateEntries(TudeySceneModel.Entry... entries)
          Updates entries within the scene.
protected  void updateTitle()
          Updates the title based on the file.
protected  void updateUndoActions()
          Updates the enabled states of the undo and redo actions.
protected  void updateView(float elapsed)
          Performs any updates that are necessary even when not rendering.
 void useMouseEntry()
          Attempts to "use" the entry under the mouse cursor on the currently selected layer.
protected  void validateReferences()
          Validates the scene's references.
 
Methods inherited from class com.threerings.tudey.tools.TudeyTool
getChatDirector, getClient, getConfig, getDObjectManager, getLocationDirector, getOccupantDirector, getRoot, getSceneDirector, initSharedManagers, setView, willShutdown
 
Methods inherited from class com.threerings.opengl.GlCanvasTool
createAction, createAction, createBounds, createButton, createButton, createCheckBoxMenuItem, createCheckBoxMenuItem, createMenu, createMenuItem, createMenuItem, shouldCheckTimestamps
 
Methods inherited from class com.threerings.opengl.GlCanvasApp
createCanvas, createRoot, getCanvas, getFrame, getMouseRay, getPickRay, getRunQueue, initRenderer, makeCurrent, startup
 
Methods inherited from class com.threerings.opengl.GlApp
createSnapshot, enqueue, getApp, getCameraHandler, getClipProvider, getColorPository, getCompatibilityMode, getCompositor, getImageCache, getMessageManager, getRenderEffects, getRenderer, getRenderScheme, getResourceManager, getScope, getShaderCache, getSoundManager, getStreamGain, init, renderView, setCameraHandler, setCompatibilityMode, setRenderEffects, setRenderer, setRenderScheme, updateView, xlate
 
Methods inherited from class com.threerings.expr.DynamicScope
addListener, dispose, endCompoundUpdate, get, getParentScope, getScopeName, put, remove, removeListener, scopeUpdated, setParentScope, startCompoundUpdate, wasUpdated
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.threerings.opengl.util.GlContext
getApp, getCameraHandler, getColorPository, getCompositor, getImageCache, getMessageManager, getRenderer, getResourceManager, getScope, getShaderCache, makeCurrent, setCameraHandler, setRenderer
 
Methods inherited from interface com.threerings.openal.util.AlContext
getClipProvider, getSoundManager
 
Methods inherited from interface com.threerings.crowd.util.CrowdContext
getMessageManager
 

Field Detail

TILE_ENTRY_FILTER

public static final com.google.common.base.Predicate<Object> TILE_ENTRY_FILTER
Allows only tile entries.


PLACEABLE_ENTRY_FILTER

public static final com.google.common.base.Predicate<Object> PLACEABLE_ENTRY_FILTER
Allows only placeable entries.


DEFAULT_ENTRY_FILTER

public static final com.google.common.base.Predicate<Object> DEFAULT_ENTRY_FILTER
Allows all entries except globals.


ENTRY_TO_KEY

public static final com.google.common.base.Function<TudeySceneModel.Entry,Object> ENTRY_TO_KEY
A function that transforms an Entry to its key.


_initScene

protected File _initScene
The file to attempt to load on initialization, if any.


_undomgr

protected UndoManager _undomgr
The undo manager.


_undoSupport

protected UndoableEditSupport _undoSupport
The undoable edit support object.


_editId

protected int _editId
The current edit id.


_revert

protected JMenuItem _revert
The revert menu item.


_exportSelection

protected JMenuItem _exportSelection
The selection export menu item.


_undo

protected Action _undo
The undo and redo actions.


_redo

protected Action _redo
The undo and redo actions.


_cut

protected Action _cut
The edit menu actions.


_copy

protected Action _copy
The edit menu actions.


_paste

protected Action _paste
The edit menu actions.


_delete

protected Action _delete
The edit menu actions.


_recents

protected JMenu _recents
The recently-opened files.


_rotateCW

protected JMenuItem _rotateCW
The rotate menu items.


_rotateCCW

protected JMenuItem _rotateCCW
The rotate menu items.


_raise

protected JMenuItem _raise
The raise/lower menu items.


_lower

protected JMenuItem _lower
The raise/lower menu items.


_saveToPalette

protected JMenuItem _saveToPalette
The save-to-palette menu item.


_chooser

protected JFileChooser _chooser
The file chooser for opening and saving scene files.


_exportChooser

protected JFileChooser _exportChooser
The file chooser for importing and exporting scene files.


_selectionChooser

protected JFileChooser _selectionChooser
The file chooser for importing and exporting selections.


_pane

protected JSplitPane _pane
The split pane containing the canvas, toolbar, etc.


_divsize

protected int _divsize
The size of the divider.


_compassEnabled

protected boolean _compassEnabled
Whether or not the compass/grid are enabled.


_gridEnabled

protected boolean _gridEnabled
Whether or not the compass/grid are enabled.


_testing

protected boolean _testing
Set when we are in test mode.


_toolbar

protected JToolBar _toolbar
The tool bar.


_markers

protected JToggleButton _markers
Toggle buttons.


_light

protected JToggleButton _light
Toggle buttons.


_fog

protected JToggleButton _fog
Toggle buttons.


_sound

protected JToggleButton _sound
Toggle buttons.


_epanel

protected JPanel _epanel
The panel that holds the editor bits.


_opanel

protected JPanel _opanel
The panel that holds the tool options.


_tools

protected Map<String,EditorTool> _tools
Tools mapped by name.


_arrow

protected Arrow _arrow
The arrow tool.


_selector

protected Selector _selector
The selector tool.


_mover

protected Mover _mover
The mover tool.


_placer

protected Placer _placer
The placer tool.


_pathDefiner

protected PathDefiner _pathDefiner
The path definer tool.


_areaDefiner

protected AreaDefiner _areaDefiner
The area definer tool.


_globalEditor

protected GlobalEditor _globalEditor
The global editor tool.


_tileBrush

protected TileBrush _tileBrush
The tile brush tool.


_groundBrush

protected GroundBrush _groundBrush
The ground brush tool.


_wallBrush

protected WallBrush _wallBrush
The wall brush tool.


_palette

protected Palette _palette
The palette tool.


_layerSplit

protected JSplitPane _layerSplit
The pane splitting layers from the other tools.


_layerDividerPos

protected int _layerDividerPos
The last position of the layer divider.


_layers

protected Layers _layers
The layer display tool.


_activeTool

protected EditorTool _activeTool
The active tool.


_file

protected File _file
The loaded scene file.


_scene

protected TudeySceneModel _scene
The scene being edited.


_view

protected TudeySceneView _view
The scene view.


_sceneId

protected int _sceneId
The scene id used for testing.


_markersVisible

@Scoped
protected boolean _markersVisible
Whether or not markers are visible.


_lightingEnabled

@Scoped
protected boolean _lightingEnabled
Whether or not lighting is enabled.


_fogEnabled

@Scoped
protected boolean _fogEnabled
Whether or not fog is enabled.


_soundEnabled

@Scoped
protected boolean _soundEnabled
Whether or not sound is enabled.


_grid

protected EditorGrid _grid
A casted reference to the editor grid.


_origin

protected SimpleTransformable _origin
Draws the coordinate system origin.


_shiftDown

protected boolean _shiftDown
Whether or not the shift, control, and/or alt keys are being held down.


_controlDown

protected boolean _controlDown
Whether or not the shift, control, and/or alt keys are being held down.


_altDown

protected boolean _altDown
Whether or not the shift, control, and/or alt keys are being held down.


_firstButtonDown

protected boolean _firstButtonDown
Whether or not each of the mouse buttons are being held down on the canvas.


_secondButtonDown

protected boolean _secondButtonDown
Whether or not each of the mouse buttons are being held down on the canvas.


_thirdButtonDown

protected boolean _thirdButtonDown
Whether or not each of the mouse buttons are being held down on the canvas.


_selection

protected TudeySceneModel.Entry[] _selection
The selected elements.


_selectionPivot

protected Vector2f _selectionPivot
The center of rotation for the selection.


_pick

protected Ray3D _pick
Used for picking.


_pt

protected Vector3f _pt
Holds the location of the pick result.


_prefs

protected static Preferences _prefs
The application preferences.


_recentFiles

protected static List<String> _recentFiles
Recently opened files.


MAX_RECENT_FILES

protected static final int MAX_RECENT_FILES
The maximum number of recently opened files to show.

See Also:
Constant Field Values

TOOL_BUTTON_SIZE

protected static final Dimension TOOL_BUTTON_SIZE
The size of the tool buttons.

Constructor Detail

SceneEditor

public SceneEditor(String scene)
Creates the scene editor with (optionally) the path to a scene to load.

Method Detail

main

public static void main(String[] args)
                 throws Exception
The program entry point.

Throws:
Exception

setupMacSupport

protected void setupMacSupport()
Configure Mac support, if we're running on a Mac.


getView

public TudeySceneView getView()
Returns a reference to the scene view.


getGrid

public EditorGrid getGrid()
Returns a reference to the editor grid.


isShiftDown

public boolean isShiftDown()
Checks whether the shift key is being held down.


isSpecialDown

public boolean isSpecialDown()
Checks whether either of the special modifiers (control or alt) is down.


isControlDown

public boolean isControlDown()
Checks whether the control key is being held down.


isAltDown

public boolean isAltDown()
Checks whether the alt key is being held down.


isFirstButtonDown

public boolean isFirstButtonDown()
Checks whether the first mouse button is being held down on the canvas.


isSecondButtonDown

public boolean isSecondButtonDown()
Checks whether the second mouse button is being held down on the canvas.


isThirdButtonDown

public boolean isThirdButtonDown()
Checks whether the third mouse button is being held down on the canvas.


clearSelection

public void clearSelection()
Clears the selection.


getLayerPredicate

public com.google.common.base.Predicate<TudeySceneModel.Entry> getLayerPredicate()
Returns a Predicate that selects entries only on the current layer.


select

public void select(TudeySceneModel.Entry... selection)
Selects the specified entries and switches to either the selector tool or the arrow tool, depending on whether multiple entries are selected.


setSelection

public void setSelection(TudeySceneModel.Entry... selection)
Sets the selected elements.


getSelection

public TudeySceneModel.Entry[] getSelection()
Returns the selected elements.


isSelected

public boolean isSelected(TudeySceneModel.Entry entry)
Determines whether the specified entry is selected.


editMouseEntry

public void editMouseEntry()
Attempts to edit the entry under the mouse cursor on the currently selected layer.


deleteMouseEntry

public void deleteMouseEntry()
Attempts to delete the entry under the mouse cursor on the currently selected layer.


deleteMouseEntry

public void deleteMouseEntry(com.google.common.base.Predicate<? super TudeySceneModel.Entry> filter)
Attempts to delete the entry under the mouse cursor on the currently selected layer.


useMouseEntry

public void useMouseEntry()
Attempts to "use" the entry under the mouse cursor on the currently selected layer.


getMouseEntry

public TudeySceneModel.Entry getMouseEntry()
Returns a reference to the entry under the mouse cursor on the currently selected layer.


getMouseEntry

public TudeySceneModel.Entry getMouseEntry(com.google.common.base.Predicate<? super TudeySceneModel.Entry> filter)
Returns a reference to the entry under the mouse cursor on the currently selected layer.


moveSelection

public void moveSelection()
Starts moving the current selection.


removeAndMove

public void removeAndMove(TudeySceneModel.Entry... entries)
Removes the specified entries, then activates them in the mover tool.


move

public void move(TudeySceneModel.Entry... entries)
Activates the supplied entries in the mover tool.


incrementEditId

public void incrementEditId()
Increments the edit id, ensuring that any further edits will not be merged with previous ones.


overwriteEntries

public void overwriteEntries(TudeySceneModel.Entry... entries)
Adds an entry, removing any conflicting entries if necessary.


addEntries

public void addEntries(TudeySceneModel.Entry... entries)
Description copied from interface: EntryManipulator
Adds entries to the scene.

Specified by:
addEntries in interface EntryManipulator

updateEntries

public void updateEntries(TudeySceneModel.Entry... entries)
Description copied from interface: EntryManipulator
Updates entries within the scene.

Specified by:
updateEntries in interface EntryManipulator

removeEntries

public void removeEntries(Object... keys)
Description copied from interface: EntryManipulator
Removes entries from the scene.

Specified by:
removeEntries in interface EntryManipulator

removeEntries

public void removeEntries(Collection<? extends TudeySceneModel.Entry> coll)
Description copied from interface: EntryManipulator
Removes the specified entries from the scene.

Specified by:
removeEntries in interface EntryManipulator

setPaint

public void setPaint(Rectangle region,
                     TudeySceneModel.Paint paint)
Description copied from interface: EntryManipulator
Sets or clears the paint for a region in the scene.

Specified by:
setPaint in interface EntryManipulator

entryAdded

public void entryAdded(TudeySceneModel.Entry entry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been added to the scene.

Specified by:
entryAdded in interface TudeySceneModel.Observer

entryUpdated

public void entryUpdated(TudeySceneModel.Entry oentry,
                         TudeySceneModel.Entry nentry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been updated within the scene.

Specified by:
entryUpdated in interface TudeySceneModel.Observer

entryRemoved

public void entryRemoved(TudeySceneModel.Entry oentry)
Description copied from interface: TudeySceneModel.Observer
Notes that an entry has been removed from the scene.

Specified by:
entryRemoved in interface TudeySceneModel.Observer

dispatchKeyEvent

public boolean dispatchKeyEvent(KeyEvent event)
Specified by:
dispatchKeyEvent in interface KeyEventDispatcher

mouseClicked

public void mouseClicked(MouseEvent event)
Specified by:
mouseClicked in interface MouseListener

mousePressed

public void mousePressed(MouseEvent event)
Specified by:
mousePressed in interface MouseListener

mouseReleased

public void mouseReleased(MouseEvent event)
Specified by:
mouseReleased in interface MouseListener

mouseEntered

public void mouseEntered(MouseEvent event)
Specified by:
mouseEntered in interface MouseListener

mouseExited

public void mouseExited(MouseEvent event)
Specified by:
mouseExited in interface MouseListener

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Specified by:
lostOwnership in interface ClipboardOwner

getConfigManager

public ConfigManager getConfigManager()
Description copied from interface: GlContext
Returns a reference to the configuration manager.

Specified by:
getConfigManager in interface EditorContext
Specified by:
getConfigManager in interface AlContext
Specified by:
getConfigManager in interface GlContext
Overrides:
getConfigManager in class GlApp

setPlaceView

public void setPlaceView(PlaceView view)
Specified by:
setPlaceView in interface CrowdContext
Overrides:
setPlaceView in class TudeyTool

clearPlaceView

public void clearPlaceView(PlaceView view)
Specified by:
clearPlaceView in interface CrowdContext
Overrides:
clearPlaceView in class TudeyTool

actionPerformed

public void actionPerformed(ActionEvent event)
Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class GlCanvasTool

shutdown

public void shutdown()
Description copied from class: GlApp
Shuts down the application.

Overrides:
shutdown in class GlCanvasApp

createCanvasContainer

protected JComponent createCanvasContainer()
Description copied from class: GlCanvasApp
Creates and returns the component that contains the canvas (after the canvas has been created).

Overrides:
createCanvasContainer in class GlCanvasApp

createGrid

protected Grid createGrid()
Description copied from class: GlCanvasTool
Creates the grid object.

Overrides:
createGrid in class GlCanvasTool

createEditablePrefs

protected GlCanvasTool.CanvasToolPrefs createEditablePrefs()
Description copied from class: GlCanvasTool
Creates and returns the editable preferences.

Specified by:
createEditablePrefs in class GlCanvasTool

createCameraHandler

protected CameraHandler createCameraHandler()
Description copied from class: GlApp
Creates and returns the camera handler.

Overrides:
createCameraHandler in class GlCanvasTool

didInit

protected void didInit()
Description copied from class: GlApp
Override to perform custom initialization after the render context is valid.

Overrides:
didInit in class TudeyTool

updateView

protected void updateView(float elapsed)
Description copied from class: GlApp
Performs any updates that are necessary even when not rendering.

Overrides:
updateView in class TudeyTool
Parameters:
elapsed - the elapsed time since the last update, in seconds.

compositeView

protected void compositeView()
Description copied from class: GlApp
Gives the application a chance to composite anything it might want rendered.

Overrides:
compositeView in class TudeyTool

addTool

protected void addTool(JPanel tpanel,
                       ButtonGroup tgroup,
                       String name,
                       EditorTool tool)
Adds a tool to the tool panel.


createIconButton

protected JButton createIconButton(String name)
Creates an icon button with the specified name.


createToggleButton

protected JToggleButton createToggleButton(String name)
Creates a toggle button with different icons for the unselected and selected states.


createIcon

protected ImageIcon createIcon(String name)
Creates the named icon.


setActiveTool

protected void setActiveTool(EditorTool tool)
Sets the active tool.


bindAction

protected void bindAction(JComponent comp,
                          int keyCode,
                          int modifiers,
                          String action)
Binds a keystroke to an action on the specified component.


mouseCameraEnabled

protected boolean mouseCameraEnabled()
Determines whether mouse camera control is enabled.


newScene

protected void newScene()
Creates a new scene.


open

protected void open()
Brings up the open dialog.


open

protected void open(File file)
Attempts to open the specified scene file.


save

protected void save()
Brings up the save dialog.


save

protected void save(File file)
Attempts to save to the specified file.


importScene

protected void importScene()
Brings up the import dialog.


setScene

protected void setScene(TudeySceneModel scene)
Initializes the scene.


updateUndoActions

protected void updateUndoActions()
Updates the enabled states of the undo and redo actions.


exportScene

protected void exportScene()
Brings up the export dialog.


importSelection

protected void importSelection()
Brings up the selection import dialog.


exportSelection

protected void exportSelection()
Brings up the selection export dialog.


setFile

protected void setFile(File file)
Sets the file and updates the revert item and title bar.


updateTitle

protected void updateTitle()
Updates the title based on the file.


testScene

protected void testScene()
Enters the scene test mode.


deleteSelection

protected void deleteSelection()
Deletes the entries under the selected region.


rotateSelection

protected void rotateSelection(int amount)
Rotates the entries under the selection region by the specified amount.


raiseSelection

protected void raiseSelection(int amount)
Raises or lowers the entries under the selection region by the specified amount.


transformSelection

protected void transformSelection(Transform3D xform)
Transforms the selection.


copySelection

protected void copySelection()
Copies the selected entries to the clipboard.


validateReferences

protected void validateReferences()
Validates the scene's references.


deleteErrors

protected void deleteErrors()
Deletes all entries whose configurations are null or missing.


getSelectionIndex

protected int getSelectionIndex(TudeySceneModel.Entry entry)
Returns the index of the specified entry within the selection, or -1 if it is not selected.


clearPaint

protected void clearPaint(TudeySceneModel.TileEntry entry)
Clears any paint underneath the specified tile entry.


saveWarning

protected boolean saveWarning(String message)
Show a warning if the scene is unsaved. Return true if it's ok to proceed with the operation.