Class ActorGraphFrame

  • All Implemented Interfaces:
    java.awt.datatransfer.ClipboardOwner, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.WindowFocusListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.awt.print.Printable, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants, ImageExportable, ChangeListener, StatusHandler, HTMLExportable
    Direct Known Subclasses:
    CaseGraphFrame

    public class ActorGraphFrame
    extends ExtendedGraphFrame
    This is a graph editor frame for ptolemy models. Given a composite entity and an instance of ActorGraphTableau, it creates an editor and populates the menus and toolbar. This overrides the base class to associate with the editor an instance of ActorEditorGraphController.
    Since:
    Ptolemy II 2.0
    Version:
    $Id$
    Author:
    Steve Neuendorffer, Contributor: Edward A. Lee, KIELER Layout: Christian Motika <cmot@informatik.uni-kiel.de>
    See Also:
    ActorEditorGraphController, Serialized Form
    Pt.AcceptedRating:
    Red (johnr)
    Pt.ProposedRating:
    Red (neuendor)
    • Field Detail

      • _debugMenu

        protected javax.swing.JMenu _debugMenu
        Debug menu for this frame.
      • _createHierarchyAction

        protected javax.swing.Action _createHierarchyAction
        The action for creating a level of hierarchy.
      • _exportDesignPatternAction

        protected javax.swing.Action _exportDesignPatternAction
        The action for exporting a design pattern.
      • _saveInLibraryAction

        protected javax.swing.Action _saveInLibraryAction
        The action for saving the current model in a library.
      • _importDesignPatternAction

        protected javax.swing.Action _importDesignPatternAction
        The action for importing a design pattern.
      • _importLibraryAction

        protected javax.swing.Action _importLibraryAction
        The action for importing a library of components.
      • _instantiateAttributeAction

        protected javax.swing.Action _instantiateAttributeAction
        The action for instantiating an attribute.
      • _instantiateEntityAction

        protected javax.swing.Action _instantiateEntityAction
        The action for instantiating an entity.
      • _instantiatePortAction

        protected javax.swing.Action _instantiatePortAction
        The action for instantiating a port.
    • Constructor Detail

      • ActorGraphFrame

        public ActorGraphFrame​(CompositeEntity entity,
                               Tableau tableau)
        Construct a frame associated with the specified Ptolemy II model. After constructing this, it is necessary to call setVisible(true) to make the frame appear. This is typically done by calling show() on the controlling tableau. This constructor results in a graph frame that obtains its library either from the model (if it has one) or the default library defined in the configuration.
        Parameters:
        entity - The model to put in this frame.
        tableau - The tableau responsible for this frame.
        See Also:
        Tableau.show()
      • ActorGraphFrame

        public ActorGraphFrame​(CompositeEntity entity,
                               Tableau tableau,
                               LibraryAttribute defaultLibrary)
        Construct a frame associated with the specified Ptolemy II model. After constructing this, it is necessary to call setVisible(true) to make the frame appear. This is typically done by calling show() on the controlling tableau. This constructor results in a graph frame that obtains its library either from the model (if it has one), or the defaultLibrary argument (if it is non-null), or the default library defined in the configuration.
        Parameters:
        entity - The model to put in this frame.
        tableau - The tableau responsible for this frame.
        defaultLibrary - An attribute specifying the default library to use if the model does not have a library.
        See Also:
        Tableau.show()
    • Method Detail

      • dispose

        public void dispose()
        Dispose of this frame. Override this dispose() method to unattach any listeners that may keep this model from getting garbage collected. This method invokes the dispose() method of the superclass, ExtendedGraphFrame.
        Overrides:
        dispose in class ExtendedGraphFrame
      • importLibrary

        public static java.io.File importLibrary​(java.io.File lastDirectory,
                                                 java.awt.Frame frame,
                                                 Configuration configuration)
        Import a library by first opening a file chooser dialog and then importing the specified library. See UserActorLibrary.openLibrary(Configuration, File) for information on the file format. This method opens up a new blank graph viewer so that the new library is visible.
        Parameters:
        lastDirectory - The last directory opened, usually the value of getDirectory().
        frame - The frame of the owner of the file chooser.
        configuration - The Ptolemy configuration.
        Returns:
        the last directory opened.
      • _initActorGraphFrame

        protected void _initActorGraphFrame()
        Initialize this class. In this base class, the help file is set, and various actions are instantiated.
      • _addMenus

        protected void _addMenus()
        Create the menus that are used by this frame. It is essential that _createGraphPane() be called before this.
        Overrides:
        _addMenus in class ExtendedGraphFrame
      • _close

        protected boolean _close()
        If the ptolemy model associated with this frame is a top-level composite actor, use its manager to stop it. Remove the listeners that this frame registered with the ptolemy model. Also remove the listeners our graph model has created.
        Overrides:
        _close in class ExtendedGraphFrame
        Returns:
        True if the close completes, and false otherwise.
      • _createFileMenuItems

        protected javax.swing.JMenuItem[] _createFileMenuItems()
        Create the items in the File menu. A null element in the array represents a separator in the menu.
        Overrides:
        _createFileMenuItems in class BasicGraphFrame
        Returns:
        The items in the File menu.
      • _createGraphPane

        protected GraphPane _createGraphPane​(NamedObj entity)
        Create a new graph pane. Note that this method is called in constructor of the base class, so it must be careful to not reference local variables that may not have yet been created.
        Specified by:
        _createGraphPane in class BasicGraphFrame
        Parameters:
        entity - The object to be displayed in the pane.
        Returns:
        The pane that is created.