ptolemy.actor.gui
Class EditorPaneFactory

java.lang.Object
  extended by ptolemy.kernel.util.NamedObj
      extended by ptolemy.kernel.util.Attribute
          extended by ptolemy.actor.gui.EditorPaneFactory
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, Changeable, Debuggable, DebugListener, Derivable, ModelErrorHandler, MoMLExportable, Moveable, Nameable
Direct Known Subclasses:
InsideEntityEditorPaneFactory

public class EditorPaneFactory
extends Attribute

This is an attribute that can create a pane (called a "configuration widget") for interactively configuring its container. To use this, place an instance of this class (or a derived class) inside a Ptolemy II object. When the user double clicks on the icon for that object, or selects Configure from the context menu, then a dialog is opened containing the pane returned by createEditorPane().

In this base class, the createEditorPane() method creates an instance of PtolemyQuery with one entry for each parameter in the container. This is the default mechanism for editing parameters. Derived classes may override this method to present radically different interfaces to the user. For example, a digital filter actor could present a filter design interface. A plotter actor could present a panel for configuring a plot. A file reader actor could present a file browser.

Since:
Ptolemy II 0.4
Version:
$Id: EditorPaneFactory.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Steve Neuendorffer and Edward A. Lee
See Also:
Configurer, Serialized Form
Accepted Rating:
Red (johnr)
Proposed Rating:
Red (eal)

Nested Class Summary
 
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
 
Field Summary
 
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
 
Constructor Summary
EditorPaneFactory(NamedObj container, java.lang.String name)
          Construct a factory with the specified container and name.
 
Method Summary
 java.awt.Component createEditorPane()
          Return a new widget for configuring the container.
static java.awt.Component createEditorPane(NamedObj object)
          Return a new default widget for configuring the specified object.
static java.awt.Component createEditorPane(NamedObj object, PtolemyQuery query)
          Return a new default widget for configuring the specified object.
 
Methods inherited from class ptolemy.kernel.util.Attribute
_checkContainer, _getContainedObject, _propagateExistence, clone, getContainer, moveDown, moveToFirst, moveToIndex, moveToLast, moveUp, setContainer, setName, updateContent
 
Methods inherited from class ptolemy.kernel.util.NamedObj
_addAttribute, _adjustOverride, _attachText, _cloneFixAttributeFields, _debug, _debug, _debug, _debug, _debug, _description, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _propagateValue, _recordDecoratedAttributes, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, attributeChanged, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, deepContains, depthInHierarchy, description, description, event, executeChangeRequests, exportMoML, exportMoML, exportMoML, exportMoML, exportMoML, exportMoMLPlain, getAttribute, getAttribute, getAttributes, getChangeListeners, getClassName, getDecoratorAttribute, getDecoratorAttributes, getDerivedLevel, getDerivedList, getDisplayName, getElementName, getFullName, getModelErrorHandler, getName, getName, getPrototypeList, getSource, handleModelError, isDeferringChangeRequests, isOverridden, isPersistent, lazyContainedObjectsIterator, message, propagateExistence, propagateValue, propagateValues, removeChangeListener, removeDebugListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EditorPaneFactory

public EditorPaneFactory(NamedObj container,
                         java.lang.String name)
                  throws IllegalActionException,
                         NameDuplicationException
Construct a factory with the specified container and name.

Parameters:
container - The container.
name - The name of the factory.
Throws:
IllegalActionException - If the factory is not of an acceptable attribute for the container.
NameDuplicationException - If the name coincides with an attribute already in the container.
Method Detail

createEditorPane

public java.awt.Component createEditorPane()
Return a new widget for configuring the container. In this base class, this method defers to the static createEditorPane method. Subclasses that implement specialized interaction should override this method to create an appropriate type of component.

Returns:
A new widget for configuring the container.

createEditorPane

public static java.awt.Component createEditorPane(NamedObj object)
Return a new default widget for configuring the specified object. This is used by the Configurer for objects that do not contain an instance of EditorPaneFactory as an attribute. The resulting component is an instance of the PtolemyQuery class that

Parameters:
object - The object to be configured.
Returns:
An instance of the PtolemyQuery class that is created with styles according to the type given in each visible attribute.

createEditorPane

public static java.awt.Component createEditorPane(NamedObj object,
                                                  PtolemyQuery query)
Return a new default widget for configuring the specified object. This is used by the Configurer for objects that do not contain an instance of EditorPaneFactory as an attribute. The resulting component is an instance of the PtolemyQuery class that

Parameters:
object - The object to be configured.
query - The query to which new entries for the object are to be added.
Returns:
An instance of the PtolemyQuery class that is created with styles according to the type given in each visible attribute.