Class FSMGraphFrame

  • All Implemented Interfaces:
    java.awt.datatransfer.ClipboardOwner, java.awt.event.ActionListener, 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:
    FmvAutomatonGraphFrame, InterfaceAutomatonGraphFrame, PteraGraphFrame

    public class FSMGraphFrame
    extends ExtendedGraphFrame
    implements java.awt.event.ActionListener
    This is a graph editor frame for ptolemy FSM models. Given a composite entity and a tableau, it creates an editor and populates the menus and toolbar. This overrides the base class to associate with the editor an instance of FSMGraphController.
    Since:
    Ptolemy II 8.0
    Version:
    $Id$
    Author:
    Steve Neuendorffer, Contributor: Edward A. Lee
    See Also:
    Serialized Form
    Pt.AcceptedRating:
    Red (johnr)
    Pt.ProposedRating:
    Red (neuendor)
    • Field Detail

      • _controller

        protected FSMGraphController _controller
        The controller. The controller is protected so that the subclass (InterfaceAutomatonGraphFrame) can set it to a more specific controller.
      • _debugMenu

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

      • FSMGraphFrame

        public FSMGraphFrame​(CompositeEntity entity,
                             Tableau tableau)
        Construct a frame associated with the specified FSM 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()
      • FSMGraphFrame

        public FSMGraphFrame​(CompositeEntity entity,
                             Tableau tableau,
                             LibraryAttribute defaultLibrary)
        Construct a frame associated with the specified FSM 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

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent e)
        React to the actions specific to this FSM graph frame.
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        e - The action event.
      • copy

        public void copy()
        Get the currently selected objects from this document, if any, and place them on the clipboard in MoML format.
        Overrides:
        copy in class BasicGraphFrame
      • _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
      • _getDebugMenuListener

        protected java.awt.event.ActionListener _getDebugMenuListener()
        Return a new DebugMenuListener.
        Returns:
        the new DebugMenuListener.
      • _debugMenuItems

        protected javax.swing.JMenuItem[] _debugMenuItems()
        Return an array of debug menu items.
        Returns:
        an array of debug menu items.
      • _close

        protected boolean _close()
        Close the window. Override the base class to remove the debug listener, if there is one.
        Overrides:
        _close in class ExtendedGraphFrame
        Returns:
        False if the user cancels on a save query.
      • _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 (which must be an instance of CompositeEntity).
        Returns:
        The pane that is created.
      • _exportDesignPattern

        protected void _exportDesignPattern​(java.io.Writer writer,
                                            NamedObj model,
                                            java.lang.String name)
                                     throws java.io.IOException
        Export the model into the writer with the given name.
        Overrides:
        _exportDesignPattern in class BasicGraphFrame
        Parameters:
        writer - The writer.
        model - The model to export.
        name - The name of the exported model.
        Throws:
        java.io.IOException - If an I/O error occurs.
      • _getAnimationMenuText

        protected java.lang.String _getAnimationMenuText()
        Return the text to be used in the animation menu item. In this base class, always return "Animate States".
        Returns:
        The text for the menu item.