Diagram Objects
This is the container used to assemble Node objects into a connected flow or well-formed sequence of nodes.
d.clear()
Deletes all nodes from this diagram.
Exceptions:
ObjectLockedException : if the diagram is currently locked
d.create(nodeType, name) : Node
nodeType (string) : the node type name
name (string) : the object's name
Creates a Node of the specified type and adds it to this diagram.
Exceptions:
ObjectCreationException : if the node cannot be created for some reason
ObjectLockedException : if the node cannot be added to the stream
d.createAt(nodeType, name, x, y) : Node
nodeType (string) : the node type name
name (string) : the object's name
x (int) : the x location
y (int) : the y location
Creates a Node of the specified type and adds it to this diagram at the specified location. If either x < 0 or y < 0, the location is not set.
Exceptions:
ObjectCreationException : if the node cannot be created for some reason
ObjectLockedException : if the node cannot be added to the stream
d.createModelApplier(modelOutput, name) : Node
modelOutput (ModelOutput) : the model output object
name (string) : the new object's name
Creates a ModelApplier derived from the supplied model output object.
Exceptions:
ObjectCreationException : if the node cannot be created for some reason
ObjectLockedException : if the node cannot be added to the stream
d.delete(node)
node (Node) : the node to be removed
Deletes the specified node from this diagram. The node must be owned to this diagram.
Exceptions:
OwnerException : if the node is not owned by this diagram
ObjectLockedException : if the diagram is currently locked
d.deleteAll(nodes)
nodes (Collection) : the collection of nodes to be removed
Deletes all the specified nodes from this diagram. All nodes in the collection must belong to this diagram.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
ClassCastException : if any item in the collection is not of type Node
d.disconnect(node)
node (Node) : the node to be disconnected
Removes any links between the supplied node and any other nodes in this diagram.
Exceptions:
OwnerException : if any objects in the path are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
d.findAll(type, label) : Collection
type (string) : the node type
label (string) : the node label
Returns a list of all nodes with the specified type and name. Either the type or name may be None in which case the other parameter is used.
d.findAll(filter, recursive) : Collection
filter (NodeFilter) : the node filter
recursive (boolean) : if True then composite nodes should be recursively searched
Returns a collection of all nodes accepted by the specified filter. If the recursive flag is True then any SuperNodes within this diagram are also searched.
d.findByID(id) : Node
id (string) : the node ID
Returns the node with the supplied ID or None if no such node exists. The search is limited to the current diagram.
d.findByType(type, label) : Node
type (string) : the node type
label (string) : the node label
Returns the node with the supplied type and/or label. Either the type or name may be None in which case the other parameter is used. If multiple nodes match then an arbitrary one is chosen and returned. If no nodes match then the return value is None.
d.findDownstream(fromNodes) : List
fromNodes (List) : the start point of the search
Searches from the supplied list of nodes and returns the set of nodes downstream of the supplied nodes. The returned list includes the originally supplied nodes.
d.findUpstream(fromNodes) : List
fromNodes (List) : the start point of the search
Searches from the supplied list of nodes and returns the set of nodes upstream of the supplied nodes. The returned list includes the originally supplied nodes.
d.flushCaches()
Flushes the caches of any cache-enabled Node objects in the diagram. Has no effect if caches are not enabled or are not full.
d.insert(source, nodes, newIDs) : List
source (Diagram) : the diagram that owns the nodes to be inserted
nodes (List) : the nodes to be copied
newIDs (boolean) : True if new IDs should be generated for each node or False if the existing IDs should be re-used
Inserts copies of the nodes in the supplied list. It is assumed that all nodes in the supplied list are contained within the specified diagram. The new IDs flag indicates whether new IDs should be generated for each node, or whether the existing ID should be copied across. It is assumed that all nodes in a diagram have a unique ID so this flag must be set True if the source diagram is the same as this diagram. The method returns the list of newly inserted nodes where the order of the nodes is undefined (i.e. the ordering is not necessarily the same as the order of nodes in the input list).
Exceptions:
ObjectLockedException : if the diagram has been locked because of another operation
InvalidEditException : if the edit would be invalid
d.isEnabled(node) : boolean
node (Node) : the node
Returns True if the supplied node is enabled.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.isOwner(node) : boolean
node (Node) : the node
Returns True if the node is owned by this diagram.
d.isValidLink(source, target) : boolean
source (Node) : the source node
target (Node) : the target node
Returns True if it would be valid to create a link between the specified source and target nodes. This checks that both objects belong to this diagram, that the source can supply a link and the target can receive a link, and that creating such a link will not cause a circularity in the diagram.
Exceptions:
OwnerException : if the source or target node are not owned by this diagram
d.iterator() : Iterator
Returns an iterator over the Node objects contained in this diagram. The behaviour of the iterator if the diagram is modified between calls of next() is undefined.
d.link(source, target)
source (Node) : the source node
target (Node) : the target node
Creates a new link between the source and the target.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
InvalidEditException : if the connection would be invalid
d.link(source, targets)
source (Node) : the source node
targets (List) : the list of target nodes
Creates new links between the source and each target node in the supplied list.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
InvalidEditException : if a connection would be invalid
ClassCastException : if targets does not contain instances of Node
d.linkBetween(inserted, source, target)
inserted (Node) : the node to be inserted
source (Node) : the source node
target (Node) : the target node
Connects a Node between two other instances and sets the position of the inserted node to be between those. Any direct link between the source and target is removed first. If any link would be invalid (the source is a terminal node, the target is a source node or the target cannot accept any more links), a ModelerException is thrown and no changes are made to the diagram.
Exceptions:
OwnerException : if any of the nodes are not owned by the diagram
ObjectLockedException : if the diagram has been locked because of another operation
InvalidEditException : if the edit is invalid e.g., the target already has the maximum number of input connections
d.linkPath(path)
path (List) : the set of Node instances
Creates a new path between Node instances. The first node is linked to the second, the second is linked to the third etc. If any link would be invalid (for example, the nodes are already linked, the source is a terminal node, the target is a source node or the target cannot accept any more links), a ModelerException is thrown and no changes are made to the diagram.
Exceptions:
OwnerException : if any objects in the path are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
InvalidEditException : if a link between two adjacent nodes in the path cannot be created.
d.linkUpdater(updater, updatable)
updater (Node) : the updater node
updatable (Node) : the updatable node
Creates a new update link between the updater and the updatable. It is expected that updater implements the Updater interface while the updatable implements the Updatable interface.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
InvalidEditException : if the connection would be invalid
d.predecessorAt(node, index) : Node
node (Node) : the node
index (int) : which predecessor to return
Returns the specified immediate predecessor of the supplied node or None if the index is out of bounds.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.predecessorCount(node) : int
node (Node) : the node
Returns the number of immediate predecessors of the supplied node.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.predecessors(node) : List
node (Node) : the node
Returns the immediate predecessors of the supplied node.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.replace(originalNode, replacementNode, discardOriginal)
originalNode (Node) : the node to be replaced
replacementNode (Node) : the new node
discardOriginal (boolean) : if True, the id of the original node is assigned to the new node and the original node is automatically deleted from the diagram. If False, the original node is retained and the replacement node id is unchanged
Replaces the specified node from this diagram. The both nodes must be owned by this diagram.
Exceptions:
OwnerException : if any node is not owned by this diagram
ObjectLockedException : if the diagram is currently locked
InvalidEditException : is the link operation is invalid
d.setEnabled(node, enabled)
node (Node) : the node
enabled (boolean) : whether the node should be enabled
Sets the enabled state of the supplied node.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.size() : int
Returns the number of Node objects contained in this diagram.
d.successorAt(node, index) : Node
node (Node) : the successor
index (int) : which successor to return
Returns the specified immediate successor of the supplied node or None if the index is out of bounds.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.successorCount(node) : int
node (Node) : the node
Returns the number of immediate successors of the supplied node.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.successors(node) : List
node (Node) : the node
Returns the immediate successors of the supplied node.
Exceptions:
OwnerException : if the node is not owned by this diagram
d.unlink(source, target)
source (Node) : the source node
target (Node) : the target node
Removes any direct link between the source and the target.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
d.unlink(source, targets)
source (Node) : the source node
targets (List) : the list of target nodes
Removes any direct links between the source and each object in the targets list.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked
ClassCastException : if targets does not contain instances of Node
d.unlinkPath(path)
path (List) : the list of Node instances
Removes any path that exists between Node instances. If no link exists between two adjacent nodes in the path, these are silently ignored i.e., no exception will be thrown.
Exceptions:
ObjectLockedException : if the diagram is currently locked
OwnerException : if any objects in the path are not owned by this diagram
d.unlinkUpdater(updater, updatable)
updater (Node) : the updater node
updatable (Node) : the target node
Removes any update link between the updater and the updatable. It is expected that updater implements the Updater interface while the updatable implements the Updatable interface.
Exceptions:
OwnerException : if any node parameters are not owned by this diagram
ObjectLockedException : if the diagram is currently locked