Class 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)
    • Field Detail

      • DEFAULT_QUERY_WIDTH

        public static int DEFAULT_QUERY_WIDTH
        Default width for a query.
    • 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.