|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EdgeLabelModel
This interface defines the properties of the model associated with an EdgeLabelLayout
.
An EdgeLabelModel
provides a set of possible candidates for the placement of an edge label.
It also defines a parameter that describes the current location of the label.
It is important that all state information is encapsulated in the
model parameter
.
EdgeLabelModel
instances may be shared between multiple edge labels but produce different parameters for
labels with different locations.
![]() |
![]() |
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 a model parameter that encodes the default position of this model's allowed edge label positions. |
YList |
getLabelCandidates(EdgeLabelLayout labelLayout,
EdgeLayout edgeLayout,
NodeLayout sourceLayout,
NodeLayout targetLayout)
Returns all EdgeLabelCandidate s that describe valid label positions within this model. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
EdgeLayout edgeLayout,
NodeLayout sourceLayout,
NodeLayout targetLayout,
java.lang.Object parameter)
Returns the oriented box of the label for the position encoded by the given model parameter. |
Method Detail |
---|
java.lang.Object getDefaultParameter()
This parameter can be passed to getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
to retrieve the corresponding label box.
OrientedRectangle getLabelPlacement(YDimension labelSize, EdgeLayout edgeLayout, NodeLayout sourceLayout, NodeLayout targetLayout, java.lang.Object parameter)
labelSize
- the width and height of the labeledgeLayout
- 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 edgeparameter
- the model parameter that describes the abstract position of the label within this model
YList getLabelCandidates(EdgeLabelLayout labelLayout, EdgeLayout edgeLayout, NodeLayout sourceLayout, NodeLayout targetLayout)
EdgeLabelCandidate
s that describe valid label positions within this model.
In case the implementing EdgeLabelModel
allows every possible location, this method always returns the
current location as a LabelCandidate
.
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
instancesjava.lang.Object createModelParameter(OrientedRectangle labelBounds, EdgeLayout edgeLayout, NodeLayout sourceLayout, NodeLayout targetLayout)
The created model parameter is the closest parameter representation of the given label location that can be achieved within this model.
This parameter can be passed to getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
to retrieve the current label box.
A model parameter can be an arbitrary Object
. However it must contain all information to allow restoring
of the encoded location with this EdgeLabelModel
.
labelBounds
- the oriented box of the label, encoding the label location for which the parameter should be creatededgeLayout
- 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
getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
|
© Copyright 2000-2022, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |