|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LabelLayoutFactory
LabelLayoutFactory
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. Otherwise buffered layout calculations
and
delayed layout results
will most likely produce
incorrect results or break down with ClassCastException
s.
An instance of this factory can be obtained with method LayoutTool.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 LayoutTool.getLabelFactory(LayoutGraph)
.
![]() |
![]() |
Method Summary | |
---|---|
void |
addLabelLayout(Edge edge,
EdgeLabelLayout labelLayout)
Adds the given EdgeLabelLayout to the given edge. |
void |
addLabelLayout(Node node,
NodeLabelLayout labelLayout)
Adds the given node label layout to the given node. |
EdgeLabelLayout |
createEdgeLabelLayout(Edge edge,
OrientedRectangle orientedBox)
Creates a new LabelLayout for the given edge. |
EdgeLabelLayout |
createEdgeLabelLayout(Edge edge,
OrientedRectangle orientedBox,
EdgeLabelModel model,
PreferredPlacementDescriptor descriptor)
Creates a new LabelLayout for the given edge. |
NodeLabelLayout |
createNodeLabelLayout(Node node,
OrientedRectangle orientedBox)
Creates a new LabelLayout for the given node. |
NodeLabelLayout |
createNodeLabelLayout(Node node,
OrientedRectangle orientedBox,
NodeLabelModel model)
Creates a new LabelLayout for the given node. |
LayoutGraph |
getGraph()
Returns the graph associated with this label factory instance. |
void |
removeLabelLayout(Edge edge,
EdgeLabelLayout labelLayout)
Removes the given EdgeLabelLayout from the given edge. |
void |
removeLabelLayout(Node node,
NodeLabelLayout labelLayout)
Removes the given node label layout from the given node. |
Method Detail |
---|
LayoutGraph getGraph()
void addLabelLayout(Node node, NodeLabelLayout labelLayout)
createNodeLabelLayout(Node, OrientedRectangle)
or createNodeLabelLayout(Node, OrientedRectangle, NodeLabelModel)
.
buffered 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 node
java.lang.IllegalArgumentException
- if the given label layout has already been added to the graphcreateNodeLabelLayout(Node, OrientedRectangle)
,
createNodeLabelLayout(Node, OrientedRectangle, NodeLabelModel)
void removeLabelLayout(Node node, NodeLabelLayout labelLayout)
buffered layout calculations
and
delayed layout results
will most likely
produce incorrect results or break down with ClassCastException
s.node
- the nodelabelLayout
- the label layout that should be removed from the given nodeaddLabelLayout(Edge, EdgeLabelLayout)
NodeLabelLayout createNodeLabelLayout(Node node, OrientedRectangle orientedBox)
LabelLayout
for the given node.
This method should create a LabelLayout
with a NodeLabelModel
that supports the desired oriented
label box exactly as given.
addLabelLayout(Node, NodeLabelLayout)
.node
- the nodeorientedBox
- the box specifying the size and location of the label
addLabelLayout(Node, NodeLabelLayout)
NodeLabelLayout createNodeLabelLayout(Node node, OrientedRectangle orientedBox, NodeLabelModel model)
LabelLayout
for the given node.
addLabelLayout(Node, NodeLabelLayout)
.node
- the nodeorientedBox
- the box specifying the size and location of the labelmodel
- specifies the model of the created node label
addLabelLayout(Node, NodeLabelLayout)
void addLabelLayout(Edge edge, EdgeLabelLayout labelLayout)
EdgeLabelLayout
to the given edge. The given LabelLayout
has to be created with
method createEdgeLabelLayout(Edge, OrientedRectangle)
or
createEdgeLabelLayout(Edge, OrientedRectangle, EdgeLabelModel, PreferredPlacementDescriptor)
.
buffered 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 edge
java.lang.IllegalArgumentException
- if the given label layout has already been added to the graphcreateEdgeLabelLayout(Edge, OrientedRectangle)
,
createEdgeLabelLayout(Edge, OrientedRectangle, EdgeLabelModel, PreferredPlacementDescriptor)
void removeLabelLayout(Edge edge, EdgeLabelLayout labelLayout)
EdgeLabelLayout
from the given edge.
buffered layout calculations
and
delayed layout results
will most likely
produce incorrect results or break down with ClassCastException
s.edge
- the edgelabelLayout
- the label layout that should be removed from the given edgeaddLabelLayout(Edge, EdgeLabelLayout)
EdgeLabelLayout createEdgeLabelLayout(Edge edge, OrientedRectangle orientedBox)
LabelLayout
for the given edge.
This method should create a LabelLayout
with an EdgeLabelModel
that supports the desired oriented
label box exactly as given.
addLabelLayout(Edge, EdgeLabelLayout)
.edge
- the edgeorientedBox
- the box specifying the size and location of the label
addLabelLayout(Edge, EdgeLabelLayout)
EdgeLabelLayout createEdgeLabelLayout(Edge edge, OrientedRectangle orientedBox, EdgeLabelModel model, PreferredPlacementDescriptor descriptor)
LabelLayout
for the given edge.
LabelLayout
has to be added to
the edge using method addLabelLayout(Edge, EdgeLabelLayout)
.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 used
addLabelLayout(Edge, EdgeLabelLayout)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |