public class DefaultGraph extends Object implements IGraph
IGraph interface.
This implementation deals with the proper firing of events and handling of default values.
This implementation has inherent support for undoability. If the UndoEngineEnabled
property is set to true, changes to the structure of the graph will automatically be recorded using the UndoEngine
instance that can be queried from this instance's lookup(Class) method. Clients that wish to enqueue custom
undo events or that need to make non-structural changes to the graph can use the UndoEngine to do so. The
current instance of UndoEngine can be queried using the ILookup.lookup(Class) method of this instance.
Also there are several protected methods Create...UndoUnit that will be used by this instance to create the
actual undo units for structural changes in the graph's structure. If clients need to customize these units they can
create a subclass of DefaultGraph and override these methods.
Finally this implementation supports grouped graphs.
DefaultGraph is IGraph's default implementation as described in the section
The Graph Model - IGraph.
createUndoEngine(),
lookup(Class),
DefaultGraph,
FoldingManager| Constructor and Description |
|---|
DefaultGraph()
Creates a new instance of a graph that provides an
ILookupDecorator for all of its entities. |
| Modifier and Type | Method and Description |
|---|---|
IBend |
addBend(IEdge edge,
PointD location,
int index)
Adds a bend at the given index to the given edge using the coordinates provided.
|
void |
addBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
Adds the given listener for the
BendAdded event that occurs when a bend has been added to an edge in this
graph. |
void |
addBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
Adds the given listener for the
BendLocationChanged event that occurs when the location of a bend has been
changed. |
void |
addBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
Adds the given listener for the
BendRemoved event that occurs when a bend has been removed from an edge in this
graph. |
void |
addBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
Adds the given listener for the
BendTagChanged event that occurs when the tag of a
bend has been replaced. |
void |
addDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
Adds the given listener for the
DisplaysInvalidated event that occurs when the graph has changed visually and
the display should be updated to reflect the changes. |
void |
addEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
Adds the given listener for the
EdgeCreated event that occurs when an edge has been created. |
void |
addEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
Adds the given listener for the
EdgePortsChanged event that occurs when an edge had its SourcePort
or TargetPort changed. |
void |
addEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
Adds the given listener for the
EdgeRemoved event that occurs when an edge has been removed. |
void |
addEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
Adds the given listener for the
EdgeStyleChanged event that occurs when an edge style has been replaced. |
void |
addEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
Adds the given listener for the
EdgeTagChanged event that occurs when the tag of an
edge has been replaced. |
void |
addGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
Adds the given listener for the
GraphTagChanged event that occurs when the tag of the
graph has been replaced. |
void |
addIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
Adds the given listener for the
IsGroupNodeChanged
event. |
ILabel |
addLabel(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style,
SizeD preferredSize,
Object tag)
Add a label to the given item using the text as the initial label text and label model parameter, style and tag.
|
void |
addLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
Adds the given listener for the
LabelAdded event that occurs when a label has been added to this graph
instance. |
void |
addLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
Adds the given listener for the
LabelLayoutParameterChanged event that occurs when the model parameter of a
label has been changed. |
void |
addLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
Adds the given listener for the
LabelPreferredSizeChanged event that occurs when the preferred size of a label
has been changed. |
void |
addLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
Adds the given listener for the
LabelRemoved event that occurs when a label has been removed from this graph
instance. |
void |
addLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
Adds the given listener for the
LabelStyleChanged event that occurs when a label style has been replaced. |
void |
addLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
Adds the given listener for the
LabelTagChanged event that occurs when the tag of a
label has been replaced. |
void |
addLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
Adds the given listener for the
LabelTextChanged event that occurs when the text of a label has been changed. |
void |
addLookup(IContextLookupChainLink lookup)
Adds the chain element to the lookup for this instance.
|
void |
addNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
Adds the given listener for the
NodeCreated event that occurs when a node has been created. |
void |
addNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
Adds the given listener for the
NodeLayoutChanged event that occurs when a node layout has been changed. |
void |
addNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
Adds the given listener for the
NodeRemoved event that occurs when a node has been removed. |
void |
addNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
Adds the given listener for the
NodeStyleChanged event that occurs when a node style has been replaced. |
void |
addNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
Adds the given listener for the
NodeTagChanged event that occurs when the tag of a
node has been replaced. |
void |
addParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
Adds the given listener for the
ParentChanged
event. |
IPort |
addPort(IPortOwner owner,
IPortLocationModelParameter locationParameter,
IPortStyle style,
Object tag)
Add a port to the given port owner using the coordinates as the new initial position of the port anchor.
|
void |
addPortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
Adds the given listener for the
PortAdded event that occurs when a port has been added to this graph instance. |
void |
addPortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
Adds the given listener for the
PortLocationParameterChanged event that occurs when the location model parameter
of a port has been changed. |
void |
addPortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
Adds the given listener for the
PortRemoved event that occurs when a port has been removed from its
owner. |
void |
addPortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
Adds the given listener for the
PortStyleChanged event that occurs when a port style has been replaced. |
void |
addPortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
Adds the given listener for the
PortTagChanged event that occurs when the tag of a
port has been replaced. |
boolean |
contains(IModelItem item)
Determines whether this graph contains the specified item.
|
IEdge |
createEdge(INode source,
INode target,
IEdgeStyle style,
Object tag)
Convenience method that creates and returns an edge that connects to the given node instances using the given style
instance.
|
IEdge |
createEdge(IPort sourcePort,
IPort targetPort,
IEdgeStyle style,
Object tag)
Creates and returns an edge that connects to the given port instances.
|
INode |
createGroupNode(INode parent,
RectD layout,
INodeStyle style,
Object tag)
Creates a new group node using the provided style and layout as a child of
parent. |
INode |
createNode(INode parent,
RectD layout,
INodeStyle style,
Object tag)
Creates a new ordinary node as a direct descendant of
parent using the given layout and style. |
INode |
createNode(RectD layout,
INodeStyle style,
Object tag)
Creates and returns a node using the specified values for the initial geometry, style, and
Tag. |
protected UndoEngine |
createUndoEngine()
Creates an
UndoEngine instance that automatically triggers invalidateDisplays() upon each invocation of
UndoEngine.undo() and UndoEngine.redo(). |
protected IUndoUnit |
createUndoUnitForBendAddition(IBend bend,
int index)
Creates the bend addition
undo unit for the given bend. |
protected IUndoUnit |
createUndoUnitForBendRemoval(IBend bend)
Creates the bend removal
undo unit for the given bend. |
protected IUndoUnit |
createUndoUnitForEdgeCreation(IEdge edge)
Creates the edge creation
undo unit for the given edge. |
protected IUndoUnit |
createUndoUnitForEdgeReconnection(IEdge edge,
IPort oldSource,
IPort oldTarget)
Creates the edge reconnection
undo unit for the given edge. |
protected IUndoUnit |
createUndoUnitForEdgeRemoval(IEdge edge)
Creates the edge removal
undo unit for the given edge. |
protected IUndoUnit |
createUndoUnitForIsGroupNodeChange(INode node,
boolean isGroupNode)
Creates the
undo unit for changing whether the given node is a group node. |
protected IUndoUnit |
createUndoUnitForLabelAddition(ILabel label)
Creates the label addition
undo unit for the given label. |
protected IUndoUnit |
createUndoUnitForLabelRemoval(ILabel label)
Creates the label removal
undo unit for the given label. |
protected IUndoUnit |
createUndoUnitForNodeCreation(INode node,
INode parent,
boolean isGroupNode)
Creates the node creation
undo unit for the given node. |
protected IUndoUnit |
createUndoUnitForNodeRemoval(INode node)
Creates the node removal
undo unit for the given node. |
protected IUndoUnit |
createUndoUnitForParentChange(INode node,
INode oldParent,
INode newParent)
Creates the parent change
undo unit for the given node. |
protected IUndoUnit |
createUndoUnitForPortAddition(IPort port)
Creates the port addition
undo unit for the given port. |
protected IUndoUnit |
createUndoUnitForPortRemoval(IPort port)
Creates the port removal
undo unit for the given port. |
IListEnumerable<IEdge> |
edgesAt(IPort port,
AdjacencyTypes type)
Returns an
Iterable for all edges that are adjacent to the given port as a SourcePort
or TargetPort. |
IListEnumerable<IEdge> |
edgesAt(IPortOwner owner,
AdjacencyTypes type)
Returns an
IListEnumerable for all edges that have the given port owner as their target port's
or source port's Owner depending on the AdjacencyTypes. |
IListEnumerable<INode> |
getChildren(INode node)
Returns an enumerable over the children of the provided node.
|
static IContextLookup |
getDefaultBendLookup()
Gets an
IContextLookup that provides the default implementations returned by an IBend's lookup. |
static IContextLookup |
getDefaultEdgeLookup()
Gets an
IContextLookup that provides the default implementations returned by an IEdge's lookup. |
static IContextLookup |
getDefaultLabelLookup()
Gets an
IContextLookup that provides the default implementations returned by an ILabel's lookup. |
static IContextLookup |
getDefaultNodeLookup()
Gets an
IContextLookup that provides the default implementations returned by an INode's lookup. |
static IContextLookup |
getDefaultPortLookup()
Gets an
IContextLookup that provides the default implementations returned by an IPort's lookup. |
IEdgeDefaults |
getEdgeDefaults()
Gets the defaults for normal edges.
|
IListEnumerable<IEdge> |
getEdges()
A view of the edges contained in this graph.
|
INodeDefaults |
getGroupNodeDefaults()
Gets the defaults for group nodes.
|
IListEnumerable<ILabel> |
getLabels()
A view of the node and edge labels contained in this graph.
|
ILookup |
getLookup()
Returns the lookup implementation that is used for
lookup(Class) calls. |
IMapperRegistry |
getMapperRegistry()
Gets the mapper registry that is associated with this graph instance.
|
protected IPort |
getNewSourcePort(IPortOwner source)
Determines a
IPort instance to use for the creation of a new edge that starts at the given IPortOwner. |
protected IPort |
getNewTargetPort(IPortOwner targetOwner)
Determines a
IPort instance to use for the creation of a new edge that ends at the given IPortOwner. |
INodeDefaults |
getNodeDefaults()
Gets the defaults for normal nodes.
|
IListEnumerable<INode> |
getNodes()
A view of the nodes contained in this graph.
|
INode |
getParent(INode node)
Returns the parent node of the node or
null if node is a top-level node. |
IListEnumerable<IPort> |
getPorts()
A view of the ports contained in this graph.
|
Object |
getTag()
Gets the tag associated with this instance.
|
protected Object |
innerLookup(Class type)
The last element in the lookup chain is implemented by this method.
|
void |
invalidateDisplays()
Triggers the
DisplaysInvalidated event. |
boolean |
isGroupNode(INode node)
Returns whether the given node is considered a group node.
|
boolean |
isUndoEngineEnabled()
Gets whether or not the
UndoEngine used for this instance should be enabled. |
<TLookup> TLookup |
lookup(Class<TLookup> type)
Returns an instance that provides another aspect of this instance of the given type or
null. |
protected void |
onAddingBend(IEdge edge,
IBend bend,
int index)
Callback that is invoked before a bend is added to this graph's structure.
|
protected void |
onAddingEdgeLabel(IEdge edge,
ILabel label)
Callback method that will be called just before an edge label is added to an edge.
|
protected void |
onAddingNodeLabel(INode node,
ILabel label)
Callback method that will be called just before a node label is added to a node.
|
protected void |
onAddingPort(IPortOwner owner,
IPort port)
Called when a port is going to be added to a node.
|
protected void |
onBendAdded(IBend bend)
Callback that after a bend has been added to this graph's structure.
|
protected void |
onBendLocationChanged(IBend bend,
PointD oldLocation)
Callback that is invoked after a bend location has changed.
|
protected void |
onBendRemoved(IEdge owner,
IBend bend,
int index)
Callback method that is invoked just after a bend has been removed from its edge.
|
protected void |
onBendTagChanged(IBend bend,
Object oldTag)
Callback that is invoked after a bend tag has changed.
|
protected void |
onChangingEdgePorts(IEdge edge,
IPort newSource,
IPort newTarget)
Callback that is invoked before the ports of an edge are being changed.
|
protected void |
onChangingEdgeStyle(IEdge edge,
IEdgeStyle newStyle)
Callback that is invoked before an edge style is being changed.
|
protected void |
onChangingGraphTag(Object newTag)
Callback that is invoked before the graph's tag is being changed.
|
protected void |
onChangingLabelLayoutParameter(ILabel label,
ILabelModelParameter newLayoutParameter)
Callback that is invoked before the
LayoutParameter of a label is being changed. |
protected void |
onChangingLabelPreferredSize(ILabel label,
SizeD newSize)
Callback that is invoked before the preferred size of a label is being changed.
|
protected void |
onChangingLabelStyle(ILabel label,
ILabelStyle newStyle)
Callback that is invoked before a label style is being changed.
|
protected void |
onChangingLabelText(ILabel label,
String newText)
Callback that is invoked before the text of a label is being changed.
|
protected void |
onChangingNodeStyle(INode node,
INodeStyle newStyle)
Callback that is invoked before a node style is being changed.
|
protected void |
onChangingPortLocationModelParameter(IPort port,
IPortLocationModelParameter newLocationParameter)
Callback that is invoked before the
LocationParameter of a port is being changed. |
protected void |
onChangingPortStyle(IPort port,
IPortStyle newStyle)
Callback that is invoked before a port style is being changed.
|
protected void |
onCreatingEdge(IEdge edge,
IPort sourcePort,
IPort targetPort)
Callback that is invoked before the edge is added to this graph's structure.
|
protected void |
onCreatingNode(INode node)
Callback that is invoked before the node is added to this graph's structure.
|
protected void |
onEdgeCreated(IEdge edge)
Callback that triggers the
EdgeCreated event. |
protected void |
onEdgeLabelAdded(ILabel label)
Called after a label has been added to an edge.
|
protected void |
onEdgeLabelRemoved(ILabelOwner owner,
ILabel label)
Called after a label has been removed from its edge.
|
protected void |
onEdgePortsChanged(IEdge edge,
IPort oldSource,
IPort oldTarget)
Callback that is invoked after the ports of an edge has changed.
|
protected void |
onEdgeRemoved(IEdge edge,
IPort oldSource,
IPort oldTarget)
Callback that triggers the
EdgeRemoved event. |
protected void |
onEdgeStyleChanged(IEdge edge,
IEdgeStyle oldStyle)
Callback that is invoked after the style of an edge has changed.
|
protected void |
onEdgeTagChanged(IEdge edge,
Object oldTag)
Callback that is invoked after the tag of an edge has changed.
|
protected void |
onGraphTagChanged(Object oldTag)
Callback that triggers the
GraphTagChanged event. |
protected void |
onInvalidateDisplays(IEventArgs args)
Triggers the
DisplaysInvalidated event. |
protected void |
onLabelLayoutParameterChanged(ILabel label,
ILabelModelParameter oldLayoutParamater)
Callback that is invoked after a label model parameter has changed.
|
protected void |
onLabelPreferredSizeChanged(ILabel label,
SizeD oldSize)
Callback that is invoked after the preferred size of a label has changed.
|
protected void |
onLabelStyleChanged(ILabel label,
ILabelStyle oldStyle)
Callback that is invoked after a label style has changed.
|
protected void |
onLabelTagChanged(ILabel label,
Object oldTag)
Callback that is invoked after a label tag has changed.
|
protected void |
onLabelTextChanged(ILabel label,
String oldText)
Callback that is invoked after a label text has changed.
|
protected void |
onNodeCreated(INode node)
Callback that triggers the
NodeCreated event. |
protected void |
onNodeLabelAdded(ILabel label)
Called after a label has been added to a node.
|
protected void |
onNodeLabelRemoved(ILabelOwner owner,
ILabel label)
Called after a label has been removed from its node.
|
protected void |
onNodeLayoutChanged(INode node,
RectD oldLayout)
Callback that is invoked after a node layout has changed.
|
protected void |
onNodeRemoved(INode node,
INode oldParent,
boolean oldIsGroupNode)
Callback that triggers the
NodeRemoved event. |
protected void |
onNodeStyleChanged(INode node,
INodeStyle oldStyle)
Callback that is invoked after a node style has changed.
|
protected void |
onNodeTagChanged(INode node,
Object oldTag)
Callback that is invoked after a node tag has changed.
|
protected void |
onPortAdded(IPort port)
Called when a port has been added to a node.
|
protected void |
onPortLocationParameterChanged(IPort port,
IPortLocationModelParameter oldLocationParameter)
Callback that is invoked after a port location model parameter has changed.
|
protected void |
onPortRemoved(IPortOwner oldOwner,
IPort port)
Callback method that is called just after a port has been removed from its owner.
|
protected void |
onPortStyleChanged(IPort port,
IPortStyle oldStyle)
Callback that is invoked after a port style has changed.
|
protected void |
onPortTagChanged(IPort port,
Object oldTag)
Callback that is invoked after a port tag has changed.
|
protected void |
onRemovingBend(IBend bend)
Callback method that is invoked just before a bend is removed.
|
protected void |
onRemovingEdge(IEdge edge)
Callback that will be invoked before the node will be removed.
|
protected void |
onRemovingEdgeLabel(ILabel label)
Callback method that will be called just before an edge label is removed from its edge.
|
protected void |
onRemovingNode(INode node)
Callback that will be invoked before the node will be removed.
|
protected void |
onRemovingNodeLabel(ILabel label)
Callback method that will be called just before a node label is removed from its node.
|
protected void |
onRemovingPort(IPort port)
Callback method that is called just before a port will be removed.
|
void |
remove(IModelItem item)
Removes the given
item from this graph. |
void |
removeBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
Removes the given listener for the
BendAdded event that occurs when a bend has been added to an edge in this
graph. |
void |
removeBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
Removes the given listener for the
BendLocationChanged event that occurs when the location of a bend has been
changed. |
void |
removeBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
Removes the given listener for the
BendRemoved event that occurs when a bend has been removed from an edge in
this graph. |
void |
removeBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
Removes the given listener for the
BendTagChanged event that occurs when the tag of a
bend has been replaced. |
void |
removeDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
Removes the given listener for the
DisplaysInvalidated event that occurs when the graph has changed visually and
the display should be updated to reflect the changes. |
void |
removeEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
Removes the given listener for the
EdgeCreated event that occurs when an edge has been created. |
void |
removeEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
Removes the given listener for the
EdgePortsChanged event that occurs when an edge had its SourcePort
or TargetPort changed. |
void |
removeEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
Removes the given listener for the
EdgeRemoved event that occurs when an edge has been removed. |
void |
removeEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
Removes the given listener for the
EdgeStyleChanged event that occurs when an edge style has been replaced. |
void |
removeEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
Removes the given listener for the
EdgeTagChanged event that occurs when the tag of
an edge has been replaced. |
void |
removeGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
Removes the given listener for the
GraphTagChanged event that occurs when the tag of
the graph has been replaced. |
void |
removeIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
Removes the given listener for the
IsGroupNodeChanged
event. |
void |
removeLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
Removes the given listener for the
LabelAdded event that occurs when a label has been added to this graph
instance. |
void |
removeLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
Removes the given listener for the
LabelLayoutParameterChanged event that occurs when the model parameter of a
label has been changed. |
void |
removeLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
Removes the given listener for the
LabelPreferredSizeChanged event that occurs when the preferred size of a
label has been changed. |
void |
removeLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
Removes the given listener for the
LabelRemoved event that occurs when a label has been removed from this graph
instance. |
void |
removeLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
Removes the given listener for the
LabelStyleChanged event that occurs when a label style has been replaced. |
void |
removeLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
Removes the given listener for the
LabelTagChanged event that occurs when the tag of
a label has been replaced. |
void |
removeLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
Removes the given listener for the
LabelTextChanged event that occurs when the text of a label has been
changed. |
void |
removeLookup(IContextLookupChainLink lookup)
Removes a previously added lookup chain element from the lookup of
this. |
void |
removeNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
Removes the given listener for the
NodeCreated event that occurs when a node has been created. |
void |
removeNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
Removes the given listener for the
NodeLayoutChanged event that occurs when a node layout has been changed. |
void |
removeNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
Removes the given listener for the
NodeRemoved event that occurs when a node has been removed. |
void |
removeNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
Removes the given listener for the
NodeStyleChanged event that occurs when a node style has been replaced. |
void |
removeNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
Removes the given listener for the
NodeTagChanged event that occurs when the tag of a
node has been replaced. |
void |
removeParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
Removes the given listener for the
ParentChanged
event. |
void |
removePortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
Removes the given listener for the
PortAdded event that occurs when a port has been added to this graph
instance. |
void |
removePortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
Removes the given listener for the
PortLocationParameterChanged event that occurs when the location model
parameter of a port has been changed. |
void |
removePortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
Removes the given listener for the
PortRemoved event that occurs when a port has been removed from its
owner. |
void |
removePortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
Removes the given listener for the
PortStyleChanged event that occurs when a port style has been replaced. |
void |
removePortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
Removes the given listener for the
PortTagChanged event that occurs when the tag of a
port has been replaced. |
void |
setBendLocation(IBend bend,
PointD location)
Modifies the location of the given bend.
|
void |
setEdgeDefaults(IEdgeDefaults value)
Sets the defaults for normal edges.
|
void |
setEdgePorts(IEdge edge,
IPort sourcePort,
IPort targetPort)
Sets the ports of the given edge to the new values.
|
void |
setGroupNodeDefaults(INodeDefaults value)
Sets the defaults for group nodes.
|
void |
setIsGroupNode(INode node,
boolean isGroupNode)
Determines whether the given node should be considered a group node.
|
void |
setLabelLayoutParameter(ILabel label,
ILabelModelParameter layoutParameter)
Sets the label model parameter for the given label.
|
void |
setLabelPreferredSize(ILabel label,
SizeD size)
Sets the preferred size of the label.
|
void |
setLabelText(ILabel label,
String text)
Sets the label text of the given label.
|
protected void |
setLookupImplementation(ILookup lookup)
Sets the lookup implementation that will be used for
lookup(Class) calls. |
void |
setMapperRegistry(IMapperRegistry value)
Sets the mapper registry that is associated with this graph instance.
|
void |
setNodeDefaults(INodeDefaults value)
Sets the defaults for normal nodes.
|
void |
setNodeLayout(INode node,
RectD layout)
Sets the layout of the given node to the new values.
|
void |
setParent(INode node,
INode parent)
Sets the parent node for a given node.
|
void |
setPortLocationParameter(IPort port,
IPortLocationModelParameter locationParameter)
Sets a new
IPortLocationModelParameter for the given port. |
void |
setStyle(IEdge edge,
IEdgeStyle style)
Assigns the given style instance by reference to the edge.
|
void |
setStyle(ILabel label,
ILabelStyle style)
Assigns the given style instance by reference to the label.
|
void |
setStyle(INode node,
INodeStyle style)
Assigns the given style instance by reference to the node.
|
void |
setStyle(IPort port,
IPortStyle style)
Assigns the given style instance by reference to the port.
|
void |
setTag(Object value)
Sets the tag associated with this instance.
|
void |
setUndoEngineEnabled(boolean value)
Sets whether or not the
UndoEngine used for this instance should be enabled. |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitaddBend, addBends, addLabel, addLabel, addLabel, addLabel, addPort, addPort, addPort, addPort, addPort, addPort, addRelativePort, addUndoUnit, adjustGroupNodeLayout, adjustLabelPreferredSize, applyLayout, applyLayout, beginEdit, beginEdit, beginEdit, calculateLabelPreferredSize, calculateLabelPreferredSize, calculateLabelPreferredSize, calculateLabelPreferredSize, clear, clearBends, createDefaultLabelLayoutParameter, createDefaultPortLocationParameter, createDefaultPortLocationParameter, createEdge, createEdge, createEdge, createEdge, createGroupNode, createGroupNode, createGroupNode, createGroupNode, createNode, createNode, createNode, createNode, createNode, createNode, createNode, createNode, createNode, degree, degree, edgesAt, edgesAt, getBends, getDecorator, getDefaultNodeBounds, getEdge, getEdge, getEdgeLabels, getFoldingView, getGroupingSupport, getLabelDefaults, getNodeLabels, getPortDefaults, getUndoEngine, groupNodes, groupNodes, groupNodes, inDegree, inDegree, inEdgesAt, inEdgesAt, neighbors, outDegree, outDegree, outEdgesAt, outEdgesAt, predecessors, reverse, setNodeCenter, setPortLocation, setRelativePortLocation, successorscreateDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, safeLookuppublic DefaultGraph()
ILookupDecorator for all of its entities.public IBend addBend(IEdge edge, PointD location, int index)
IGraphThe added instance will be returned.
addBend in interface IGraphedge - The edge to which the bend will be added.location - the coordinates to use for the newly created bendindex - The index for the newly added bend; a negative value (which is the default) indicates that the bend should be appended
to the end of the list of bends.IGraph.remove(IModelItem),
IGraph.setBendLocation(IBend, PointD)public final void addBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
IGraphBendAdded event that occurs when a bend has been added to an edge in this
graph.
This event is intended to provide notification of low level changes in the graph structure. Please use the BendCreated
event if you are interested only in bend creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the bend creation that has triggered this event.
addBendAddedListener in interface IGraphbendAddedEvent - The listener to add.IGraph.addBend(IEdge, PointD, int),
CreateBendInputMode.addBendCreatedListener(IEventHandler),
IGraph.removeBendAddedListener(IEventHandler)public final void addBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
IGraphBendLocationChanged event that occurs when the location of a bend has been
changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addBendLocationChangedListener in interface IGraphbendLocationChangedEvent - The listener to add.IGraph.setBendLocation(IBend, PointD),
IGraph.removeBendLocationChangedListener(IBendLocationChangedHandler)public final void addBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
IGraphBendRemoved event that occurs when a bend has been removed from an edge in this
graph.
This event will be triggered, too, if an edge has been removed from the graph, for each of the bends that belonged to the edge.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in bend removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the bend removal that has triggered this event.
addBendRemovedListener in interface IGraphbendRemovedEvent - The listener to add.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.removeBendRemovedListener(IEventHandler)public final void addBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
IGraphBendTagChanged event that occurs when the tag of a
bend has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addBendTagChangedListener in interface IGraphbendTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removeBendTagChangedListener(IEventHandler)public final void addDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
IGraphDisplaysInvalidated event that occurs when the graph has changed visually and
the display should be updated to reflect the changes.
This event is invoked with IEventArgs.EMPTY per default.
addDisplaysInvalidatedListener in interface IGraphdisplaysInvalidatedEvent - The listener to add.IGraph.removeDisplaysInvalidatedListener(IEventHandler)public final void addEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
IGraphEdgeCreated event that occurs when an edge has been created.
This event is intended to provide notification of low level changes in the graph structure. Please use the EdgeCreated
event if you are interested only in edge creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the edge creation that has triggered this event.
addEdgeCreatedListener in interface IGraphedgeCreatedEvent - The listener to add.IGraph.createEdge(IPort, IPort, IEdgeStyle, Object),
CreateEdgeInputMode.addEdgeCreatedListener(IEventHandler),
IGraph.removeEdgeCreatedListener(IEventHandler)public final void addEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
IGraphEdgePortsChanged event that occurs when an edge had its SourcePort
or TargetPort changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addEdgePortsChangedListener in interface IGraphedgePortsChangedEvent - The listener to add.IGraph.setEdgePorts(IEdge, IPort, IPort),
IGraph.removeEdgePortsChangedListener(IEventHandler)public final void addEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
IGraphEdgeRemoved event that occurs when an edge has been removed.
This event will be triggered, too, prior to a node removal.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in edge removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the edge removal that has triggered this event.
addEdgeRemovedListener in interface IGraphedgeRemovedEvent - The listener to add.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.removeEdgeRemovedListener(IEventHandler)public final void addEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
IGraphEdgeStyleChanged event that occurs when an edge style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addEdgeStyleChangedListener in interface IGraphedgeStyleChangedEvent - The listener to add.IGraph.setStyle(IEdge, IEdgeStyle),
IGraph.removeEdgeStyleChangedListener(IEventHandler)public final void addEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
IGraphEdgeTagChanged event that occurs when the tag of an
edge has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addEdgeTagChangedListener in interface IGraphedgeTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removeEdgeTagChangedListener(IEventHandler)public final void addGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
IGraphGraphTagChanged event that occurs when the tag of the
graph has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addGraphTagChangedListener in interface IGraphgraphTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removeGraphTagChangedListener(IEventHandler)public final void addIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
IGraphIsGroupNodeChanged
event.
addIsGroupNodeChangedListener in interface IGraphisGroupNodeChangedEvent - The listener to add.IGraph.removeIsGroupNodeChangedListener(IEventHandler)public ILabel addLabel(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, SizeD preferredSize, Object tag)
IGraphaddLabel in interface IGraphowner - the item to add the label to.text - the initial text of the labellayoutParameter - The label model parameter instance to use.style - The style to use for the labelpreferredSize - The initial values to use for the PreferredSize.tag - the initial Tag to assign.IGraph.addLabelAddedListener(IEventHandler),
IGraph.setLabelText(ILabel, String),
IGraph.setLabelLayoutParameter(ILabel, ILabelModelParameter),
IGraph.setStyle(ILabel, ILabelStyle),
VoidLabelStyle.INSTANCEpublic final void addLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
IGraphLabelAdded event that occurs when a label has been added to this graph
instance.
This event is intended to provide notification of low level changes in the graph structure. Please use the LabelAdded
event if you are interested only in label creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the label creation that has triggered this event.
addLabelAddedListener in interface IGraphlabelAddedEvent - The listener to add.IGraph.addLabel(ILabelOwner, String, ILabelModelParameter, ILabelStyle, SizeD, Object),
GraphEditorInputMode.addLabelAddedListener(IEventHandler),
IGraph.removeLabelAddedListener(IEventHandler)public final void addLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
IGraphLabelLayoutParameterChanged event that occurs when the model parameter of a
label has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addLabelLayoutParameterChangedListener in interface IGraphlabelLayoutParameterChangedEvent - The listener to add.IGraph.setLabelLayoutParameter(ILabel, ILabelModelParameter),
IGraph.removeLabelLayoutParameterChangedListener(IEventHandler)public final void addLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
IGraphLabelPreferredSizeChanged event that occurs when the preferred size of a label
has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addLabelPreferredSizeChangedListener in interface IGraphlabelPreferredSizeChangedEvent - The listener to add.IGraph.setLabelPreferredSize(ILabel, SizeD),
IGraph.removeLabelPreferredSizeChangedListener(IEventHandler)public final void addLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
IGraphLabelRemoved event that occurs when a label has been removed from this graph
instance.
This event will also be triggered, prior to the removal of the owner of the label.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in label removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the label removal that has triggered this event.
addLabelRemovedListener in interface IGraphlabelRemovedEvent - The listener to add.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
GraphEditorInputMode.addLabelTextChangedListener(IEventHandler),
IGraph.removeLabelRemovedListener(IEventHandler)public final void addLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
IGraphLabelStyleChanged event that occurs when a label style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addLabelStyleChangedListener in interface IGraphlabelStyleChangedEvent - The listener to add.IGraph.setStyle(ILabel, ILabelStyle),
IGraph.removeLabelStyleChangedListener(IEventHandler)public final void addLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
IGraphLabelTagChanged event that occurs when the tag of a
label has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addLabelTagChangedListener in interface IGraphlabelTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removeLabelTagChangedListener(IEventHandler)public final void addLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
IGraphLabelTextChanged event that occurs when the text of a label has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addLabelTextChangedListener in interface IGraphlabelTextChangedEvent - The listener to add.IGraph.setLabelText(ILabel, String),
IGraph.removeLabelTextChangedListener(IEventHandler)public void addLookup(IContextLookupChainLink lookup)
lookup - The lookup to decorate the current instance with.public final void addNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
IGraphNodeCreated event that occurs when a node has been created.
This event is intended to provide notification of low level changes in the graph structure. Please use the NodeCreated
event if you are interested only in node creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the node creation that has triggered this event.
addNodeCreatedListener in interface IGraphnodeCreatedEvent - The listener to add.IGraph.createNode(RectD, INodeStyle, Object),
IGraph.createNode(INode, RectD, INodeStyle, Object),
IGraph.createGroupNode(INode, RectD, INodeStyle, Object),
GraphEditorInputMode.addNodeCreatedListener(IEventHandler),
IGraph.removeNodeCreatedListener(IEventHandler)public final void addNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
IGraphNodeLayoutChanged event that occurs when a node layout has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addNodeLayoutChangedListener in interface IGraphnodeLayoutChangedEvent - The listener to add.IGraph.removeNodeLayoutChangedListener(INodeLayoutChangedHandler)public final void addNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
IGraphNodeRemoved event that occurs when a node has been removed.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in node removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the node removal that has triggered this event.
addNodeRemovedListener in interface IGraphnodeRemovedEvent - The listener to add.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.removeNodeRemovedListener(IEventHandler)public final void addNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
IGraphNodeStyleChanged event that occurs when a node style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addNodeStyleChangedListener in interface IGraphnodeStyleChangedEvent - The listener to add.IGraph.setStyle(INode, INodeStyle),
IGraph.removeNodeStyleChangedListener(IEventHandler)public final void addNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
IGraphNodeTagChanged event that occurs when the tag of a
node has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addNodeTagChangedListener in interface IGraphnodeTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removeNodeTagChangedListener(IEventHandler)public final void addParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
IGraphParentChanged
event.
addParentChangedListener in interface IGraphparentChangedEvent - The listener to add.IGraph.removeParentChangedListener(IEventHandler)public IPort addPort(IPortOwner owner, IPortLocationModelParameter locationParameter, IPortStyle style, Object tag)
addPort in interface IGraphUnsupportedOperationException - If this instance cannot add a port to owner.owner - the owner to add the port instance to.locationParameter - the parameter to use for the port to determine its location.style - the style to assign initially to the port, e.g. VoidPortStyle.INSTANCE.tag - The tag to associate with the port, may be null.addPortAddedListener(IEventHandler)public final void addPortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
IGraphPortAdded event that occurs when a port has been added to this graph instance.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port creation that has triggered this event.
addPortAddedListener in interface IGraphportAddedEvent - The listener to add.IGraph.addPort(IPortOwner, IPortLocationModelParameter, IPortStyle, Object),
IGraph.createEdge(INode, INode, IEdgeStyle, Object),
IGraph.removePortAddedListener(IEventHandler)public final void addPortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
IGraphPortLocationParameterChanged event that occurs when the location model parameter
of a port has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addPortLocationParameterChangedListener in interface IGraphportLocationParameterChangedEvent - The listener to add.IGraph.setPortLocationParameter(IPort, IPortLocationModelParameter),
IGraph.removePortLocationParameterChangedListener(IEventHandler)public final void addPortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
IGraphPortRemoved event that occurs when a port has been removed from its
owner.
This event will also be triggered prior to the removal of the corresponding owner of the port.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in port removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the port removal that has triggered this event.
addPortRemovedListener in interface IGraphportRemovedEvent - The listener to add.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.removePortRemovedListener(IEventHandler)public final void addPortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
IGraphPortStyleChanged event that occurs when a port style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addPortStyleChangedListener in interface IGraphportStyleChangedEvent - The listener to add.IGraph.setStyle(IPort, IPortStyle),
IGraph.removePortStyleChangedListener(IEventHandler)public final void addPortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
IGraphPortTagChanged event that occurs when the tag of a
port has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
addPortTagChangedListener in interface IGraphportTagChangedEvent - The listener to add.ITagOwner.getTag(),
IGraph.removePortTagChangedListener(IEventHandler)public boolean contains(IModelItem item)
public IEdge createEdge(INode source, INode target, IEdgeStyle style, Object tag)
The nodes must be part of this graph at the time of the invocation, and the implementation will choose the IPort
instances to which the edge will be connected. The edge will be a part of this graph after the method returns. This will
trigger the corresponding events.
createEdge in interface IGraphsource - The source node the created edge will connect to. This implementation queries the getNewSourcePort(IPortOwner)
method to determine which port to use.target - The target node the created edge will connect to. This implementation queries the getNewSourcePort(IPortOwner)
method to determine which port to use.style - The style instance that will be assigned to the newly created instance. This is done by reference.tag - the initial Tag to assign.addEdgeCreatedListener(IEventHandler),
getNewSourcePort(IPortOwner),
getNewTargetPort(IPortOwner),
createEdge(IPort, IPort, IEdgeStyle, Object)public IEdge createEdge(IPort sourcePort, IPort targetPort, IEdgeStyle style, Object tag)
IGraphThe ports must be part of this graph at the time of the invocation. The edge will be a part of this graph after the method returns. This will trigger the corresponding events.
createEdge in interface IGraphsourcePort - The source port the created edge will connect to.targetPort - The target port the created edge will connect to.style - The style instance that will be assigned to the newly created instance. This is done by reference.tag - The initial value of the Tag that will be assigned to the new edge.IGraph.addEdgeCreatedListener(IEventHandler),
VoidEdgeStyle.INSTANCEpublic final INode createGroupNode(INode parent, RectD layout, INodeStyle style, Object tag)
IGraphparent.
The group node will be a direct descendant of parent.
To create group nodes interactively use the GraphEditorInputMode as input mode and
enable the grouping operations.
createGroupNode in interface IGraphparent - The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node.layout - The initial layout to use for the new node.style - The style to use for the new node.tag - The Tag to assign to the INode.public final INode createNode(INode parent, RectD layout, INodeStyle style, Object tag)
IGraphparent using the given layout and style.createNode in interface IGraphparent - The node to use as the parent in the grouping hierarchy or null if the new node should become a top-level node.layout - The layout to use initially. The values will be copied to the node's Layout field.style - The style instance that will be assigned to the newly created instance. This is done by reference.tag - The Tag to assign to the INode.IGraph.setParent(INode, INode),
IGraph.createNode(RectD, INodeStyle, Object),
IGraph.createGroupNode(INode, RectD, INodeStyle, Object)public INode createNode(RectD layout, INodeStyle style, Object tag)
IGraphTag.
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
createNode in interface IGraphlayout - The layout to use initially. The values will be copied to the node's Layout fieldstyle - The style instance that will be assigned to the newly created instance. This is done by reference.tag - The initial value of the Tag that will be assigned to the new node.IGraph.addNodeCreatedListener(IEventHandler),
VoidNodeStyle.INSTANCEprotected UndoEngine createUndoEngine()
UndoEngine instance that automatically triggers invalidateDisplays() upon each invocation of
UndoEngine.undo() and UndoEngine.redo().UndoEngine instance.protected IUndoUnit createUndoUnitForBendAddition(IBend bend, int index)
undo unit for the given bend.bend - The bend that has been added.index - The index at which the bend has been added.protected IUndoUnit createUndoUnitForBendRemoval(IBend bend)
undo unit for the given bend.bend - The bend that will be removed.protected IUndoUnit createUndoUnitForEdgeCreation(IEdge edge)
undo unit for the given edge.edge - The edge that has been created.protected IUndoUnit createUndoUnitForEdgeReconnection(IEdge edge, IPort oldSource, IPort oldTarget)
undo unit for the given edge.edge - The edge that has been reconnected to other ports.oldSource - The old source port the edge connected to before the change.oldTarget - The old target port the edge connected to before the change.protected IUndoUnit createUndoUnitForEdgeRemoval(IEdge edge)
undo unit for the given edge.edge - The edge that will be removed.protected IUndoUnit createUndoUnitForIsGroupNodeChange(INode node, boolean isGroupNode)
undo unit for changing whether the given node is a group node.node - The node whose group node status has been changed.isGroupNode - The new group node status.protected IUndoUnit createUndoUnitForLabelAddition(ILabel label)
undo unit for the given label.label - The label that has been added.protected IUndoUnit createUndoUnitForLabelRemoval(ILabel label)
undo unit for the given label.label - The label that will be removed.protected IUndoUnit createUndoUnitForNodeCreation(INode node, INode parent, boolean isGroupNode)
undo unit for the given node.node - The node that has been created.protected IUndoUnit createUndoUnitForNodeRemoval(INode node)
undo unit for the given node.node - The node that will be removed.protected IUndoUnit createUndoUnitForParentChange(INode node, INode oldParent, INode newParent)
undo unit for the given node.node - The node whose parent has been changed.newParent - The node which is the new parent.protected IUndoUnit createUndoUnitForPortAddition(IPort port)
undo unit for the given port.port - The port that has been added.protected IUndoUnit createUndoUnitForPortRemoval(IPort port)
undo unit for the given port.port - The port that will be removed.public IListEnumerable<IEdge> edgesAt(IPort port, AdjacencyTypes type)
IGraphIterable for all edges that are adjacent to the given port as a SourcePort
or TargetPort.
Note that even though edges can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in
your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent
edges via a foreach loop.
edgesAt in interface IGraphport - the port to checktype - The type of adjacency to consider.IGraph.edgesAt(IPort),
IGraph.inEdgesAt(IPort),
IGraph.outEdgesAt(IPort),
AdjacencyTypespublic IListEnumerable<IEdge> edgesAt(IPortOwner owner, AdjacencyTypes type)
IGraphIListEnumerable for all edges that have the given port owner as their target port's
or source port's Owner depending on the AdjacencyTypes.
Note that even though edges can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in
your own list, if possible. This is not necessary for the first or last element or when iterating over the adjacent
edges via a foreach loop.
edgesAt in interface IGraphowner - the port owner to checktype - The type of adjacency to consider.IGraph.edgesAt(IPortOwner),
IGraph.inEdgesAt(IPortOwner),
IGraph.outEdgesAt(IPortOwner),
AdjacencyTypespublic final IListEnumerable<INode> getChildren(INode node)
IGraphgetChildren in interface IGraphnode - The node for which to return the children or null if the top-level nodes should be returned.node as their parent.public static final IContextLookup getDefaultBendLookup()
IContextLookup that provides the default implementations returned by an IBend's lookup.
The provided default implementations can for example be used as fallback when the bend lookup is wrapped.
public static final IContextLookup getDefaultEdgeLookup()
IContextLookup that provides the default implementations returned by an IEdge's lookup.
The provided default implementations can for example be used as fallback when the edge lookup is wrapped.
public static final IContextLookup getDefaultLabelLookup()
IContextLookup that provides the default implementations returned by an ILabel's lookup.
The provided default implementations can for example be used as fallback when the label lookup is wrapped.
public static final IContextLookup getDefaultNodeLookup()
IContextLookup that provides the default implementations returned by an INode's lookup.
The provided default implementations can for example be used as fallback when the node lookup is wrapped.
public static final IContextLookup getDefaultPortLookup()
IContextLookup that provides the default implementations returned by an IPort's lookup.
The provided default implementations can for example be used as fallback when the port lookup is wrapped.
public final IEdgeDefaults getEdgeDefaults()
IGraphThe settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
getEdgeDefaults in interface IGraphIGraph.setEdgeDefaults(IEdgeDefaults)public final IListEnumerable<IEdge> getEdges()
IGraphThis is a live view of the edges that always represents the current state of the graph. The same reference will be returned for each invocation.
Note that even though edges can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the edges in
your own list, if possible. This is not necessary for the first or last element or when iterating over the edges via a foreach
loop.
public final INodeDefaults getGroupNodeDefaults()
IGraphgetGroupNodeDefaults in interface IGraphIGraph.setGroupNodeDefaults(INodeDefaults)public final IListEnumerable<ILabel> getLabels()
IGraphThis is a live view of the labels that always represents the current state of the graph. The same reference will be returned for each invocation.
Note that even though labels can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the labels in
your own list, if possible. This is not necessary for the first or last element or when iterating over the labels via a
foreach loop.
public ILookup getLookup()
lookup(Class) calls.null if the internal lookup mechanism is used.setLookupImplementation(ILookup)public final IMapperRegistry getMapperRegistry()
The registry can be used to store data mappings for the items in this instance. This field is populated upon first access. Also this property provides write access.
getMapperRegistry in interface IGraphIMapperRegistry,
IModelItem,
ITagOwner.getTag(),
setMapperRegistry(IMapperRegistry)protected IPort getNewSourcePort(IPortOwner source)
IPort instance to use for the creation of a new edge that starts at the given IPortOwner.
This implementation will add a new center anchored port
to the node.
source - The source node to find a port for.createEdge(INode, INode, IEdgeStyle, Object)protected IPort getNewTargetPort(IPortOwner targetOwner)
IPort instance to use for the creation of a new edge that ends at the given IPortOwner.
This implementation will add a new center anchored port
to the node.
targetOwner - The target node to find a port for.createEdge(INode, INode, IEdgeStyle, Object)public final INodeDefaults getNodeDefaults()
IGraphThe settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
getNodeDefaults in interface IGraphIGraph.setNodeDefaults(INodeDefaults)public final IListEnumerable<INode> getNodes()
IGraphThis is a live view of the nodes that always represents the current state of the graph. The same reference will be returned for each invocation.
Note that even though nodes can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the nodes in
your own list, if possible. This is not necessary for the first or last element or when iterating over the nodes via a foreach
loop.
public final INode getParent(INode node)
IGraphnull if node is a top-level node.public final IListEnumerable<IPort> getPorts()
IGraphThis is a live view of the ports that always represents the current state of the graph. The same reference will be returned for each invocation.
Note that even though ports can be accessed via index, the underlying graph structure in the default IGraph
implementation is a linked list and indexed access can be slow. In those cases it is recommended to store the ports in
your own list, if possible. This is not necessary for the first or last element or when iterating over the ports via a foreach
loop.
public final Object getTag()
ITagOwnerThe implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.
getTag in interface ITagOwnerITagOwner.setTag(Object)protected Object innerLookup(Class type)
public void invalidateDisplays()
DisplaysInvalidated event.
Clients can call this method to force an invalidation of the displays that show this graph instance. This implementation
delegates to onInvalidateDisplays(IEventArgs).
invalidateDisplays in interface IGraphpublic final boolean isGroupNode(INode node)
IGraph
Group nodes may have children but do not necessarily need to have children.
isGroupNode in interface IGraphnode - The node to check.IGraph.getChildren(INode),
IGraph.setIsGroupNode(INode, boolean)public boolean isUndoEngineEnabled()
UndoEngine used for this instance should be enabled.
The default is false. In order to enable undoability for this instance, set this property to true and lookup(Class)
the UndoEngine type. Disabling this property clears and removes the current UndoEngine (and all enqueued
IUndoUnits).
isUndoEngineEnabled in interface IGraphsetUndoEngineEnabled(boolean)public <TLookup> TLookup lookup(Class<TLookup> type)
null.
Typically, this method will be called in order to obtain a different view or aspect of the current instance. This is
quite similar to casting or using a super type or interface of this instance, but is not limited to inheritance or
compile time constraints. This method is not required to return non-null implementations for the types, nor does
it have to return the same instance any time. Also it depends on the type and context whether the instance returned
stays up to date or needs to be re-obtained for subsequent use. This implementation uses the set lookup implementation
if it has been set or an internal lookup chain, that can be customized using the addLookup(IContextLookupChainLink)
and removeLookup(IContextLookupChainLink) methods.
protected void onAddingBend(IEdge edge, IBend bend, int index)
edge - The edge the bend will be added to.bend - The bend that will be added to the edge.index - The index where the bend will be added to the edge.protected void onAddingEdgeLabel(IEdge edge, ILabel label)
protected void onAddingNodeLabel(INode node, ILabel label)
protected void onAddingPort(IPortOwner owner, IPort port)
owner - The node.port - The port to be added.protected void onBendAdded(IBend bend)
When overriding this method it is mandatory to call the base implementation.
bend - The bend that has been added to the edge.protected void onBendLocationChanged(IBend bend, PointD oldLocation)
This will trigger the BendLocationChanged event.
bend - The bend whose location has changed.oldLocation - The bend location before the changeprotected void onBendRemoved(IEdge owner, IBend bend, int index)
When overriding this method it is mandatory to call the base implementation.
owner - The old edge.bend - The bend.index - The former index of the bend in the Bends list.protected void onBendTagChanged(IBend bend, Object oldTag)
This will trigger the BendTagChanged event.
bend - The bend whose tag has changed.oldTag - The bend tag before the changeprotected void onChangingEdgePorts(IEdge edge, IPort newSource, IPort newTarget)
edge - An edge whose the ports are to be changed.newSource - The new source portnewTarget - The new target portprotected void onChangingEdgeStyle(IEdge edge, IEdgeStyle newStyle)
edge - An edge whose the style is going to be changed.newStyle - The new edge style.protected void onChangingGraphTag(Object newTag)
newTag - The new port tagprotected void onChangingLabelLayoutParameter(ILabel label, ILabelModelParameter newLayoutParameter)
LayoutParameter of a label is being changed.label - A label whose LayoutParameter is to be changed.newLayoutParameter - The new label model parameterprotected void onChangingLabelPreferredSize(ILabel label, SizeD newSize)
label - A label whose preferred size is going to be changed.newSize - The new preferred sizeprotected void onChangingLabelStyle(ILabel label, ILabelStyle newStyle)
label - A label whose the style is going to be changed.newStyle - The new label style.protected void onChangingLabelText(ILabel label, String newText)
label - A label whose text is going to be changed.newText - The new label textprotected void onChangingNodeStyle(INode node, INodeStyle newStyle)
node - A node whose the style is going to be changed.newStyle - The new node style.protected void onChangingPortLocationModelParameter(IPort port, IPortLocationModelParameter newLocationParameter)
LocationParameter of a port is being changed.port - A port whose LocationParameter is to be changed.newLocationParameter - The new location model parameterprotected void onChangingPortStyle(IPort port, IPortStyle newStyle)
port - A port whose the style is going to be changed.newStyle - The new port style.protected void onCreatingEdge(IEdge edge, IPort sourcePort, IPort targetPort)
edge - An edge that is not yet contained in this graph.sourcePort - The source port this edge will connect to.targetPort - The target port this edge will connect to.protected void onCreatingNode(INode node)
node - A node that is not yet contained in this graph.protected void onEdgeCreated(IEdge edge)
EdgeCreated event.edge - The edge that has been created.protected void onEdgeLabelAdded(ILabel label)
This method triggers the LabelAdded event.
When overriding this method it is mandatory to call the base implementation.
label - The label that has just been added.protected void onEdgeLabelRemoved(ILabelOwner owner, ILabel label)
When overriding this method it is mandatory to call the base implementation.
label - The label that has just been removed.owner - The previous owner of the label.protected void onEdgePortsChanged(IEdge edge, IPort oldSource, IPort oldTarget)
This will trigger the EdgePortsChanged event.
edge - The edge whose ports have changed.oldSource - The source port that the edge had been connected to before the change.oldTarget - The target port that the edge had been connected to before the change.protected void onEdgeRemoved(IEdge edge, IPort oldSource, IPort oldTarget)
EdgeRemoved event.edge - The edge that got removedoldSource - The source port that the edge had been connected to.oldTarget - The target port that the edge had been connected to.protected void onEdgeStyleChanged(IEdge edge, IEdgeStyle oldStyle)
This will trigger the EdgeStyleChanged event.
edge - The edge whose style that has changed.oldStyle - The edge style before the changeprotected void onEdgeTagChanged(IEdge edge, Object oldTag)
This will trigger the EdgeTagChanged event.
edge - The edge whose tag has changed.oldTag - The edge tag before the change.protected void onGraphTagChanged(Object oldTag)
GraphTagChanged event.oldTag - The graph tag before the change.protected void onInvalidateDisplays(IEventArgs args)
DisplaysInvalidated event.args - The event arguments.protected void onLabelLayoutParameterChanged(ILabel label, ILabelModelParameter oldLayoutParamater)
This will trigger the LabelLayoutParameterChanged event.
label - The label whose model parameter has changed.oldLayoutParamater - The label model parameter before the changeprotected void onLabelPreferredSizeChanged(ILabel label, SizeD oldSize)
This will trigger the LabelPreferredSizeChanged event.
label - The label whose preferred size has changed.oldSize - The preferred size of the label before the changeprotected void onLabelStyleChanged(ILabel label, ILabelStyle oldStyle)
This will trigger the LabelStyleChanged event.
label - The label whose style has changed.oldStyle - The label style before the change.protected void onLabelTagChanged(ILabel label, Object oldTag)
This will trigger the LabelTagChanged event.
label - The label whose tag has changed.oldTag - The label tag before the changeprotected void onLabelTextChanged(ILabel label, String oldText)
This will trigger the LabelTextChanged event.
label - The label whose text has changed.oldText - The label text before the change.protected void onNodeCreated(INode node)
NodeCreated event.node - The node that has been created.protected void onNodeLabelAdded(ILabel label)
This method triggers the LabelAdded event.
When overriding this method it is mandatory to call the base implementation.
label - The label that has just been added.protected void onNodeLabelRemoved(ILabelOwner owner, ILabel label)
When overriding this method it is mandatory to call the base implementation.
label - The label that has just been removed.owner - The old owner of the label.protected void onNodeLayoutChanged(INode node, RectD oldLayout)
This will trigger the NodeLayoutChanged event.
node - The node whose layout has changed.oldLayout - The node layout before the changeprotected void onNodeRemoved(INode node, INode oldParent, boolean oldIsGroupNode)
NodeRemoved event.node - The node that got removedprotected void onNodeStyleChanged(INode node, INodeStyle oldStyle)
This will trigger the NodeStyleChanged event.
node - The node whose style has changed.oldStyle - The node style before the changeprotected void onNodeTagChanged(INode node, Object oldTag)
This will trigger the NodeTagChanged event.
node - The node whose tag has changed.oldTag - The node tag before the changeprotected void onPortAdded(IPort port)
When overriding this method it is mandatory to call the base implementation.
port - The port that has just been added to its owner.protected void onPortLocationParameterChanged(IPort port, IPortLocationModelParameter oldLocationParameter)
This will trigger the PortLocationParameterChanged
event.
port - The port whose location model parameter has changed.oldLocationParameter - The port location model parameter before the changeprotected void onPortRemoved(IPortOwner oldOwner, IPort port)
When overriding this method it is mandatory to call the base implementation.
port - The port that has been removed.oldOwner - The previous owner of the port.protected void onPortStyleChanged(IPort port, IPortStyle oldStyle)
This will trigger the PortStyleChanged event.
port - The port whose style has changed.oldStyle - The port style before the changeprotected void onPortTagChanged(IPort port, Object oldTag)
This will trigger the PortTagChanged event.
port - The port whose tag has changed.oldTag - The port tag before the changeprotected void onRemovingBend(IBend bend)
bend - The bend that will be removed.protected void onRemovingEdge(IEdge edge)
edge - That edge that is going to be removed.protected void onRemovingEdgeLabel(ILabel label)
protected void onRemovingNode(INode node)
node - That node that is going to be removed.protected void onRemovingNodeLabel(ILabel label)
protected void onRemovingPort(IPort port)
port - The port that is about to be removed.public void remove(IModelItem item)
IGraphitem from this graph.
The item must be a part of this graph.
If the item is a node the NodeRemoved event will be
triggered. The implementation will remove all adjacent edges and their corresponding ports in proper order before the
node will be removed. Also this will trigger the removal of all labels owned by this instance.
If the item is an edge the EdgeRemoved event will be
triggered. The implementation may decide to remove the corresponding ports from the node if no other edge connects to
them after the given edge has been removed. Also this will trigger the removal of all labels and bends owned by this
instance.
If the item is a bend the BendRemoved event will be
triggered.
If the item is a port the PortRemoved event will be
triggered. This will also remove all edges that are currently connected to the port.
If the item is a label the LabelRemoved event will be
triggered.
public final void removeBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
IGraphBendAdded event that occurs when a bend has been added to an edge in this
graph.
This event is intended to provide notification of low level changes in the graph structure. Please use the BendCreated
event if you are interested only in bend creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the bend creation that has triggered this event.
removeBendAddedListener in interface IGraphbendAddedEvent - The listener to remove.IGraph.addBend(IEdge, PointD, int),
CreateBendInputMode.addBendCreatedListener(IEventHandler),
IGraph.addBendAddedListener(IEventHandler)public final void removeBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
IGraphBendLocationChanged event that occurs when the location of a bend has been
changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeBendLocationChangedListener in interface IGraphbendLocationChangedEvent - The listener to remove.IGraph.setBendLocation(IBend, PointD),
IGraph.addBendLocationChangedListener(IBendLocationChangedHandler)public final void removeBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
IGraphBendRemoved event that occurs when a bend has been removed from an edge in
this graph.
This event will be triggered, too, if an edge has been removed from the graph, for each of the bends that belonged to the edge.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in bend removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the bend removal that has triggered this event.
removeBendRemovedListener in interface IGraphbendRemovedEvent - The listener to remove.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.addBendRemovedListener(IEventHandler)public final void removeBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
IGraphBendTagChanged event that occurs when the tag of a
bend has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeBendTagChangedListener in interface IGraphbendTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addBendTagChangedListener(IEventHandler)public final void removeDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
IGraphDisplaysInvalidated event that occurs when the graph has changed visually and
the display should be updated to reflect the changes.
This event is invoked with IEventArgs.EMPTY per default.
removeDisplaysInvalidatedListener in interface IGraphdisplaysInvalidatedEvent - The listener to remove.IGraph.addDisplaysInvalidatedListener(IEventHandler)public final void removeEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
IGraphEdgeCreated event that occurs when an edge has been created.
This event is intended to provide notification of low level changes in the graph structure. Please use the EdgeCreated
event if you are interested only in edge creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the edge creation that has triggered this event.
removeEdgeCreatedListener in interface IGraphedgeCreatedEvent - The listener to remove.IGraph.createEdge(IPort, IPort, IEdgeStyle, Object),
CreateEdgeInputMode.addEdgeCreatedListener(IEventHandler),
IGraph.addEdgeCreatedListener(IEventHandler)public final void removeEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
IGraphEdgePortsChanged event that occurs when an edge had its SourcePort
or TargetPort changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeEdgePortsChangedListener in interface IGraphedgePortsChangedEvent - The listener to remove.IGraph.setEdgePorts(IEdge, IPort, IPort),
IGraph.addEdgePortsChangedListener(IEventHandler)public final void removeEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
IGraphEdgeRemoved event that occurs when an edge has been removed.
This event will be triggered, too, prior to a node removal.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in edge removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the edge removal that has triggered this event.
removeEdgeRemovedListener in interface IGraphedgeRemovedEvent - The listener to remove.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.addEdgeRemovedListener(IEventHandler)public final void removeEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
IGraphEdgeStyleChanged event that occurs when an edge style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeEdgeStyleChangedListener in interface IGraphedgeStyleChangedEvent - The listener to remove.IGraph.setStyle(IEdge, IEdgeStyle),
IGraph.addEdgeStyleChangedListener(IEventHandler)public final void removeEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
IGraphEdgeTagChanged event that occurs when the tag of
an edge has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeEdgeTagChangedListener in interface IGraphedgeTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addEdgeTagChangedListener(IEventHandler)public final void removeGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
IGraphGraphTagChanged event that occurs when the tag of
the graph has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeGraphTagChangedListener in interface IGraphgraphTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addGraphTagChangedListener(IEventHandler)public final void removeIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
IGraphIsGroupNodeChanged
event.
removeIsGroupNodeChangedListener in interface IGraphisGroupNodeChangedEvent - The listener to remove.IGraph.addIsGroupNodeChangedListener(IEventHandler)public final void removeLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
IGraphLabelAdded event that occurs when a label has been added to this graph
instance.
This event is intended to provide notification of low level changes in the graph structure. Please use the LabelAdded
event if you are interested only in label creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the label creation that has triggered this event.
removeLabelAddedListener in interface IGraphlabelAddedEvent - The listener to remove.IGraph.addLabel(ILabelOwner, String, ILabelModelParameter, ILabelStyle, SizeD, Object),
GraphEditorInputMode.addLabelAddedListener(IEventHandler),
IGraph.addLabelAddedListener(IEventHandler)public final void removeLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
IGraphLabelLayoutParameterChanged event that occurs when the model parameter of a
label has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeLabelLayoutParameterChangedListener in interface IGraphlabelLayoutParameterChangedEvent - The listener to remove.IGraph.setLabelLayoutParameter(ILabel, ILabelModelParameter),
IGraph.addLabelLayoutParameterChangedListener(IEventHandler)public final void removeLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
IGraphLabelPreferredSizeChanged event that occurs when the preferred size of a
label has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeLabelPreferredSizeChangedListener in interface IGraphlabelPreferredSizeChangedEvent - The listener to remove.IGraph.setLabelPreferredSize(ILabel, SizeD),
IGraph.addLabelPreferredSizeChangedListener(IEventHandler)public final void removeLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
IGraphLabelRemoved event that occurs when a label has been removed from this graph
instance.
This event will also be triggered, prior to the removal of the owner of the label.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in label removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the label removal that has triggered this event.
removeLabelRemovedListener in interface IGraphlabelRemovedEvent - The listener to remove.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
GraphEditorInputMode.addLabelTextChangedListener(IEventHandler),
IGraph.addLabelRemovedListener(IEventHandler)public final void removeLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
IGraphLabelStyleChanged event that occurs when a label style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeLabelStyleChangedListener in interface IGraphlabelStyleChangedEvent - The listener to remove.IGraph.setStyle(ILabel, ILabelStyle),
IGraph.addLabelStyleChangedListener(IEventHandler)public final void removeLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
IGraphLabelTagChanged event that occurs when the tag of
a label has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeLabelTagChangedListener in interface IGraphlabelTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addLabelTagChangedListener(IEventHandler)public final void removeLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
IGraphLabelTextChanged event that occurs when the text of a label has been
changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeLabelTextChangedListener in interface IGraphlabelTextChangedEvent - The listener to remove.IGraph.setLabelText(ILabel, String),
IGraph.addLabelTextChangedListener(IEventHandler)public void removeLookup(IContextLookupChainLink lookup)
this.lookup - The element to remove.public final void removeNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
IGraphNodeCreated event that occurs when a node has been created.
This event is intended to provide notification of low level changes in the graph structure. Please use the NodeCreated
event if you are interested only in node creation events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the node creation that has triggered this event.
removeNodeCreatedListener in interface IGraphnodeCreatedEvent - The listener to remove.IGraph.createNode(RectD, INodeStyle, Object),
IGraph.createNode(INode, RectD, INodeStyle, Object),
IGraph.createGroupNode(INode, RectD, INodeStyle, Object),
GraphEditorInputMode.addNodeCreatedListener(IEventHandler),
IGraph.addNodeCreatedListener(IEventHandler)public final void removeNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
IGraphNodeLayoutChanged event that occurs when a node layout has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeNodeLayoutChangedListener in interface IGraphnodeLayoutChangedEvent - The listener to remove.IGraph.addNodeLayoutChangedListener(INodeLayoutChangedHandler)public final void removeNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
IGraphNodeRemoved event that occurs when a node has been removed.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in node removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the node removal that has triggered this event.
removeNodeRemovedListener in interface IGraphnodeRemovedEvent - The listener to remove.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.addNodeRemovedListener(IEventHandler)public final void removeNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
IGraphNodeStyleChanged event that occurs when a node style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeNodeStyleChangedListener in interface IGraphnodeStyleChangedEvent - The listener to remove.IGraph.setStyle(INode, INodeStyle),
IGraph.addNodeStyleChangedListener(IEventHandler)public final void removeNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
IGraphNodeTagChanged event that occurs when the tag of a
node has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removeNodeTagChangedListener in interface IGraphnodeTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addNodeTagChangedListener(IEventHandler)public final void removeParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
IGraphParentChanged
event.
removeParentChangedListener in interface IGraphparentChangedEvent - The listener to remove.IGraph.addParentChangedListener(IEventHandler)public final void removePortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
IGraphPortAdded event that occurs when a port has been added to this graph
instance.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo the port creation that has triggered this event.
removePortAddedListener in interface IGraphportAddedEvent - The listener to remove.IGraph.addPort(IPortOwner, IPortLocationModelParameter, IPortStyle, Object),
IGraph.createEdge(INode, INode, IEdgeStyle, Object),
IGraph.addPortAddedListener(IEventHandler)public final void removePortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
IGraphPortLocationParameterChanged event that occurs when the location model
parameter of a port has been changed.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removePortLocationParameterChangedListener in interface IGraphportLocationParameterChangedEvent - The listener to remove.IGraph.setPortLocationParameter(IPort, IPortLocationModelParameter),
IGraph.addPortLocationParameterChangedListener(IEventHandler)public final void removePortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
IGraphPortRemoved event that occurs when a port has been removed from its
owner.
This event will also be triggered prior to the removal of the corresponding owner of the port.
This event is intended to provide notification of low level changes in the graph structure. Please use the DeletedItem
event if you are interested only in port removal events that result from user interaction.
Note:You may not modify the graph in the event handler for this event. Especially you may not prevent/undo
the port removal that has triggered this event.
removePortRemovedListener in interface IGraphportRemovedEvent - The listener to remove.IGraph.remove(IModelItem),
GraphEditorInputMode.addDeletedItemListener(IEventHandler),
IGraph.addPortRemovedListener(IEventHandler)public final void removePortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
IGraphPortStyleChanged event that occurs when a port style has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removePortStyleChangedListener in interface IGraphportStyleChangedEvent - The listener to remove.IGraph.setStyle(IPort, IPortStyle),
IGraph.addPortStyleChangedListener(IEventHandler)public final void removePortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
IGraphPortTagChanged event that occurs when the tag of a
port has been replaced.
This event is intended to provide notification of low level changes in the graph structure. Note:You may not modify the graph in the event handler for this event.
removePortTagChangedListener in interface IGraphportTagChangedEvent - The listener to remove.ITagOwner.getTag(),
IGraph.addPortTagChangedListener(IEventHandler)public void setBendLocation(IBend bend, PointD location)
This implementation will also trigger an invalidateDisplays() call.
setBendLocation in interface IGraphbend - the bend whose location is to be modifiedlocation - the new coordinates of the bendaddBend(IEdge, PointD, int)public final void setEdgeDefaults(IEdgeDefaults value)
IGraphThe settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
setEdgeDefaults in interface IGraphvalue - The EdgeDefaults to set.IGraph.getEdgeDefaults()public void setEdgePorts(IEdge edge, IPort sourcePort, IPort targetPort)
This will trigger an EdgePortsChanged event if source or target
ports differ from the current ones. Both ports and the edge must belong to the current graph instance. If AutoCleanupEnabled
is enabled, this method will remove unoccupied ports after they have been changed.
setEdgePorts in interface IGraphedge - The edge to change the ports.sourcePort - The new source port instance.targetPort - The new target port instance.public final void setGroupNodeDefaults(INodeDefaults value)
IGraphsetGroupNodeDefaults in interface IGraphvalue - The GroupNodeDefaults to set.IGraph.getGroupNodeDefaults()public final void setIsGroupNode(INode node, boolean isGroupNode)
IGraph
Group nodes may have children but do not necessarily need to have one. Attempting to set a
node to the non-group-node-status while it has children at the same time will result in an
IllegalStateException.
setIsGroupNode in interface IGraphnode - The node to set the group node status for.isGroupNode - Whether to make the node a group node.IGraph.getChildren(INode),
IGraph.isGroupNode(INode)public void setLabelLayoutParameter(ILabel label, ILabelModelParameter layoutParameter)
IGraphsetLabelLayoutParameter in interface IGraphlabel - The label.layoutParameter - The new parameter.public void setLabelPreferredSize(ILabel label, SizeD size)
IGraphsetLabelPreferredSize in interface IGraphlabel - The label.size - The new preferred size.ILabel.getPreferredSize()public void setLabelText(ILabel label, String text)
This implementation will adjust the preferred size for the label if AutoAdjustingPreferredSizeEnabled
is enabled.
setLabelText in interface IGraphlabel - the label to modifytext - the new text of the labelILabel.getText()protected void setLookupImplementation(ILookup lookup)
lookup(Class) calls.
A value of null will revert to the default behavior.
lookup - The lookup instance to delegate lookup calls to.addLookup(IContextLookupChainLink),
getLookup()public final void setMapperRegistry(IMapperRegistry value)
The registry can be used to store data mappings for the items in this instance. This field is populated upon first access. Also this property provides write access.
IMapperRegistry,
IModelItem,
ITagOwner.getTag(),
getMapperRegistry()public final void setNodeDefaults(INodeDefaults value)
IGraphThe settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
setNodeDefaults in interface IGraphvalue - The NodeDefaults to set.IGraph.getNodeDefaults()public void setNodeLayout(INode node, RectD layout)
This will trigger a call to invalidateDisplays().
setNodeLayout in interface IGraphnode - a live node that belongs to this graphlayout - the new absolute layout in world coordinates of the nodeINode.getLayout()public final void setParent(INode node, INode parent)
IGraph
Use null as parent to make node a top-level node for this graph.
setParent in interface IGraphnode - The node to assign a new parent.parent - The parent group node to assign to node or null to make node a top-level node.IGraph.getParent(INode)public void setPortLocationParameter(IPort port, IPortLocationModelParameter locationParameter)
IGraphIPortLocationModelParameter for the given port.setPortLocationParameter in interface IGraphport - The port to modifylocationParameter - the new parameter that determines the coordinates of the portpublic void setStyle(IEdge edge, IEdgeStyle style)
IGraphStyle instances can be shared.
setStyle in interface IGraphedge - The edge that will be assigned the new stylestyle - The style instance that will be assigned to the edge.IEdge.getStyle(),
IGraph.addEdgeStyleChangedListener(IEventHandler),
VoidEdgeStyle.INSTANCEpublic void setStyle(ILabel label, ILabelStyle style)
This implementation will adjust the preferred size for the label if AutoAdjustingPreferredSizeEnabled
is enabled.
setStyle in interface IGraphlabel - The label that will be assigned the new stylestyle - The style instance that will be assigned to the label.ILabel.getStyle(),
onChangingLabelStyle(ILabel, ILabelStyle),
addLabelStyleChangedListener(IEventHandler)public void setStyle(INode node, INodeStyle style)
Style instances can be shared.
setStyle in interface IGraphnode - The node that will be assigned the new stylestyle - The style instance that will be assigned to the node.INode.getStyle(),
onChangingNodeStyle(INode, INodeStyle),
addNodeStyleChangedListener(IEventHandler)public void setStyle(IPort port, IPortStyle style)
IGraphStyle instances can be shared.
setStyle in interface IGraphport - The port that will be assigned the new stylestyle - The style instance that will be assigned to the port.IPort.getStyle(),
IGraph.addPortStyleChangedListener(IEventHandler),
VoidPortStyle.INSTANCEpublic final void setTag(Object value)
ITagOwnerThe implementation itself does not normally depend on the tag associated with it. It serves as storage for the object only.
setTag in interface ITagOwnervalue - The user object associated with this instance.ITagOwner.getTag()public void setUndoEngineEnabled(boolean value)
UndoEngine used for this instance should be enabled.
The default is false. In order to enable undoability for this instance, set this property to true and lookup(Class)
the UndoEngine type. Disabling this property clears and removes the current UndoEngine (and all enqueued
IUndoUnits).
setUndoEngineEnabled in interface IGraphvalue - The UndoEngineEnabled to set.isUndoEngineEnabled()