Class ActorGraphModel.IconModel

    • Constructor Summary

      Constructors 
      Constructor Description
      IconModel()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getDeleteNodeMoML​(java.lang.Object node)
      Return a MoML String that will delete the given node from the Ptolemy model.
      int getNodeCount​(java.lang.Object composite)
      Return the number of nodes contained in this graph or composite node.
      java.lang.Object getParent​(java.lang.Object node)
      Return the graph parent of the given node.
      java.util.Iterator inEdges​(java.lang.Object node)
      Return an iterator over the edges coming into the given node.
      java.util.Iterator nodes​(java.lang.Object composite)
      Provide an iterator over the nodes in the given graph or composite node.
      java.util.Iterator nodesAfterEdges​(java.lang.Object composite)
      Provide an iterator over the nodes that should be rendered after to the edges.
      java.util.Iterator nodesBeforeEdges​(java.lang.Object composite)
      Provide an iterator over the nodes that should be rendered prior to the edges.
      java.util.Iterator outEdges​(java.lang.Object node)
      Return an iterator over the edges coming out of the given node.
      void removeNode​(java.lang.Object eventSource, java.lang.Object node)
      Remove the given node from the model.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • IconModel

        public IconModel()
    • Method Detail

      • getDeleteNodeMoML

        public java.lang.String getDeleteNodeMoML​(java.lang.Object node)
        Return a MoML String that will delete the given node from the Ptolemy model. The returned string assumes that the context is the container of the object with an icon.
        Specified by:
        getDeleteNodeMoML in class NamedObjNodeModel
        Parameters:
        node - The node.
        Returns:
        A valid MoML string.
      • getNodeCount

        public int getNodeCount​(java.lang.Object composite)
        Return the number of nodes contained in this graph or composite node.
        Specified by:
        getNodeCount in interface CompositeModel
        Parameters:
        composite - The composite, which is assumed to be an icon.
        Returns:
        The number of ports contained in the container of the icon.
      • getParent

        public java.lang.Object getParent​(java.lang.Object node)
        Return the graph parent of the given node.
        Specified by:
        getParent in interface NodeModel
        Parameters:
        node - The node, which is assumed to be an icon.
        Returns:
        The container of the Icon's container, which should be the root of the graph.
      • inEdges

        public java.util.Iterator inEdges​(java.lang.Object node)
        Return an iterator over the edges coming into the given node.
        Specified by:
        inEdges in interface NodeModel
        Parameters:
        node - The node, which is assumed to be an icon.
        Returns:
        A NullIterator, since no edges are attached to icons.
      • nodes

        public java.util.Iterator nodes​(java.lang.Object composite)
        Provide an iterator over the nodes in the given graph or composite node. The nodes are ports, so if the container of the node is not an entity, then an empty iterator is returned. This iterator does not necessarily support removal operations.
        Specified by:
        nodes in interface CompositeModel
        Parameters:
        composite - The composite, which is assumed to be an icon.
        Returns:
        An iterator over the ports contained in the container of the icon.
      • nodesBeforeEdges

        public java.util.Iterator nodesBeforeEdges​(java.lang.Object composite)
        Provide an iterator over the nodes that should be rendered prior to the edges. This iterator does not necessarily support removal operations. In this base class, this returns the same iterator as the nodes(Object) method.
        Specified by:
        nodesBeforeEdges in interface CompositeModel
        Parameters:
        composite - The composite, which is assumed to be an icon.
        Returns:
        An iterator of nodes that should be rendered before the edges.
      • nodesAfterEdges

        public java.util.Iterator nodesAfterEdges​(java.lang.Object composite)
        Provide an iterator over the nodes that should be rendered after to the edges. This iterator does not necessarily support removal operations. In this base class, this returns an iterator over nothing.
        Specified by:
        nodesAfterEdges in interface CompositeModel
        Parameters:
        composite - The composite, which is assumed to be an icon.
        Returns:
        An iterator of nodes that should be rendered after the edges.
      • outEdges

        public java.util.Iterator outEdges​(java.lang.Object node)
        Return an iterator over the edges coming out of the given node.
        Specified by:
        outEdges in interface NodeModel
        Parameters:
        node - The node, which is assumed to be an icon.
        Returns:
        A NullIterator, since no edges are attached to icons.
      • removeNode

        public void removeNode​(java.lang.Object eventSource,
                               java.lang.Object node)
        Remove the given node from the model. The node is assumed to be an icon.
        Specified by:
        removeNode in class NamedObjNodeModel
        Parameters:
        eventSource - The source of the event that will be dispatched, e.g. the view that made this call.
        node - The node.