public interface ILabelLayoutFactory
ILabelLayoutFactory
provides methods to create, add and remove node/edge labels for LayoutGraph
s.
It can be used, e.g., to temporarily add labels during layout calculation.
Note that original labels which are removed during a layout calculation have to be re-added when the layout calculation is done.
An instance of this factory can be obtained with method LayoutGraphUtilities.getLabelFactory(LayoutGraph)
. This
method uses the LayoutGraph.createLabelFactory()
method to create the factory.
Note that each factory instance is bound to a specific graph instance, i.e., you can only create, add and remove labels
for the graph which was given to method LayoutGraphUtilities.getLabelFactory(LayoutGraph)
.
Modifier and Type | Method and Description |
---|---|
void |
addLabelLayout(Edge edge,
IEdgeLabelLayout labelLayout)
Adds the given
IEdgeLabelLayout to the given edge. |
void |
addLabelLayout(Node node,
INodeLabelLayout labelLayout)
Adds the given node label layout to the given node.
|
IEdgeLabelLayout |
createLabelLayout(Edge edge,
YOrientedRectangle orientedBox)
Creates a new
ILabelLayout for the given edge. |
IEdgeLabelLayout |
createLabelLayout(Edge edge,
YOrientedRectangle orientedBox,
IEdgeLabelLayoutModel model,
PreferredPlacementDescriptor descriptor)
Creates a new
ILabelLayout for the given edge. |
INodeLabelLayout |
createLabelLayout(Node node,
YOrientedRectangle orientedBox)
Creates a new
ILabelLayout for the given node. |
INodeLabelLayout |
createLabelLayout(Node node,
YOrientedRectangle orientedBox,
INodeLabelLayoutModel model)
Creates a new
ILabelLayout for the given node. |
LayoutGraph |
getGraph()
Gets the graph associated with this label factory instance.
|
void |
removeLabelLayout(Edge edge,
IEdgeLabelLayout labelLayout)
Removes the given
IEdgeLabelLayout from the given edge. |
void |
removeLabelLayout(Node node,
INodeLabelLayout labelLayout)
Removes the given node label layout from the given node.
|
void addLabelLayout(Edge edge, IEdgeLabelLayout labelLayout)
IEdgeLabelLayout
to the given edge.
The given ILabelLayout
has to be created with method createLabelLayout(Edge, YOrientedRectangle)
or createLabelLayout(Edge, YOrientedRectangle, IEdgeLabelLayoutModel, PreferredPlacementDescriptor)
.
IllegalArgumentException
- if the given label layout has already been added to the graphbuffered layout calculations
automatically restores the original order of labels of the given edge. Otherwise, the layout calculation will most
likely produce incorrect results or break down with ClassCastException
s.edge
- the edgelabelLayout
- the edge label layout that should be added to the given edgecreateLabelLayout(Edge, YOrientedRectangle)
,
createLabelLayout(Edge, YOrientedRectangle, IEdgeLabelLayoutModel, PreferredPlacementDescriptor)
void addLabelLayout(Node node, INodeLabelLayout labelLayout)
The given label layout has to be created with method createLabelLayout(Node, YOrientedRectangle)
or
createLabelLayout(Node, YOrientedRectangle, INodeLabelLayoutModel)
.
IllegalArgumentException
- if the given label layout has already been added to the graphbuffered layout calculations
automatically restores the original order of labels at the given node. Otherwise, the layout calculation will most
likely produce incorrect results or break down with ClassCastException
s.node
- the nodelabelLayout
- the node label layout that should be added to the given nodecreateLabelLayout(Node, YOrientedRectangle)
,
createLabelLayout(Node, YOrientedRectangle, INodeLabelLayoutModel)
IEdgeLabelLayout createLabelLayout(Edge edge, YOrientedRectangle orientedBox)
ILabelLayout
for the given edge.
This method should create a ILabelLayout
with an IEdgeLabelLayoutModel
that
supports the desired oriented label box exactly as given.
addLabelLayout(Edge, IEdgeLabelLayout)
.edge
- the edgeorientedBox
- the box specifying the size and location of the labeladdLabelLayout(Edge, IEdgeLabelLayout)
IEdgeLabelLayout createLabelLayout(Edge edge, YOrientedRectangle orientedBox, IEdgeLabelLayoutModel model, PreferredPlacementDescriptor descriptor)
ILabelLayout
for the given edge.ILabelLayout
has
to be added to the edge using method addLabelLayout(Edge, IEdgeLabelLayout)
.edge
- the edgeorientedBox
- the box specifying the size and location of the labelmodel
- specifies the model of the created edge labeldescriptor
- specifies the preferred placement descriptor of the created label. If this value is
null
, the default descriptor is usedaddLabelLayout(Edge, IEdgeLabelLayout)
INodeLabelLayout createLabelLayout(Node node, YOrientedRectangle orientedBox)
ILabelLayout
for the given node.
This method should create a ILabelLayout
with a INodeLabelLayoutModel
that
supports the desired oriented label box exactly as given.
addLabelLayout(Node, INodeLabelLayout)
.node
- the nodeorientedBox
- the box specifying the size and location of the labeladdLabelLayout(Node, INodeLabelLayout)
INodeLabelLayout createLabelLayout(Node node, YOrientedRectangle orientedBox, INodeLabelLayoutModel model)
ILabelLayout
for the given node.addLabelLayout(Node, INodeLabelLayout)
.node
- the nodeorientedBox
- the box specifying the size and location of the labelmodel
- specifies the model of the created node labeladdLabelLayout(Node, INodeLabelLayout)
LayoutGraph getGraph()
void removeLabelLayout(Edge edge, IEdgeLabelLayout labelLayout)
IEdgeLabelLayout
from the given edge.edge
- the edgelabelLayout
- the label layout that should be removed from the given edgeaddLabelLayout(Edge, IEdgeLabelLayout)
void removeLabelLayout(Node node, INodeLabelLayout labelLayout)
node
- the nodelabelLayout
- the label layout that should be removed from the given nodeaddLabelLayout(Edge, IEdgeLabelLayout)