|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.FreeNodeLabelModel
public class FreeNodeLabelModel
FreeNodeLabelModel
allows placing node labels at any desired position.
The location of the label does not need to satisfy any constraints. The
model parameter
describes a fixed offset between
the upper-left corner of the node and the center of the label.
Nested Class Summary | |
---|---|
static class |
FreeNodeLabelModel.ModelParameter
The model parameter that encodes a label position within FreeNodeLabelModel . |
Constructor Summary | |
---|---|
FreeNodeLabelModel()
Returns a new instance of FreeNodeLabelModel . |
Method Summary | |
---|---|
java.lang.Object |
createModelParameter(OrientedRectangle labelBounds,
NodeLayout nodeLayout)
Creates a model parameter that represents the given node label position within this model. |
java.lang.Object |
getDefaultParameter()
Returns a model parameter that encodes the default position of NodeLabelModel . |
YList |
getLabelCandidates(NodeLabelLayout labelLayout,
NodeLayout nodeLayout)
Returns the NodeLabelCandidate that describes the current label position. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
NodeLayout nodeLayout,
java.lang.Object param)
Returns the bounds 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 FreeNodeLabelModel()
FreeNodeLabelModel
.
Method Detail |
---|
public java.lang.Object getDefaultParameter()
NodeLabelModel
.
The node label's upper-left corner is placed 20
pixels to the left and 20
pixels above
the node.
This parameter can be passed to getLabelPlacement(YDimension, NodeLayout, Object)
to retrieve the corresponding label box.
getDefaultParameter
in interface NodeLabelModel
public OrientedRectangle getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, java.lang.Object param)
NodeLabelModel
getLabelPlacement
in interface NodeLabelModel
labelSize
- the width and height of the labelnodeLayout
- the layout of the node to which the label belongsparam
- the model parameter that describes the abstract position of the label within this model
public YList getLabelCandidates(NodeLabelLayout labelLayout, NodeLayout nodeLayout)
NodeLabelCandidate
that describes the current label position.
getLabelCandidates
in interface NodeLabelModel
labelLayout
- the label for which candidates should be generatednodeLayout
- the layout of the node to which the label belongs
NodeLabelCandidate
instancespublic java.lang.Object createModelParameter(OrientedRectangle labelBounds, NodeLayout nodeLayout)
The created model parameter represents the current location of the given label.
This parameter can be passed to getLabelPlacement(YDimension, NodeLayout, Object)
to retrieve the current label box.
createModelParameter
in interface NodeLabelModel
labelBounds
- the bounds of the label the parameter representsnodeLayout
- the layout of the node to which the label belongs
java.lang.IllegalArgumentException
- if one or more of the given bounds' values are invalid, i.e., NaN
getLabelPlacement(YDimension, 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 |