Class TransformationEditor

  • 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.event.TableModelListener, javax.swing.RootPaneContainer, javax.swing.WindowConstants, ImageExportable, ChangeListener, ValueListener, StatusHandler, HTMLExportable, MenuItemListener

    public class TransformationEditor
    extends GTFrame
    implements java.awt.event.ActionListener, MenuItemListener, javax.swing.event.TableModelListener, ValueListener
    A graph editor frame for ptolemy graph transformation models.
    Since:
    Ptolemy II 6.1
    Version:
    $Id$
    Author:
    Thomas Huining Feng
    See Also:
    ActorGraphFrame, Serialized Form
    Pt.AcceptedRating:
    Red (tfeng)
    Pt.ProposedRating:
    Red (tfeng)
    • Field Detail

      • OPTIONAL_ACTORS

        public static final java.lang.String[] OPTIONAL_ACTORS
      • _ruleMenu

        protected javax.swing.JMenu _ruleMenu
        The case menu.
    • Constructor Detail

      • TransformationEditor

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

        public TransformationEditor​(CompositeEntity entity,
                                    Tableau tableau,
                                    LibraryAttribute defaultLibrary)
        Construct a frame associated with the specified case actor. 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)
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
      • addRow

        public void addRow()
      • cancelFullScreen

        public void cancelFullScreen()
        Description copied from class: ExtendedGraphFrame
        Cancel full screen mode. Note that this should be called in the swing event thread.
        Overrides:
        cancelFullScreen in class GTFrame
      • changeExecuted

        public void changeExecuted​(ChangeRequest change)
        Description copied from class: BasicGraphFrame
        React to the fact that a change has been successfully executed by marking the data associated with this window modified. This will trigger a dialog when the window is closed, prompting the user to save the data.
        Specified by:
        changeExecuted in interface ChangeListener
        Overrides:
        changeExecuted in class BasicGraphFrame
        Parameters:
        change - The change that has been executed.
      • copy

        public void copy()
        Description copied from class: BasicGraphFrame
        Get the currently selected objects from this document, if any, and place them on the clipboard in MoML format.
        Overrides:
        copy in class BasicGraphFrame
      • delete

        public void delete()
        Description copied from class: BasicGraphFrame
        Delete the currently selected objects from this document.
        Overrides:
        delete in class BasicGraphFrame
      • menuItemCreated

        public void menuItemCreated​(JContextMenu menu,
                                    NamedObj object,
                                    javax.swing.JMenuItem menuItem)
        Description copied from interface: MenuItemListener
        The method to be invoked when a menu item is created, so that this listener can modify the menu item if it needs to.
        Specified by:
        menuItemCreated in interface MenuItemListener
        Parameters:
        menu - The menu context.
        object - The object for which the menu item is created.
        menuItem - The created menu item.
      • paste

        public void paste()
        Description copied from class: BasicGraphFrame
        Assuming the contents of the clipboard is MoML code, paste it into the current model by issuing a change request.
        Overrides:
        paste in class BasicGraphFrame
      • removeRows

        public void removeRows​(int[] rows)
      • tableChanged

        public void tableChanged​(javax.swing.event.TableModelEvent event)
        Specified by:
        tableChanged in interface javax.swing.event.TableModelListener
      • valueChanged

        public void valueChanged​(Settable settable)
        Description copied from interface: ValueListener
        React to the fact that the specified Settable has changed.
        Specified by:
        valueChanged in interface ValueListener
        Parameters:
        settable - The object that has changed value.
      • zoom

        public void zoom​(double factor)
        Description copied from class: BasicGraphFrame
        Zoom in or out to magnify by the specified factor, from the current magnification.
        Overrides:
        zoom in class BasicGraphFrame
        Parameters:
        factor - The magnification factor (relative to 1.0).
      • _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
      • _createRightComponent

        protected javax.swing.JComponent _createRightComponent​(NamedObj entity)
        Description copied from class: BasicGraphFrame
        Create the component that goes to the right of the library.
        Overrides:
        _createRightComponent in class GTFrame
        Parameters:
        entity - The entity to display in the component.
        Returns:
        The component that goes to the right of the library.
      • _getSelectionSet

        protected java.util.HashSet _getSelectionSet​(boolean includeLinks)