com.threerings.opengl.effect.tools
Class ParticleEditor

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.opengl.model.tools.ModelTool
                      extended by com.threerings.opengl.effect.tools.ParticleEditor
All Implemented Interfaces:
EditorContext, Scope, ScopeUpdateListener, AlContext, Enqueueable, GlContext, ActionListener, EventListener, ChangeListener, ListSelectionListener

public class ParticleEditor
extends ModelTool
implements ListSelectionListener, ChangeListener

The particle editor application.


Nested Class Summary
protected  class ParticleEditor.LayerTableModel
          A table model for the particle system layers.
 
Nested classes/interfaces inherited from class com.threerings.opengl.model.tools.ModelTool
ModelTool.EnvironmentModel, ModelTool.ModelToolPrefs
 
Nested classes/interfaces inherited from class com.threerings.opengl.GlCanvasTool
GlCanvasTool.CanvasToolPrefs
 
Field Summary
protected  JCheckBoxMenuItem _autoReset
          The toggle for automatic reset.
protected  JFileChooser _chooser
          The file chooser for opening and saving particle files.
protected  JButton _cloneLayer
          The clone and delete layer buttons.
protected  JButton _deleteLayer
          The clone and delete layer buttons.
protected  EditorPanel _editor
          The layer editor panel.
protected  JPanel _epanel
          The panel that holds the editor bits.
protected  JFileChooser _exportChooser
          The file chooser for importing and exporting particle files.
protected  File _file
          The loaded particle file.
protected  SimpleTransformable _ground
          The ground plane.
protected  File _initParticles
          The file to attempt to load on initialization, if any.
protected  JTable _ltable
          The layer table.
protected static Preferences _prefs
          The application preferences.
protected  JMenuItem _revert
          The revert menu item.
protected  JCheckBoxMenuItem _showGround
          The toggle for the ground view.
 
Fields inherited from class com.threerings.opengl.model.tools.ModelTool
_environment, _model, _scene, _showEnvironment
 
Fields inherited from class com.threerings.opengl.GlCanvasTool
_bounds, _compass, _eprefs, _grid, _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
ParticleEditor(String particles)
          Creates the particle editor with (optionally) the path to a particle system to load.
 
Method Summary
 void actionPerformed(ActionEvent event)
           
protected  void compositeView()
          Gives the application a chance to composite anything it might want rendered.
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  void didInit()
          Override to perform custom initialization after the render context is valid.
protected  void exportParticles()
          Brings up the export dialog.
protected  ParticleSystemConfig.Layer[] getLayers()
          Returns a reference to the array of layers.
 ParticleSystemConfig getParticleSystemConfig()
          Returns a reference to the particle system configuration.
protected  void importLayers()
          Brings up the import layers dialog.
protected  void importParticles()
          Brings up the import dialog.
static void main(String[] args)
          The program entry point.
protected  void newParticles()
          Creates a new particle system.
protected  void open()
          Brings up the open dialog.
protected  void open(File file)
          Attempts to open the specified particle file.
protected  void save()
          Brings up the save dialog.
protected  void save(File file)
          Attempts to save to the specified file.
protected  void setConfig(ModelConfig config, File file)
          Sets the configuration of the particle system.
protected  void setFile(File file)
          Sets the file and updates the revert item and title bar.
protected  void setLayers(ParticleSystemConfig.Layer[] layers)
          Sets the array of layers and notes that the config was updated.
protected  boolean showCantUndo()
          Shows a confirm dialog.
 void stateChanged(ChangeEvent event)
           
protected  void updateTitle()
          Updates the title based on the file.
protected  void updateView(float elapsed)
          Performs any updates that are necessary even when not rendering.
 void valueChanged(ListSelectionEvent event)
           
 
Methods inherited from class com.threerings.opengl.model.tools.ModelTool
createBounds
 
Methods inherited from class com.threerings.opengl.GlCanvasTool
createAction, createAction, createButton, createButton, createCameraHandler, createCheckBoxMenuItem, createCheckBoxMenuItem, createGrid, createMenu, createMenuItem, createMenuItem, shouldCheckTimestamps
 
Methods inherited from class com.threerings.opengl.GlCanvasApp
createCanvas, createRoot, getCanvas, getFrame, getMouseRay, getPickRay, getRunQueue, initRenderer, makeCurrent, shutdown, startup, willShutdown
 
Methods inherited from class com.threerings.opengl.GlApp
createSnapshot, enqueue, getApp, getCameraHandler, getClipProvider, getColorPository, getCompatibilityMode, getCompositor, getConfigManager, getImageCache, getMessageManager, getRenderEffects, getRenderer, getRenderScheme, getResourceManager, getScope, getShaderCache, getSoundManager, getStreamGain, init, initSharedManagers, 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.editor.util.EditorContext
getColorPository, getConfigManager, getMessageManager, getResourceManager
 

Field Detail

_initParticles

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


_revert

protected JMenuItem _revert
The revert menu item.


_autoReset

protected JCheckBoxMenuItem _autoReset
The toggle for automatic reset.


_showGround

protected JCheckBoxMenuItem _showGround
The toggle for the ground view.


_chooser

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


_exportChooser

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


_epanel

protected JPanel _epanel
The panel that holds the editor bits.


_ltable

protected JTable _ltable
The layer table.


_cloneLayer

protected JButton _cloneLayer
The clone and delete layer buttons.


_deleteLayer

protected JButton _deleteLayer
The clone and delete layer buttons.


_editor

protected EditorPanel _editor
The layer editor panel.


_ground

protected SimpleTransformable _ground
The ground plane.


_file

protected File _file
The loaded particle file.


_prefs

protected static Preferences _prefs
The application preferences.

Constructor Detail

ParticleEditor

public ParticleEditor(String particles)
Creates the particle editor with (optionally) the path to a particle system to load.

Method Detail

main

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


valueChanged

public void valueChanged(ListSelectionEvent event)
Specified by:
valueChanged in interface ListSelectionListener

stateChanged

public void stateChanged(ChangeEvent event)
Specified by:
stateChanged in interface ChangeListener

actionPerformed

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

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

createEditablePrefs

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

Specified by:
createEditablePrefs 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 ModelTool

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 ModelTool
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 ModelTool

newParticles

protected void newParticles()
Creates a new particle system.


open

protected void open()
Brings up the open dialog.


open

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


save

protected void save()
Brings up the save dialog.


save

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


importParticles

protected void importParticles()
Brings up the import dialog.


exportParticles

protected void exportParticles()
Brings up the export dialog.


importLayers

protected void importLayers()
Brings up the import layers dialog.


setConfig

protected void setConfig(ModelConfig config,
                         File file)
Sets the configuration of the particle system.


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.


setLayers

protected void setLayers(ParticleSystemConfig.Layer[] layers)
Sets the array of layers and notes that the config was updated.


getLayers

protected ParticleSystemConfig.Layer[] getLayers()
Returns a reference to the array of layers.


getParticleSystemConfig

public ParticleSystemConfig getParticleSystemConfig()
Returns a reference to the particle system configuration.


showCantUndo

protected boolean showCantUndo()
Shows a confirm dialog.