|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.FreeEdgeLabelModel
public class FreeEdgeLabelModel
FreeEdgeLabelModel
allows placing edge labels at any location.
Nested Class Summary | |
---|---|
static class |
FreeEdgeLabelModel.ModelParameter
This model parameter encodes a label position within FreeEdgeLabelModel . |
Constructor Summary | |
---|---|
FreeEdgeLabelModel()
Creates a new instance of FreeEdgeLabelModel . |
Method Summary | |
---|---|
java.lang.Object |
createModelParameter(OrientedRectangle labelBounds,
EdgeLayout edgeLayout,
NodeLayout sourceLayout,
NodeLayout targetLayout)
Creates a model parameter that represents the given edge label position within this model. |
java.lang.Object |
getDefaultParameter()
Returns the model parameter that encodes the default position of FreeEdgeLabelModel . |
YList |
getLabelCandidates(EdgeLabelLayout labelLayout,
EdgeLayout edgeLayout,
NodeLayout sourceLayout,
NodeLayout targetLayout)
Returns the EdgeLabelCandidate that describes the current label position. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode,
java.lang.Object param)
Returns the oriented box of the label for the position encoded by the given model parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public FreeEdgeLabelModel()
FreeEdgeLabelModel
.
Method Detail |
---|
public java.lang.Object getDefaultParameter()
FreeEdgeLabelModel
.
The distance of the label to the edge's source point will be 20
. The angle between the line to the
center of the label and the first segment is 20
radians. The label is not rotated.
This parameter can be passed to getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
to retrieve the corresponding label box.
getDefaultParameter
in interface EdgeLabelModel
public java.lang.Object createModelParameter(OrientedRectangle labelBounds, EdgeLayout edgeLayout, NodeLayout sourceLayout, NodeLayout targetLayout)
The created model parameter represents the current location of the given label.
This parameter can be passed to getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
to retrieve the current label box.
createModelParameter
in interface EdgeLabelModel
labelBounds
- the oriented box of the label the parameter representsedgeLayout
- the layout of the edge to which the label belongssourceLayout
- the layout of the source node of the label-owning edgetargetLayout
- the layout of the target node of the label-owning edge
java.lang.IllegalArgumentException
- if one or more of the given bounds' values are invalid, i.e., NaN
getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
public OrientedRectangle getLabelPlacement(YDimension labelSize, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode, java.lang.Object param)
EdgeLabelModel
getLabelPlacement
in interface EdgeLabelModel
labelSize
- the width and height of the labeledgeLayout
- the layout of the edge to which the label belongssourceNode
- the layout of the source node of the label-owning edgetargetNode
- the layout of the target node of the label-owning edgeparam
- the model parameter that describes the abstract position of the label within this model
public YList getLabelCandidates(EdgeLabelLayout labelLayout, EdgeLayout edgeLayout, NodeLayout sourceLayout, NodeLayout targetLayout)
EdgeLabelCandidate
that describes the current label position.
getLabelCandidates
in interface EdgeLabelModel
labelLayout
- the label for which candidates should be generatededgeLayout
- the layout of the edge to which the label belongssourceLayout
- the layout of the source node of the label-owning edgetargetLayout
- the layout of the target node of the label-owning edge
EdgeLabelCandidate
instances
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |