Package ptolemy.actor.gui
Class EditorPaneFactory
- java.lang.Object
-
- ptolemy.kernel.util.NamedObj
-
- ptolemy.kernel.util.Attribute
-
- ptolemy.actor.gui.EditorPaneFactory
-
- All Implemented Interfaces:
java.lang.Cloneable
,Changeable
,Debuggable
,DebugListener
,Derivable
,ModelErrorHandler
,MoMLExportable
,Moveable
,Nameable
- Direct Known Subclasses:
InsideEntityEditorPaneFactory
,TransitionEditorPaneFactory
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$
- Author:
- Steve Neuendorffer and Edward A. Lee
- See Also:
Configurer
- Pt.AcceptedRating:
- Red (johnr)
- Pt.ProposedRating:
- Red (eal)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class ptolemy.kernel.util.NamedObj
NamedObj.ContainedObjectsIterator
-
-
Field Summary
Fields Modifier and Type Field Description static int
DEFAULT_QUERY_WIDTH
Default width for a query.-
Fields inherited from class ptolemy.kernel.util.NamedObj
_changeListeners, _changeLock, _changeRequests, _debugging, _debugListeners, _deferChangeRequests, _elementName, _isPersistent, _verbose, _workspace, ATTRIBUTES, CLASSNAME, COMPLETE, CONTENTS, DEEP, FULLNAME, LINKS
-
-
Constructor Summary
Constructors Constructor Description EditorPaneFactory(NamedObj container, java.lang.String name)
Construct a factory with the specified container and name.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description 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, _containedDecorators, _copyChangeRequestList, _debug, _debug, _debug, _debug, _debug, _description, _executeChangeRequests, _exportMoMLContents, _getIndentPrefix, _isMoMLSuppressed, _markContentsDerived, _notifyHierarchyListenersAfterChange, _notifyHierarchyListenersBeforeChange, _propagateValue, _removeAttribute, _splitName, _stripNumericSuffix, _validateSettables, addChangeListener, addDebugListener, addHierarchyListener, attributeChanged, attributeDeleted, attributeList, attributeList, attributeTypeChanged, clone, containedObjectsIterator, decorators, 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, notifyOfNameChange, propagateExistence, propagateValue, propagateValues, removeAttribute, removeChangeListener, removeDebugListener, removeHierarchyListener, requestChange, setClassName, setDeferringChangeRequests, setDerivedLevel, setDisplayName, setModelErrorHandler, setPersistent, setSource, sortContainedObjects, toplevel, toString, uniqueName, validateSettables, workspace
-
-
-
-
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 can be used to edit the parameters of the object.- 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.
-
-