public interface IGraph extends ILookup, ITagOwner
canvas
or
GraphControl
.
This interface can be used to query structural information, it also offers methods that change the structure of the graph and its attributes. A number of events will trigger appropriate events if the structure of the graph changes.
The graph is made up of collections of nodes
and edges
. Each node and edge can be associated
with a number of labels
and possibly ports
to which edges connect. An edge connects to two
ports and may consist of zero or more bends
. The graph is treated as a directed graph, i.e. edges have a source port
and a
target port
. It is up to the algorithms and the visualization to possibly treat them
as undirected.
This interface also provides support for hierarchically organized, i.e. grouped graphs. This means that nodes together
with their connecting edges can be put into
other nodes. The containing node is
referred to as a "group node." To create and edit group nodes interactively use the GraphEditorInputMode
as input mode and enable the
grouping operations
.
The edgesAt(IPort, AdjacencyTypes)
and edgesAt(IPortOwner, AdjacencyTypes)
methods can be used to
query adjacency information from the graph's structure.
Each element in the graph can be associated with a style that is used for the visualization of the element. Styles can be shared between multiple instances.
To associate data with the elements in the graph, code can make use of the Tag
property that
all IModelItem
s provide. In order to associate more than one data element with the graph items, compound data
objects can be used. Alternatively the IMapperRegistry
that can be obtained from the MapperRegistry
property can be used to associate arbitrary data sets with the items in this graph.
This interface contains core methods that may use complicated argument lists. GraphExtensions
is a static
utility class that contains extension methods for this interface
that improve the usability of this interface dramatically.
This interface provides a number of events that can be used to get notified for changes in the graph structure. These
events are raised whenever the corresponding state change occurs, e.g. also when loading the graph from a file. If you
are only interested in changes that are triggered interactively, you should subscribe to the corresponding events on the
IInputMode
implementations that implement the user interaction. Especially, you
may not modify the graph structure in handlers for these event, e.g. try to prevent or undo the change that has raised
the event.
The graph model with all relevant types and their relationships is presented in detail in the section The Graph Model.
More information on visual styles can be found in the section Visualization of Graph Elements.
DefaultGraph
,
INode
,
IEdge
,
IPort
,
ILabel
,
IBend
,
GraphExtensions
,
IMapperRegistry
Modifier and Type | Method and Description |
---|---|
default IBend |
addBend(IEdge edge,
PointD location)
Adds a bend at the given index to the given edge using the coordinates provided.
|
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. |
default void |
addBends(IEdge edge,
Iterable<PointD> locations)
Adds bends with the given locations to the end of the bend list of the given edge.
|
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. |
default ILabel |
addLabel(ILabelOwner owner,
String text)
Add a label to the given item using the text as the initial label text and label model parameter, style and tag.
|
default ILabel |
addLabel(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter)
Add a label to the given item using the text as the initial label text and label model parameter, style and tag.
|
default ILabel |
addLabel(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style)
Add a label to the given item using the text as the initial label text and label model parameter, style and tag.
|
default ILabel |
addLabel(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style,
SizeD preferredSize)
Add a label to the given item using the text as the initial label text and label model parameter, style and tag.
|
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 |
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. |
default IPort |
addPort(IPortOwner owner)
Add a port to the given port owner using the location model parameter, style and tag.
|
default IPort |
addPort(IPortOwner owner,
IPortLocationModelParameter locationParameter)
Add a port to the given port owner using the location model parameter, style and tag.
|
default IPort |
addPort(IPortOwner owner,
IPortLocationModelParameter locationParameter,
IPortStyle style)
Add a port to the given port owner using the location model parameter, style and tag.
|
IPort |
addPort(IPortOwner owner,
IPortLocationModelParameter locationParameter,
IPortStyle style,
Object tag)
Add a port to the given port owner using the location model parameter, style and tag.
|
default IPort |
addPort(IPortOwner owner,
PointD location)
Add a port to the given port owner using the absolute coordinates as the new initial position of the port anchor.
|
default IPort |
addPort(IPortOwner owner,
PointD location,
IPortStyle style)
Add a port to the given port owner using the absolute coordinates as the new initial position of the port anchor.
|
default IPort |
addPort(IPortOwner owner,
PointD location,
IPortStyle style,
Object tag)
Add a port to the given port owner using the absolute 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. |
default IPort |
addRelativePort(INode node,
PointD relativeLocation)
Adds a new port to the graph at the node using a location that is relative to the center of the node.
|
default void |
addUndoUnit(String undoName,
String redoName,
Runnable undo,
Runnable redo)
|
default void |
adjustGroupNodeLayout(INode groupNode)
Method to adjust the size of a group node.
|
default void |
adjustLabelPreferredSize(ILabel label)
Adjusts the
PreferredSize property of a label to fit the suggested size of its
ILabelStyleRenderer . |
default void |
applyLayout(ILayoutAlgorithm layout)
Convenience method that runs a layout on a graph using
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData) . |
default void |
applyLayout(ILayoutAlgorithm layout,
LayoutData layoutData)
Convenience method that runs a layout on a graph using
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData) . |
default ICompoundEdit |
beginEdit(String undoName,
String redoName)
Starts an
ICompoundEdit that records graph changes and custom undo units
in a single compound unit. |
default <T> ICompoundEdit |
beginEdit(String undoName,
String redoName,
Iterable<T> items)
Starts an
ICompoundEdit that uses the memento design pattern to
record changes to the items in the given items collection. |
default <T> ICompoundEdit |
beginEdit(String undoName,
String redoName,
Iterable<T> items,
IMementoSupportProvider<T> provider)
Starts an
ICompoundEdit that uses the memento design pattern to
record changes to the items in the given items collection. |
default SizeD |
calculateLabelPreferredSize(ILabelOwner owner,
String text)
Calculates the preferred size of a label with the given properties.
|
default SizeD |
calculateLabelPreferredSize(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter)
Calculates the preferred size of a label with the given properties.
|
default SizeD |
calculateLabelPreferredSize(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style)
Calculates the preferred size of a label with the given properties.
|
default SizeD |
calculateLabelPreferredSize(ILabelOwner owner,
String text,
ILabelModelParameter layoutParameter,
ILabelStyle style,
Object tag)
Calculates the preferred size of a label with the given properties.
|
default void |
clear()
Clears the graph instance, removing all entities in proper order.
|
default void |
clearBends(IEdge edge)
Removes all bends from the given edge.
|
boolean |
contains(IModelItem item)
Determines whether this graph contains the specified item.
|
default ILabelModelParameter |
createDefaultLabelLayoutParameter(ILabelOwner owner)
Creates the label layout parameter for a given
ILabelOwner . |
default IPortLocationModelParameter |
createDefaultPortLocationParameter(IPortOwner owner)
Creates a location model parameter for a newly created
IPort at the owner that matches the
location . |
default IPortLocationModelParameter |
createDefaultPortLocationParameter(IPortOwner owner,
PointD location)
Creates a location model parameter for a newly created
IPort at the owner that matches the
location . |
default IEdge |
createEdge(INode source,
INode target)
Convenience method that creates and returns an edge that connects to the given node instances using the given style
instance.
|
default IEdge |
createEdge(INode source,
INode target,
IEdgeStyle style)
Convenience method that creates and returns an edge that connects to the given node instances using the given style
instance.
|
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.
|
default IEdge |
createEdge(IPort sourcePort,
IPort targetPort)
Creates and returns an edge that connects to the given port instances.
|
default IEdge |
createEdge(IPort sourcePort,
IPort targetPort,
IEdgeStyle style)
Creates and returns an edge that connects to the given port instances.
|
IEdge |
createEdge(IPort sourcePort,
IPort targetPort,
IEdgeStyle style,
Object tag)
Creates and returns an edge that connects to the given port instances.
|
default INode |
createGroupNode()
Creates a new group node using the provided style and layout as a child of
parent . |
default INode |
createGroupNode(INode parent)
Creates a new group node using the provided style and layout as a child of
parent . |
default INode |
createGroupNode(INode parent,
RectD layout)
Creates a new group node using the provided style and layout as a child of
parent . |
default INode |
createGroupNode(INode parent,
RectD layout,
INodeStyle style)
Creates a new group node using the provided style and layout as a child of
parent . |
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 . |
default INode |
createNode()
Creates a new ordinary node as a direct descendant of
parent using the given layout and style. |
default INode |
createNode(INode parent)
Creates a new ordinary node as a direct descendant of
parent using the given layout and style. |
default INode |
createNode(INode parent,
RectD layout)
Creates a new ordinary node as a direct descendant of
parent using the given layout and style. |
default INode |
createNode(INode parent,
RectD layout,
INodeStyle style)
Creates a new ordinary node as a direct descendant of
parent using the given layout and style. |
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. |
default INode |
createNode(PointD location)
Creates and returns a node using the specified initial center location and style, as well as the tag.
|
default INode |
createNode(PointD location,
INodeStyle style)
Creates and returns a node using the specified initial center location and style, as well as the tag.
|
default INode |
createNode(PointD location,
INodeStyle style,
Object tag)
Creates and returns a node using the specified initial center location and style, as well as the tag.
|
default INode |
createNode(RectD layout)
Creates and returns a node using the specified values for the initial geometry, style, and
Tag . |
default INode |
createNode(RectD layout,
INodeStyle style)
Creates and returns a node using the specified values for the initial geometry, style, and
Tag . |
INode |
createNode(RectD layout,
INodeStyle style,
Object tag)
Creates and returns a node using the specified values for the initial geometry, style, and
Tag . |
default int |
degree(IPort port)
Calculates the number of edges at the given
IPort for this graph. |
default int |
degree(IPortOwner owner)
Calculates the number of edges at the given
IPortOwner for this graph. |
default IListEnumerable<IEdge> |
edgesAt(IPort port)
Convenience method that yields all adjacent edges at 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 . |
default IListEnumerable<IEdge> |
edgesAt(IPortOwner owner)
Convenience method that yields all adjacent edges at the given owner.
|
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 . |
default IListEnumerable<IBend> |
getBends()
Gets a live view of all bends contained in this
IGraph . |
IListEnumerable<INode> |
getChildren(INode node)
Returns an enumerable over the children of the provided node.
|
default GraphDecorator |
getDecorator()
Gets a
GraphDecorator instance for use with the given graph. |
default RectD |
getDefaultNodeBounds()
Gets the default node bounds for newly created nodes in the graph.
|
default IEdge |
getEdge(IPort sourcePort,
IPort targetPort)
Finds an edge that connects
sourcePort and targetPort in the given graph. |
default IEdge |
getEdge(IPortOwner from,
IPortOwner to)
Finds an edge that connects
from and to in the given graph. |
IEdgeDefaults |
getEdgeDefaults()
Gets the defaults for normal edges.
|
default IListEnumerable<ILabel> |
getEdgeLabels()
Gets a live view of all edge labels contained in this
IGraph . |
IListEnumerable<IEdge> |
getEdges()
A view of the edges contained in this graph.
|
default IFoldingView |
getFoldingView()
|
default GroupingSupport |
getGroupingSupport()
Creates a
GroupingSupport instance for the graph. |
INodeDefaults |
getGroupNodeDefaults()
Gets the defaults for group nodes.
|
default ILabelDefaults |
getLabelDefaults(ILabelOwner owner)
|
IListEnumerable<ILabel> |
getLabels()
A view of the node and edge labels contained in this graph.
|
IMapperRegistry |
getMapperRegistry()
Gets the mapper registry that is associated with this graph instance.
|
INodeDefaults |
getNodeDefaults()
Gets the defaults for normal nodes.
|
default IListEnumerable<ILabel> |
getNodeLabels()
Gets a live view of all node labels contained in this
IGraph . |
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. |
default IPortDefaults |
getPortDefaults(IPortOwner owner)
|
IListEnumerable<IPort> |
getPorts()
A view of the ports contained in this graph.
|
default UndoEngine |
getUndoEngine()
|
default INode |
groupNodes(INode... children)
Groups the nodes into a newly created group node.
|
default void |
groupNodes(INode parent,
Iterable<INode> children)
Groups the nodes in
children into the provided group node. |
default INode |
groupNodes(Iterable<INode> children)
Groups the nodes in
children into a newly created group node. |
default int |
inDegree(IPort port)
Calculates the number of incoming edges at the given
IPort for this graph. |
default int |
inDegree(IPortOwner owner)
Calculates the number of incoming edges at the given
IPortOwner for this graph. |
default IListEnumerable<IEdge> |
inEdgesAt(IPort port)
Convenience method that yields the incoming edges at the given port.
|
default IListEnumerable<IEdge> |
inEdgesAt(IPortOwner owner)
Convenience method that yields the incoming edges at the given owner.
|
void |
invalidateDisplays()
Causes the
DisplaysInvalidated event to be triggered. |
boolean |
isGroupNode(INode node)
Returns whether the given node is considered a group node.
|
default boolean |
isUndoEngineEnabled()
Convenience method to check whether undo capabilities are enabled for this instance.
|
default <T extends IPortOwner> |
neighbors(Class<T> tType,
T portOwner)
Enumerates the neighbors of a given
IPortOwner . |
default int |
outDegree(IPort port)
Calculates the number of outgoing edges at the given
IPort for this graph. |
default int |
outDegree(IPortOwner owner)
Calculates the number of outgoing edges at the given
IPortOwner for this graph. |
default IListEnumerable<IEdge> |
outEdgesAt(IPort port)
Convenience method that yields the outgoing edges at the given port.
|
default IListEnumerable<IEdge> |
outEdgesAt(IPortOwner owner)
Convenience method that yields the outgoing edges at the given owner.
|
default <T extends IPortOwner> |
predecessors(Class<T> tType,
T portOwner)
Enumerates the predecessors of a given
IPortOwner . |
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 |
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. |
default void |
reverse(IEdge edge)
|
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 preferredSize)
Sets the preferred size of the label.
|
void |
setLabelText(ILabel label,
String text)
Sets the label text of the given label.
|
default void |
setNodeCenter(INode node,
PointD center)
Sets the center of a node to the given world coordinates.
|
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 value.
|
void |
setParent(INode node,
INode parent)
Sets the parent node for a given node.
|
default void |
setPortLocation(IPort port,
PointD location)
Convenience method that tries to set the absolute coordinates of the given port to the given values.
|
void |
setPortLocationParameter(IPort port,
IPortLocationModelParameter locationParameter)
Sets a new
IPortLocationModelParameter for the given port. |
default void |
setRelativePortLocation(IPort port,
PointD relativeLocation)
|
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.
|
default void |
setUndoEngineEnabled(boolean enabled)
Convenience method that enables or disables undo capabilities for this instance.
|
default <T extends IPortOwner> |
successors(Class<T> tType,
T portOwner)
Enumerates the successors of a given
IPortOwner . |
createDictionaryLookup, createDynamic, createSingle, createSingle, createWrapped, lookup, lookup, lookup, safeLookup
default IBend addBend(IEdge edge, PointD location)
The added instance will be returned.
edge
- The edge to which the bend will be added.location
- the coordinates to use for the newly created bendremove(IModelItem)
,
setBendLocation(IBend, PointD)
IBend addBend(IEdge edge, PointD location, int index)
The added instance will be returned.
edge
- 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.remove(IModelItem)
,
setBendLocation(IBend, PointD)
void addBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
BendAdded
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.
bendAddedEvent
- The listener to add.addBend(IEdge, PointD, int)
,
CreateBendInputMode.addBendCreatedListener(IEventHandler)
,
removeBendAddedListener(IEventHandler)
void addBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
BendLocationChanged
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.
bendLocationChangedEvent
- The listener to add.setBendLocation(IBend, PointD)
,
removeBendLocationChangedListener(IBendLocationChangedHandler)
void addBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
BendRemoved
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.
bendRemovedEvent
- The listener to add.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
removeBendRemovedListener(IEventHandler)
default void addBends(IEdge edge, Iterable<PointD> locations)
edge
- The edge to add the bends to.locations
- The locations of the bends.void addBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
BendTagChanged
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.
bendTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removeBendTagChangedListener(IEventHandler)
void addDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
DisplaysInvalidated
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.
displaysInvalidatedEvent
- The listener to add.removeDisplaysInvalidatedListener(IEventHandler)
void addEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
EdgeCreated
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.
edgeCreatedEvent
- The listener to add.createEdge(IPort, IPort, IEdgeStyle, Object)
,
CreateEdgeInputMode.addEdgeCreatedListener(IEventHandler)
,
removeEdgeCreatedListener(IEventHandler)
void addEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
EdgePortsChanged
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.
edgePortsChangedEvent
- The listener to add.setEdgePorts(IEdge, IPort, IPort)
,
removeEdgePortsChangedListener(IEventHandler)
void addEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
EdgeRemoved
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.
edgeRemovedEvent
- The listener to add.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
removeEdgeRemovedListener(IEventHandler)
void addEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
EdgeStyleChanged
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.
edgeStyleChangedEvent
- The listener to add.setStyle(IEdge, IEdgeStyle)
,
removeEdgeStyleChangedListener(IEventHandler)
void addEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
EdgeTagChanged
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.
edgeTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removeEdgeTagChangedListener(IEventHandler)
void addGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
GraphTagChanged
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.
graphTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removeGraphTagChangedListener(IEventHandler)
void addIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
IsGroupNodeChanged
event.
isGroupNodeChangedEvent
- The listener to add.removeIsGroupNodeChangedListener(IEventHandler)
default ILabel addLabel(ILabelOwner owner, String text)
owner
- the item to add the label to.text
- the initial text of the labeladdLabelAddedListener(IEventHandler)
,
setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
,
VoidLabelStyle.INSTANCE
default ILabel addLabel(ILabelOwner owner, String text, ILabelModelParameter layoutParameter)
owner
- the item to add the label to.text
- the initial text of the labellayoutParameter
- The label model parameter instance to use.addLabelAddedListener(IEventHandler)
,
setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
,
VoidLabelStyle.INSTANCE
default ILabel addLabel(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style)
owner
- 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 labeladdLabelAddedListener(IEventHandler)
,
setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
,
VoidLabelStyle.INSTANCE
default ILabel addLabel(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, SizeD preferredSize)
owner
- 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
.addLabelAddedListener(IEventHandler)
,
setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
,
VoidLabelStyle.INSTANCE
ILabel addLabel(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, SizeD preferredSize, Object tag)
owner
- 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.addLabelAddedListener(IEventHandler)
,
setLabelText(ILabel, String)
,
setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
setStyle(ILabel, ILabelStyle)
,
VoidLabelStyle.INSTANCE
void addLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
LabelAdded
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.
labelAddedEvent
- The listener to add.addLabel(ILabelOwner, String, ILabelModelParameter, ILabelStyle, SizeD, Object)
,
GraphEditorInputMode.addLabelAddedListener(IEventHandler)
,
removeLabelAddedListener(IEventHandler)
void addLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
LabelLayoutParameterChanged
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.
labelLayoutParameterChangedEvent
- The listener to add.setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
removeLabelLayoutParameterChangedListener(IEventHandler)
void addLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
LabelPreferredSizeChanged
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.
labelPreferredSizeChangedEvent
- The listener to add.setLabelPreferredSize(ILabel, SizeD)
,
removeLabelPreferredSizeChangedListener(IEventHandler)
void addLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
LabelRemoved
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.
labelRemovedEvent
- The listener to add.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
GraphEditorInputMode.addLabelTextChangedListener(IEventHandler)
,
removeLabelRemovedListener(IEventHandler)
void addLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
LabelStyleChanged
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.
labelStyleChangedEvent
- The listener to add.setStyle(ILabel, ILabelStyle)
,
removeLabelStyleChangedListener(IEventHandler)
void addLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
LabelTagChanged
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.
labelTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removeLabelTagChangedListener(IEventHandler)
void addLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
LabelTextChanged
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.
labelTextChangedEvent
- The listener to add.setLabelText(ILabel, String)
,
removeLabelTextChangedListener(IEventHandler)
void addNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
NodeCreated
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.
nodeCreatedEvent
- The listener to add.createNode(RectD, INodeStyle, Object)
,
createNode(INode, RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
,
GraphEditorInputMode.addNodeCreatedListener(IEventHandler)
,
removeNodeCreatedListener(IEventHandler)
void addNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
NodeLayoutChanged
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.
nodeLayoutChangedEvent
- The listener to add.removeNodeLayoutChangedListener(INodeLayoutChangedHandler)
void addNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
NodeRemoved
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.
nodeRemovedEvent
- The listener to add.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
removeNodeRemovedListener(IEventHandler)
void addNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
NodeStyleChanged
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.
nodeStyleChangedEvent
- The listener to add.setStyle(INode, INodeStyle)
,
removeNodeStyleChangedListener(IEventHandler)
void addNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
NodeTagChanged
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.
nodeTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removeNodeTagChangedListener(IEventHandler)
void addParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
ParentChanged
event.
parentChangedEvent
- The listener to add.removeParentChangedListener(IEventHandler)
default IPort addPort(IPortOwner owner)
The locationParameter
determines the location of the port.
Depending on the implementation this method may throw an UnsupportedOperationException
if the type of
the owner
instance does not support adding of ports.
UnsupportedOperationException
- If this instance cannot add a port to owner
.owner
- the owner to add the port instance to.addPortAddedListener(IEventHandler)
,
VoidPortStyle.INSTANCE
default IPort addPort(IPortOwner owner, IPortLocationModelParameter locationParameter)
The locationParameter
determines the location of the port.
Depending on the implementation this method may throw an UnsupportedOperationException
if the type of
the owner
instance does not support adding of ports.
UnsupportedOperationException
- 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.addPortAddedListener(IEventHandler)
,
VoidPortStyle.INSTANCE
default IPort addPort(IPortOwner owner, IPortLocationModelParameter locationParameter, IPortStyle style)
The locationParameter
determines the location of the port.
Depending on the implementation this method may throw an UnsupportedOperationException
if the type of
the owner
instance does not support adding of ports.
UnsupportedOperationException
- 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 initially assign to the Style
property, e.g.
VoidPortStyle.INSTANCE
.addPortAddedListener(IEventHandler)
,
VoidPortStyle.INSTANCE
IPort addPort(IPortOwner owner, IPortLocationModelParameter locationParameter, IPortStyle style, Object tag)
The locationParameter
determines the location of the port.
Depending on the implementation this method may throw an UnsupportedOperationException
if the type of
the owner
instance does not support adding of ports.
UnsupportedOperationException
- 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 initially assign to the Style
property, e.g.
VoidPortStyle.INSTANCE
.tag
- the initial Tag
to assign.addPortAddedListener(IEventHandler)
,
VoidPortStyle.INSTANCE
default IPort addPort(IPortOwner owner, PointD location)
UnsupportedOperationException
- If this instance cannot add a port to owner
.owner
- the owner to add the port instance to.location
- the location to use for the port to determine its location. This is passed to the createDefaultPortLocationParameter(IPortOwner, PointD)
method to determine the initial IPortLocationModelParameter
to use.default IPort addPort(IPortOwner owner, PointD location, IPortStyle style)
UnsupportedOperationException
- If this instance cannot add a port to owner
.owner
- the owner to add the port instance to.location
- the location to use for the port to determine its location. This is passed to the createDefaultPortLocationParameter(IPortOwner, PointD)
method to determine the initial IPortLocationModelParameter
to use.style
- the style to initially assign to the Style
property, e.g.
VoidPortStyle.INSTANCE
.default IPort addPort(IPortOwner owner, PointD location, IPortStyle style, Object tag)
UnsupportedOperationException
- If this instance cannot add a port to owner
.owner
- the owner to add the port instance to.location
- the location to use for the port to determine its location. This is passed to the createDefaultPortLocationParameter(IPortOwner, PointD)
method to determine the initial IPortLocationModelParameter
to use.style
- the style to initially assign to the Style
property, e.g.
VoidPortStyle.INSTANCE
.tag
- the initial Tag
to assign.void addPortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
PortAdded
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.
portAddedEvent
- The listener to add.addPort(IPortOwner, IPortLocationModelParameter, IPortStyle, Object)
,
createEdge(INode, INode, IEdgeStyle, Object)
,
removePortAddedListener(IEventHandler)
void addPortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
PortLocationParameterChanged
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.
portLocationParameterChangedEvent
- The listener to add.setPortLocationParameter(IPort, IPortLocationModelParameter)
,
removePortLocationParameterChangedListener(IEventHandler)
void addPortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
PortRemoved
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.
portRemovedEvent
- The listener to add.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
removePortRemovedListener(IEventHandler)
void addPortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
PortStyleChanged
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.
portStyleChangedEvent
- The listener to add.setStyle(IPort, IPortStyle)
,
removePortStyleChangedListener(IEventHandler)
void addPortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
PortTagChanged
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.
portTagChangedEvent
- The listener to add.ITagOwner.getTag()
,
removePortTagChangedListener(IEventHandler)
default IPort addRelativePort(INode node, PointD relativeLocation)
The port style for the newly-created port is taken from the graph's defaults. The location parameter is determined by
delegating to addPort(IPortOwner, PointD, IPortStyle, Object)
.
node
- The owner of the port.relativeLocation
- The offset of the port relative to the center of the Layout
.default void addUndoUnit(String undoName, String redoName, Runnable undo, Runnable redo)
undoName
- The name of the undo operation.redoName
- The name of the redo operation.undo
- The undo action.redo
- The redo action.default void adjustGroupNodeLayout(INode groupNode)
This will resize the group node bounds such that the node requires the least amount of space. If the node does not have
any children
, its bounds will be left unchanged. This will also respect any
INodeSizeConstraintProvider
s for INode
s, that are available in the
lookup of the groupNode
.
groupNode
- The group node to adjust the size of.IGroupBoundsCalculator
,
INodeSizeConstraintProvider
,
GroupingSupport.calculateMinimumEnclosedArea(INode)
,
GroupingSupport.enlargeGroupNode(INode, boolean)
,
GroupingSupport.enlargeAllGroupNodes()
default void adjustLabelPreferredSize(ILabel label)
PreferredSize
property of a label to fit the suggested size of its
ILabelStyleRenderer
.
This implementation uses the style's
renderer for the label to determine the preferred
rendering size. This is useful after the label's content or style have been changed.
label
- The label to adjust the size for.ILabelDefaults.isAutoAdjustingPreferredSizeEnabled()
default void applyLayout(ILayoutAlgorithm layout)
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData)
.layout
- The layout.applyLayout(ILayoutAlgorithm, LayoutData)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
default void applyLayout(ILayoutAlgorithm layout, LayoutData layoutData)
LayoutGraphAdapter.applyLayout(IGraph, ILayoutAlgorithm, LayoutData)
.layout
- The layout.layoutData
- The layout data.applyLayout(ILayoutAlgorithm, LayoutData)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, IEventHandler)
,
GraphControl.morphLayout(ILayoutAlgorithm, Duration, LayoutData, IEventHandler)
default ICompoundEdit beginEdit(String undoName, String redoName)
ICompoundEdit
that records graph changes and custom undo units
in a single compound unit.
This method can be used to bracket several undo units. All edits added to the queue after this call and before a call to
ICompoundEdit.cancel()
or ICompoundEdit.commit()
will be placed into the queue as a single block.
Client code needs to make sure that either the ICompoundEdit.cancel()
or ICompoundEdit.commit()
method
is called on the returned instance.
The returned instance implements IDisposable
which enables the use of a using
statement to automatically call the ICompoundEdit.commit()
method after a set of changes:
undoName
- The undo name for the compound edit.redoName
- The redo name for the compound edit.ICompoundEdit.cancel()
or ICompoundEdit.commit()
on it.default <T> ICompoundEdit beginEdit(String undoName, String redoName, Iterable<T> items)
ICompoundEdit
that uses the memento design pattern
to
record changes to the items in the given items
collection.
This method uses the IMementoSupport
returned by the provider
to record the
state of an item at the beginning of the edit and when ICompoundEdit.commit()
is called to create an IUndoUnit
that can revert the item to the recorded state and back. If no provider
is given, this method uses the IMementoSupport
returned by the ILookup.lookup(Class)
implementation of the items to record the state of an item at the
beginning of the edit and when ICompoundEdit.commit()
is called to create an IUndoUnit
that can revert the item to the recorded state and back.
Calling this method will immediately enqueue an IUndoUnit
into the undo queue.
Subsequent additions to the queue will be added after the created instance, even if they are added to the queue before
the ICompoundEdit.commit()
method has been called.
The following is an example implementation of an item that is being managed using
IMementoSupport
:
A collection of items from this type can then be watched using the following code snippet:
Alternatively, when using a specific provider, consider the following examples. The following is an example
implementation of an item that is being managed using IMementoSupport
:
A collection of items from this type can then be watched using the following code snippet, using the provider
to
return an appropriate IMementoSupport
implementation:
Implementing the IMementoSupport
interface is quite unrestrained, the type of the state
returned by IMementoSupport.getState(Object)
method can by anything as long as the IMementoSupport.applyState(Object, Object)
and IMementoSupport.stateEquals(Object, Object)
methods can deal with it:
In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is
efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the
changes or on certain events, you should use custom IUndoUnit
T
- The type of the items that will be modified subsequently.undoName
- The UndoName
of the IUndoUnit
that will be placed into the undo queue after ICompoundEdit.commit()
has been called.redoName
- The RedoName
of the IUndoUnit
that will be placed into the undo queue after ICompoundEdit.commit()
has been called.items
- The items that will be changed after this call and before the call to ICompoundEdit.commit()
.ICompoundEdit
interface whose ICompoundEdit.commit()
or ICompoundEdit.cancel()
methods need to be called after the items have been modified.IMementoSupport
default <T> ICompoundEdit beginEdit(String undoName, String redoName, Iterable<T> items, IMementoSupportProvider<T> provider)
ICompoundEdit
that uses the memento design pattern
to
record changes to the items in the given items
collection.
This method uses the IMementoSupport
returned by the provider
to record the
state of an item at the beginning of the edit and when ICompoundEdit.commit()
is called to create an IUndoUnit
that can revert the item to the recorded state and back. If no provider
is given, this method uses the IMementoSupport
returned by the ILookup.lookup(Class)
implementation of the items to record the state of an item at the
beginning of the edit and when ICompoundEdit.commit()
is called to create an IUndoUnit
that can revert the item to the recorded state and back.
Calling this method will immediately enqueue an IUndoUnit
into the undo queue.
Subsequent additions to the queue will be added after the created instance, even if they are added to the queue before
the ICompoundEdit.commit()
method has been called.
The following is an example implementation of an item that is being managed using
IMementoSupport
:
A collection of items from this type can then be watched using the following code snippet:
Alternatively, when using a specific provider, consider the following examples. The following is an example
implementation of an item that is being managed using IMementoSupport
:
A collection of items from this type can then be watched using the following code snippet, using the provider
to
return an appropriate IMementoSupport
implementation:
Implementing the IMementoSupport
interface is quite unrestrained, the type of the state
returned by IMementoSupport.getState(Object)
method can by anything as long as the IMementoSupport.applyState(Object, Object)
and IMementoSupport.stateEquals(Object, Object)
methods can deal with it:
In summary, use this concept when you want to track the state of items during certain operations for undo/redo. This is
efficient if it's easier to handle an item's state than the changes to the item themselves. If you want to focus on the
changes or on certain events, you should use custom IUndoUnit
T
- The type of the items that will be modified subsequently.undoName
- The UndoName
of the IUndoUnit
that will be placed into the undo queue after ICompoundEdit.commit()
has been called.redoName
- The RedoName
of the IUndoUnit
that will be placed into the undo queue after ICompoundEdit.commit()
has been called.items
- The items that will be changed after this call and before the call to ICompoundEdit.commit()
.provider
- The provider for the IMementoSupport
of the items
. if the provider returns null
for a given item, changes to this item are not being recorded.ICompoundEdit
interface whose ICompoundEdit.commit()
or ICompoundEdit.cancel()
methods need to be called after the items have been modified.IMementoSupport
default SizeD calculateLabelPreferredSize(ILabelOwner owner, String text)
owner
- The item that will own the label.text
- The text.ILabelStyleRenderer
.default SizeD calculateLabelPreferredSize(ILabelOwner owner, String text, ILabelModelParameter layoutParameter)
owner
- The item that will own the label.text
- The text.layoutParameter
- The label model parameter.ILabelStyleRenderer
.default SizeD calculateLabelPreferredSize(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style)
owner
- The item that will own the label.text
- The text.layoutParameter
- The label model parameter.style
- The label style.ILabelStyleRenderer
.default SizeD calculateLabelPreferredSize(ILabelOwner owner, String text, ILabelModelParameter layoutParameter, ILabelStyle style, Object tag)
owner
- The item that will own the label.text
- The text.layoutParameter
- The label model parameter.style
- The label style.tag
- The tag for the label.ILabelStyleRenderer
.default void clear()
remove(IModelItem)
,
remove(IModelItem)
default void clearBends(IEdge edge)
The edge must be part of this graph at the time of the invocation. This will trigger the corresponding events.
edge
- the edge whose bends will be removedremove(IModelItem)
,
addBendRemovedListener(IEventHandler)
boolean contains(IModelItem item)
item
- The item.true
if this graph contains the specified item; otherwise, false
.default ILabelModelParameter createDefaultLabelLayoutParameter(ILabelOwner owner)
ILabelOwner
.
This implementation uses the label defaults
for the graph
to
obtain the parameter instance
.
owner
- The item that is the Owner
of the label in question.ILabelDefaults.getLayoutParameterInstance(ILabelOwner)
,
getLabelDefaults(ILabelOwner)
default IPortLocationModelParameter createDefaultPortLocationParameter(IPortOwner owner)
IPort
at the owner
that matches the
location
.
If location
is null
, this method uses the port defaults
for the owner
to obtain the location parameter
.
owner
- The owner of the port.IPortOwner
as returned by IPortDefaults.getLocationParameterInstance(IPortOwner)
.IPortLocationModel.createParameter(IPortOwner, PointD)
,
getPortDefaults(IPortOwner)
default IPortLocationModelParameter createDefaultPortLocationParameter(IPortOwner owner, PointD location)
IPort
at the owner
that matches the
location
.
If location
is null
, this method uses the port defaults
for the owner
to obtain the location parameter
.
owner
- The owner of the port.location
- The location in the world coordinate system where the port should be added.IPortOwner
as returned by IPortDefaults.getLocationParameterInstance(IPortOwner)
.IPortLocationModel.createParameter(IPortOwner, PointD)
,
getPortDefaults(IPortOwner)
default IEdge createEdge(INode source, INode target)
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.
source
- The source node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.target
- The target node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
default IEdge createEdge(INode source, INode target, IEdgeStyle style)
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.
source
- The source node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.target
- The target node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.style
- The style instance that will be assigned to the newly created instance. This is done by reference.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
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.
source
- The source node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.target
- The target node the created edge will connect to. It is up to the implementation to decide which port to use at the
given node. The implementation may create a new port of the edge.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.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
default IEdge createEdge(IPort sourcePort, IPort targetPort)
The 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.
sourcePort
- The source port the created edge will connect to.targetPort
- The target port the created edge will connect to.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
default IEdge createEdge(IPort sourcePort, IPort targetPort, IEdgeStyle style)
The 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.
sourcePort
- 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.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
IEdge createEdge(IPort sourcePort, IPort targetPort, IEdgeStyle style, Object tag)
The 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.
sourcePort
- 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.addEdgeCreatedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
default INode createGroupNode()
parent
.
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
.
default INode createGroupNode(INode parent)
parent
.
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
.
parent
- The node to use as the parent in the grouping hierarchy or null
if the new node should become a top-level node.default INode createGroupNode(INode parent, RectD layout)
parent
.
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
.
parent
- 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.default INode createGroupNode(INode parent, RectD layout, INodeStyle style)
parent
.
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
.
parent
- 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.INode createGroupNode(INode parent, RectD layout, INodeStyle style, Object tag)
parent
.
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
.
parent
- 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
.default INode createNode()
parent
using the given layout and style.setParent(INode, INode)
,
createNode(RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
default INode createNode(INode parent)
parent
using the given layout and style.parent
- The node to use as the parent in the grouping hierarchy or null
if the new node should become a top-level node.setParent(INode, INode)
,
createNode(RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
default INode createNode(INode parent, RectD layout)
parent
using the given layout and style.parent
- 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.setParent(INode, INode)
,
createNode(RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
default INode createNode(INode parent, RectD layout, INodeStyle style)
parent
using the given layout and style.parent
- 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.setParent(INode, INode)
,
createNode(RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
INode createNode(INode parent, RectD layout, INodeStyle style, Object tag)
parent
using the given layout and style.parent
- 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
.setParent(INode, INode)
,
createNode(RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
default INode createNode(PointD location)
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
location
- the initial coordinates of the center of the node's Layout
propertyaddNodeCreatedListener(IEventHandler)
default INode createNode(PointD location, INodeStyle style)
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
location
- the initial coordinates of the center of the node's Layout
propertystyle
- The style instance that will be assigned to the newly created instance. This is done by reference.addNodeCreatedListener(IEventHandler)
default INode createNode(PointD location, INodeStyle style, Object tag)
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
location
- the initial coordinates of the center of the node's Layout
propertystyle
- 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.addNodeCreatedListener(IEventHandler)
default INode createNode(RectD layout)
Tag
.
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
layout
- The layout to use initially. The values will be copied to the node's Layout
fieldaddNodeCreatedListener(IEventHandler)
,
VoidNodeStyle.INSTANCE
default INode createNode(RectD layout, INodeStyle style)
Tag
.
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
layout
- 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.addNodeCreatedListener(IEventHandler)
,
VoidNodeStyle.INSTANCE
INode createNode(RectD layout, INodeStyle style, Object tag)
Tag
.
The node will be a part of this graph after the method returns. This will trigger the corresponding events.
layout
- 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.addNodeCreatedListener(IEventHandler)
,
VoidNodeStyle.INSTANCE
default int degree(IPort port)
IPort
for this graph.
Note that an edge that is both incoming and outgoing will be counted twice.
port
- The port owner to count the degree of.default int degree(IPortOwner owner)
IPortOwner
for this graph.
Note that an edge that is both incoming and outgoing will be counted twice.
owner
- The port owner to count the degree of.default IListEnumerable<IEdge> edgesAt(IPort port)
This method delegates to edgesAt(IPort, AdjacencyTypes)
using AdjacencyTypes.ALL
.
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.
port
- The owner of the edges.IListEnumerable<IEdge> edgesAt(IPort port, AdjacencyTypes type)
Iterable
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.
IllegalArgumentException
- If port
is not in this graphport
- the port to checktype
- The type of adjacency to consider.edgesAt(IPort)
,
inEdgesAt(IPort)
,
outEdgesAt(IPort)
,
AdjacencyTypes
default IListEnumerable<IEdge> edgesAt(IPortOwner owner)
This method delegates to edgesAt(IPortOwner, AdjacencyTypes)
using AdjacencyTypes.ALL
.
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.
owner
- The owner of the edges.IListEnumerable<IEdge> edgesAt(IPortOwner owner, AdjacencyTypes type)
IListEnumerable
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.
IllegalArgumentException
- If owner
is not in this graphtype
- The type of adjacency to consider.owner
- the port owner to checkedgesAt(IPortOwner)
,
inEdgesAt(IPortOwner)
,
outEdgesAt(IPortOwner)
,
AdjacencyTypes
default IListEnumerable<IBend> getBends()
IGraph
.IListEnumerable<INode> getChildren(INode node)
IllegalArgumentException
- If node
is not in this graphnode
- The node for which to return the children or null
if the top-level nodes should be returned.node
as their parent
.default GraphDecorator getDecorator()
GraphDecorator
instance for use with the given graph.GraphDecorator
default RectD getDefaultNodeBounds()
NodeDefaults
' Size
.default IEdge getEdge(IPort sourcePort, IPort targetPort)
sourcePort
and targetPort
in the given graph.sourcePort
- The SourcePort
of the edge to find.targetPort
- The TargetPort
of the edge to find.null
, if none was found.default IEdge getEdge(IPortOwner from, IPortOwner to)
from
and to
in the given graph.from
- The SourcePort
owner of the edge to find.to
- The TargetPort
owner of the edge to find.null
, if none was found.IEdgeDefaults getEdgeDefaults()
The settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
setEdgeDefaults(IEdgeDefaults)
default IListEnumerable<ILabel> getEdgeLabels()
IGraph
.IListEnumerable<IEdge> getEdges()
This 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.
default IFoldingView getFoldingView()
folding view
instance associated with this IGraph
or null
if none is
associated with it.
This convenience method uses the ILookup.lookup(Class)
of the IGraph
to obtain the
IFoldingView
.
IFoldingView
or null
if the graph has not been created by a
FoldingManager
.FoldingManager
,
FoldingManager.createFoldingView(INode, java.util.function.Predicate)
default GroupingSupport getGroupingSupport()
GroupingSupport
instance for the graph.
GroupingSupport
provides less frequently used methods for grouped graphs, such as methods for analyzing and
walking the grouping hierarchy.
GroupingSupport
for the graph.INodeDefaults getGroupNodeDefaults()
setGroupNodeDefaults(INodeDefaults)
default ILabelDefaults getLabelDefaults(ILabelOwner owner)
owner
- The item that the label defaults are returned for. If this is a group node, the
GroupNodeDefaults
's label defaults
will be
returned, otherwise the NodeDefaults
or EdgeDefaults
labels
will be returned.ILabelDefaults
for the provided owner
.IListEnumerable<ILabel> getLabels()
This 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.
IMapperRegistry getMapperRegistry()
The registry can be used to store data mappings for the items in this instance.
IMapperRegistry
,
IModelItem
,
ITagOwner.getTag()
INodeDefaults getNodeDefaults()
The settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
setNodeDefaults(INodeDefaults)
default IListEnumerable<ILabel> getNodeLabels()
IGraph
.IListEnumerable<INode> getNodes()
This 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.
INode getParent(INode node)
null
if node
is a top-level node.IllegalArgumentException
- If node
is not in this graph or is null
.node
- The node to retrieve the parent node for.null
if node
is a top-level node.default IPortDefaults getPortDefaults(IPortOwner owner)
owner
- The item that the label defaults are returned for. If this is a group node, the
GroupNodeDefaults
's port defaults
will be
returned, otherwise the NodeDefaults
or EdgeDefaults
ports
will be returned.IPortDefaults
for the provided owner
.IListEnumerable<IPort> getPorts()
This 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.
default UndoEngine getUndoEngine()
UndoEngine
instance associated with this IGraph
or null
if none is associated with it.
This convenience method uses the ILookup.lookup(Class)
of the IGraph
to obtain the UndoEngine
.
UndoEngine
or null
if
undo is not supported
.default INode groupNodes(INode... children)
The group node will be created at the common ancestor level of all nodes in children
.
children
- The children to group into the new group node.GroupingSupport.getNearestCommonAncestor(INode[])
,
groupNodes(Iterable)
default void groupNodes(INode parent, Iterable<INode> children)
children
into the provided group node.
The parent
needs to be a group node at the time of the invocation. This operation is basically the same as
calling setParent(INode, INode)
for each node in the children
enumerable whose parent is not part of
the set.
parent
- The node to use as the parent in the grouping hierarchy.children
- The children to group into the group node.groupNodes(Iterable)
,
setParent(INode, INode)
,
createGroupNode(INode, RectD, INodeStyle, Object)
default INode groupNodes(Iterable<INode> children)
children
into a newly created group node.
The group node will be created at the common ancestor level of all nodes in children
.
children
- The children to group into the new group node.GroupingSupport.getNearestCommonAncestor(INode[])
,
groupNodes(Iterable)
default int inDegree(IPort port)
IPort
for this graph.port
- The port to count the incoming edges of.default int inDegree(IPortOwner owner)
IPortOwner
for this graph.owner
- The port owner to count the incoming edges of.default IListEnumerable<IEdge> inEdgesAt(IPort port)
This method delegates to edgesAt(IPort, AdjacencyTypes)
using AdjacencyTypes.INCOMING
.
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 incoming
edges via a foreach
loop.
port
- The port of the edges.default IListEnumerable<IEdge> inEdgesAt(IPortOwner owner)
This method delegates to edgesAt(IPortOwner, AdjacencyTypes)
using AdjacencyTypes.INCOMING
.
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 incoming
edges via a foreach
loop.
owner
- The owner of the edges.void invalidateDisplays()
DisplaysInvalidated
event to be triggered.
This method may be called by client code to invalidate all views of the graph that have registered with the DisplaysInvalidated
event. Views that need to be informed if non-structural changes have been made to the graph should register with the
corresponding event.
boolean isGroupNode(INode node)
Group nodes may have children but do not necessarily need to have children
.
IllegalArgumentException
- If node
is not in this graph.node
- The node to check.getChildren(INode)
,
setIsGroupNode(INode, boolean)
default boolean isUndoEngineEnabled()
default <T extends IPortOwner> IEnumerable<T> neighbors(Class<T> tType, T portOwner)
IPortOwner
.
Neighbors are calculated by going through all Ports
and inspecting the
edges at these ports
, collecting the IEdge.opposite(IPort)
s.
T
- The type of the IPortOwner
portOwner
- The port owner.default int outDegree(IPort port)
IPort
for this graph.port
- The port to count the outgoing edges of.default int outDegree(IPortOwner owner)
IPortOwner
for this graph.owner
- The port owner to count the outgoing edges of.default IListEnumerable<IEdge> outEdgesAt(IPort port)
This method delegates to edgesAt(IPort, AdjacencyTypes)
using AdjacencyTypes.OUTGOING
.
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 outgoing
edges via a foreach
loop.
port
- The owner of the edges.default IListEnumerable<IEdge> outEdgesAt(IPortOwner owner)
This method delegates to edgesAt(IPortOwner, AdjacencyTypes)
using AdjacencyTypes.OUTGOING
.
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 outgoing
edges via a foreach
loop.
owner
- The owner of the edges.default <T extends IPortOwner> IEnumerable<T> predecessors(Class<T> tType, T portOwner)
IPortOwner
.
Predecessors are calculated by going through all Ports
and inspecting the
incoming edges at these ports
, collecting the SourcePort
Owner
s.
T
- The type of the IPortOwner
portOwner
- The port owner.void remove(IModelItem item)
item
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.
IllegalArgumentException
- item
is not part of the graph.item
- the live item to be removed from this graph instancevoid removeBendAddedListener(IEventHandler<ItemEventArgs<IBend>> bendAddedEvent)
BendAdded
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.
bendAddedEvent
- The listener to remove.addBend(IEdge, PointD, int)
,
CreateBendInputMode.addBendCreatedListener(IEventHandler)
,
addBendAddedListener(IEventHandler)
void removeBendLocationChangedListener(IBendLocationChangedHandler bendLocationChangedEvent)
BendLocationChanged
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.
bendLocationChangedEvent
- The listener to remove.setBendLocation(IBend, PointD)
,
addBendLocationChangedListener(IBendLocationChangedHandler)
void removeBendRemovedListener(IEventHandler<BendEventArgs> bendRemovedEvent)
BendRemoved
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.
bendRemovedEvent
- The listener to remove.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
addBendRemovedListener(IEventHandler)
void removeBendTagChangedListener(IEventHandler<ItemChangedEventArgs<IBend,Object>> bendTagChangedEvent)
BendTagChanged
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.
bendTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addBendTagChangedListener(IEventHandler)
void removeDisplaysInvalidatedListener(IEventHandler<IEventArgs> displaysInvalidatedEvent)
DisplaysInvalidated
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.
displaysInvalidatedEvent
- The listener to remove.addDisplaysInvalidatedListener(IEventHandler)
void removeEdgeCreatedListener(IEventHandler<ItemEventArgs<IEdge>> edgeCreatedEvent)
EdgeCreated
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.
edgeCreatedEvent
- The listener to remove.createEdge(IPort, IPort, IEdgeStyle, Object)
,
CreateEdgeInputMode.addEdgeCreatedListener(IEventHandler)
,
addEdgeCreatedListener(IEventHandler)
void removeEdgePortsChangedListener(IEventHandler<EdgeEventArgs> edgePortsChangedEvent)
EdgePortsChanged
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.
edgePortsChangedEvent
- The listener to remove.setEdgePorts(IEdge, IPort, IPort)
,
addEdgePortsChangedListener(IEventHandler)
void removeEdgeRemovedListener(IEventHandler<EdgeEventArgs> edgeRemovedEvent)
EdgeRemoved
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.
edgeRemovedEvent
- The listener to remove.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
addEdgeRemovedListener(IEventHandler)
void removeEdgeStyleChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,IEdgeStyle>> edgeStyleChangedEvent)
EdgeStyleChanged
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.
edgeStyleChangedEvent
- The listener to remove.setStyle(IEdge, IEdgeStyle)
,
addEdgeStyleChangedListener(IEventHandler)
void removeEdgeTagChangedListener(IEventHandler<ItemChangedEventArgs<IEdge,Object>> edgeTagChangedEvent)
EdgeTagChanged
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.
edgeTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addEdgeTagChangedListener(IEventHandler)
void removeGraphTagChangedListener(IEventHandler<ItemChangedEventArgs<IGraph,Object>> graphTagChangedEvent)
GraphTagChanged
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.
graphTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addGraphTagChangedListener(IEventHandler)
void removeIsGroupNodeChangedListener(IEventHandler<NodeEventArgs> isGroupNodeChangedEvent)
IsGroupNodeChanged
event.
isGroupNodeChangedEvent
- The listener to remove.addIsGroupNodeChangedListener(IEventHandler)
void removeLabelAddedListener(IEventHandler<ItemEventArgs<ILabel>> labelAddedEvent)
LabelAdded
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.
labelAddedEvent
- The listener to remove.addLabel(ILabelOwner, String, ILabelModelParameter, ILabelStyle, SizeD, Object)
,
GraphEditorInputMode.addLabelAddedListener(IEventHandler)
,
addLabelAddedListener(IEventHandler)
void removeLabelLayoutParameterChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelModelParameter>> labelLayoutParameterChangedEvent)
LabelLayoutParameterChanged
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.
labelLayoutParameterChangedEvent
- The listener to remove.setLabelLayoutParameter(ILabel, ILabelModelParameter)
,
addLabelLayoutParameterChangedListener(IEventHandler)
void removeLabelPreferredSizeChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,SizeD>> labelPreferredSizeChangedEvent)
LabelPreferredSizeChanged
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.
labelPreferredSizeChangedEvent
- The listener to remove.setLabelPreferredSize(ILabel, SizeD)
,
addLabelPreferredSizeChangedListener(IEventHandler)
void removeLabelRemovedListener(IEventHandler<LabelEventArgs> labelRemovedEvent)
LabelRemoved
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.
labelRemovedEvent
- The listener to remove.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
GraphEditorInputMode.addLabelTextChangedListener(IEventHandler)
,
addLabelRemovedListener(IEventHandler)
void removeLabelStyleChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,ILabelStyle>> labelStyleChangedEvent)
LabelStyleChanged
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.
labelStyleChangedEvent
- The listener to remove.setStyle(ILabel, ILabelStyle)
,
addLabelStyleChangedListener(IEventHandler)
void removeLabelTagChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,Object>> labelTagChangedEvent)
LabelTagChanged
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.
labelTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addLabelTagChangedListener(IEventHandler)
void removeLabelTextChangedListener(IEventHandler<ItemChangedEventArgs<ILabel,String>> labelTextChangedEvent)
LabelTextChanged
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.
labelTextChangedEvent
- The listener to remove.setLabelText(ILabel, String)
,
addLabelTextChangedListener(IEventHandler)
void removeNodeCreatedListener(IEventHandler<ItemEventArgs<INode>> nodeCreatedEvent)
NodeCreated
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.
nodeCreatedEvent
- The listener to remove.createNode(RectD, INodeStyle, Object)
,
createNode(INode, RectD, INodeStyle, Object)
,
createGroupNode(INode, RectD, INodeStyle, Object)
,
GraphEditorInputMode.addNodeCreatedListener(IEventHandler)
,
addNodeCreatedListener(IEventHandler)
void removeNodeLayoutChangedListener(INodeLayoutChangedHandler nodeLayoutChangedEvent)
NodeLayoutChanged
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.
nodeLayoutChangedEvent
- The listener to remove.addNodeLayoutChangedListener(INodeLayoutChangedHandler)
void removeNodeRemovedListener(IEventHandler<NodeEventArgs> nodeRemovedEvent)
NodeRemoved
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.
nodeRemovedEvent
- The listener to remove.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
addNodeRemovedListener(IEventHandler)
void removeNodeStyleChangedListener(IEventHandler<ItemChangedEventArgs<INode,INodeStyle>> nodeStyleChangedEvent)
NodeStyleChanged
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.
nodeStyleChangedEvent
- The listener to remove.setStyle(INode, INodeStyle)
,
addNodeStyleChangedListener(IEventHandler)
void removeNodeTagChangedListener(IEventHandler<ItemChangedEventArgs<INode,Object>> nodeTagChangedEvent)
NodeTagChanged
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.
nodeTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addNodeTagChangedListener(IEventHandler)
void removeParentChangedListener(IEventHandler<NodeEventArgs> parentChangedEvent)
ParentChanged
event.
parentChangedEvent
- The listener to remove.addParentChangedListener(IEventHandler)
void removePortAddedListener(IEventHandler<ItemEventArgs<IPort>> portAddedEvent)
PortAdded
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.
portAddedEvent
- The listener to remove.addPort(IPortOwner, IPortLocationModelParameter, IPortStyle, Object)
,
createEdge(INode, INode, IEdgeStyle, Object)
,
addPortAddedListener(IEventHandler)
void removePortLocationParameterChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortLocationModelParameter>> portLocationParameterChangedEvent)
PortLocationParameterChanged
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.
portLocationParameterChangedEvent
- The listener to remove.setPortLocationParameter(IPort, IPortLocationModelParameter)
,
addPortLocationParameterChangedListener(IEventHandler)
void removePortRemovedListener(IEventHandler<PortEventArgs> portRemovedEvent)
PortRemoved
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.
portRemovedEvent
- The listener to remove.remove(IModelItem)
,
GraphEditorInputMode.addDeletedItemListener(IEventHandler)
,
addPortRemovedListener(IEventHandler)
void removePortStyleChangedListener(IEventHandler<ItemChangedEventArgs<IPort,IPortStyle>> portStyleChangedEvent)
PortStyleChanged
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.
portStyleChangedEvent
- The listener to remove.setStyle(IPort, IPortStyle)
,
addPortStyleChangedListener(IEventHandler)
void removePortTagChangedListener(IEventHandler<ItemChangedEventArgs<IPort,Object>> portTagChangedEvent)
PortTagChanged
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.
portTagChangedEvent
- The listener to remove.ITagOwner.getTag()
,
addPortTagChangedListener(IEventHandler)
default void reverse(IEdge edge)
setting source and target port
to TargetPort
and SourcePort
.
Also, this method will reverse the bends by clearing them and reinserting them in reverse order if there is more than one bend.
edge
- The edge to reverse.void setBendLocation(IBend bend, PointD location)
bend
- the bend whose location is to be modifiedlocation
- the new location of the bendaddBend(IEdge, PointD, int)
void setEdgeDefaults(IEdgeDefaults value)
The settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
value
- The EdgeDefaults to set.getEdgeDefaults()
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.
edge
- The edge to change the ports.sourcePort
- The new source port instance.targetPort
- The new target port instance.void setGroupNodeDefaults(INodeDefaults value)
value
- The GroupNodeDefaults to set.getGroupNodeDefaults()
void setIsGroupNode(INode node, boolean isGroupNode)
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
.
IllegalStateException
- If node
is the root or currently has children and isGroupNode
is false
.IllegalArgumentException
- If node
is not in this graph.node
- The node to set the group node status for.isGroupNode
- Whether to make the node a group node.getChildren(INode)
,
isGroupNode(INode)
void setLabelLayoutParameter(ILabel label, ILabelModelParameter layoutParameter)
IllegalArgumentException
- If the layoutParameter
cannot be used for this label.IllegalArgumentException
- If the label
does not belong to this graph.label
- The label.layoutParameter
- The new parameter.void setLabelPreferredSize(ILabel label, SizeD preferredSize)
label
- The label.preferredSize
- The new preferred size.ILabel.getPreferredSize()
void setLabelText(ILabel label, String text)
label
- the label to modifytext
- the new text of the labelILabel.getText()
default void setNodeCenter(INode node, PointD center)
This implementation delegates to setNodeLayout(INode, RectD)
node
- The node to recenter.center
- The new center coordinates of the node in the world coordinate system.void setNodeDefaults(INodeDefaults value)
The settings that are obtained from the instance influence newly created elements only. Setting different defaults afterwards does not influence existing elements.
value
- The NodeDefaults to set.getNodeDefaults()
void setNodeLayout(INode node, RectD layout)
node
- a live node that belongs to this graphlayout
- The new layout of the node to assign to its Layout
.INode.getLayout()
void setParent(INode node, INode parent)
Use null
as parent
to make node
a top-level node for this graph.
IllegalArgumentException
- If node
is null
.IllegalArgumentException
- If node
is not in this graphnode
- 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.getParent(INode)
default void setPortLocation(IPort port, PointD location)
For full control over the placement of the ports, the setPortLocationParameter(IPort, IPortLocationModelParameter)
method should be used instead. This implementation will use the port's
LocationParameter
's Model
to
obtain a new IPortLocationModelParameter
via the IPortLocationModel.createParameter(IPortOwner, PointD)
method. This might result in the port using a different location, because the model might not support parameters that
result in the given location. This will also trigger an invalidateDisplays()
call.
port
- The port to modifylocation
- the new absolute coordinates of the portaddPort(IPortOwner, IPortLocationModelParameter, IPortStyle, Object)
void setPortLocationParameter(IPort port, IPortLocationModelParameter locationParameter)
IPortLocationModelParameter
for the given port.port
- The port to modifylocationParameter
- the new parameter that determines the coordinates of the portdefault void setRelativePortLocation(IPort port, PointD relativeLocation)
owner
if the owner is a
node
.
If the port is not owned by a node that is part of this graph, this method will throw an
IllegalArgumentException
. This method will delegate to setPortLocation(IPort, PointD)
.
IllegalArgumentException
- If the port is not owned by a nodeport
- the portrelativeLocation
- the new coordinate offsets relative to the center of the node's Layout
's center.INode.getLayout()
void setStyle(IEdge edge, IEdgeStyle style)
Style instances can be shared.
edge
- The edge that will be assigned the new stylestyle
- The style instance that will be assigned to the edge.IEdge.getStyle()
,
addEdgeStyleChangedListener(IEventHandler)
,
VoidEdgeStyle.INSTANCE
void setStyle(ILabel label, ILabelStyle style)
Style instances can be shared.
label
- The label that will be assigned the new stylestyle
- The style instance that will be assigned to the label.ILabel.getStyle()
,
addLabelStyleChangedListener(IEventHandler)
,
VoidLabelStyle.INSTANCE
void setStyle(INode node, INodeStyle style)
Style instances can be shared.
node
- The node that will be assigned the new stylestyle
- The style instance that will be assigned to the node.INode.getStyle()
,
addNodeStyleChangedListener(IEventHandler)
,
VoidNodeStyle.INSTANCE
void setStyle(IPort port, IPortStyle style)
Style instances can be shared.
port
- The port that will be assigned the new stylestyle
- The style instance that will be assigned to the port.IPort.getStyle()
,
addPortStyleChangedListener(IEventHandler)
,
VoidPortStyle.INSTANCE
default void setUndoEngineEnabled(boolean enabled)
If undo support is set to true
, an instance of UndoEngine
can be queried from this instance's ILookup
method.
default <T extends IPortOwner> IEnumerable<T> successors(Class<T> tType, T portOwner)
IPortOwner
.
Successors are calculated by going through all Ports
and inspecting the
outgoing edges at these ports
, collecting the TargetPort
Owner
s.
T
- The type of the IPortOwner
portOwner
- The port owner.