Class EditIconGraphController

  • All Implemented Interfaces:
    GraphController, DebugListener, ValueListener

    public class EditIconGraphController
    extends BasicGraphController
    A graph controller for the Ptolemy II icon editor. This controller contains a set of default node controllers for attributes, which are the only objects that an icon editor can contain. The default controller can be overridden by attributes of type NodeControllerFactory. The getNodeController() method always returns an attribute controller.
    Since:
    Ptolemy II 4.0
    Version:
    $Id$
    Author:
    Edward A. Lee
    Pt.AcceptedRating:
    Red (johnr)
    Pt.ProposedRating:
    Yellow (eal)
    • Field Detail

      • _attributeController

        protected NamedObjController _attributeController
        The attribute controller.
    • Constructor Detail

      • EditIconGraphController

        public EditIconGraphController()
        Create a new basic controller with default terminal and edge interactors and default context menus.
    • Method Detail

      • addToMenuAndToolbar

        public void addToMenuAndToolbar​(javax.swing.JMenu menu,
                                        javax.swing.JToolBar toolbar)
        Add hot key for look inside.
        Overrides:
        addToMenuAndToolbar in class BasicGraphController
        Parameters:
        menu - The menu to add to, which is ignored.
        toolbar - The toolbar to add to, which is also ignored.
      • getNodeController

        public NodeController getNodeController​(java.lang.Object object)
        Return the node controller appropriate for the specified object. If the specified object is an instance of Locatable and its container contains a NodeControllerFactory (which is an attribute), then invoke that factory to create a node controller. Otherwise, if the object implements Locatable and is contained by an instance of Attribute, then return the attribute controller. Otherwise, throw a runtime exception.
        Specified by:
        getNodeController in interface GraphController
        Overrides:
        getNodeController in class BasicGraphController
        Parameters:
        object - A Vertex, Locatable, or Port.
        Returns:
        object The node controller.
        Throws:
        java.lang.RuntimeException - If the specified object is not a Locatable contained by an Attribute.
      • _createControllers

        protected void _createControllers()
        Create the controllers for nodes in this graph. This is called by the constructor, so derived classes that override this must be careful not to reference local variables defined in the derived classes, because the derived classes will not have been fully constructed by the time this is called.
        Overrides:
        _createControllers in class BasicGraphController
      • initializeInteraction

        protected void initializeInteraction()
        Initialize all interaction on the graph pane. This method is called by the setGraphPane() method of the superclass. This initialization cannot be done in the constructor because the controller does not yet have a reference to its pane at that time.
        Overrides:
        initializeInteraction in class BasicGraphController