|
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
A node label model that allows placement of labels at a fixed offset relative to the node's upper-left corner.
Nested Class Summary | |
---|---|
static class |
FreeNodeLabelModel.ModelParameter
The model parameter that encodes a node label position within FreeNodeLabelModel. |
Constructor Summary | |
---|---|
FreeNodeLabelModel()
Returns a new instance of FreeNodeLabelModel. |
Method Summary | |
---|---|
Object |
createModelParameter(OrientedRectangle labelBounds,
NodeLayout nodeLayout)
Creates a model parameter that represents the given node label context best within this model. |
Object |
getDefaultParameter()
Returns a model parameter that encodes the default position of this model's allowed node label positions. |
YList |
getLabelCandidates(NodeLabelLayout nl,
NodeLayout nodeLayout)
Returns a list of candidate positions for the given node label. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
NodeLayout nodeLayout,
Object param)
Returns the oriented label position and bounds 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()
Method Detail |
---|
public Object getDefaultParameter()
The offset is set to a default value of -20 pixel for both directions, i.e., the node label's upper-left corner is placed 20 pixel to the left and 20 pixel above the node.
getDefaultParameter
in interface NodeLabelModel
NodeLabelModel.getLabelPlacement(YDimension, NodeLayout, Object)
method.public OrientedRectangle getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, Object param)
NodeLabelModel
getLabelPlacement
in interface NodeLabelModel
labelSize
- The size of the label that should be placed.nodeLayout
- The layout of the node to which the label belongs.param
- The model parameter that describes the abstract position of
the label within this model. The parameter must have been generated by
this model.
public YList getLabelCandidates(NodeLabelLayout nl, NodeLayout nodeLayout)
getLabelCandidates
in interface NodeLabelModel
nl
- The label layout for which candidates should be generated.nodeLayout
- The layout of the node to which the label belongs.
NodeLabelCandidate
objects.public Object createModelParameter(OrientedRectangle labelBounds, NodeLayout nodeLayout)
NodeLabelModel
createModelParameter
in interface NodeLabelModel
labelBounds
- The bounds of the label for which a parameter representation is sought.nodeLayout
- The layout of the node to which the label belongs.
NodeLabelModel.getLabelPlacement(YDimension, NodeLayout, Object)
method.
|
© Copyright 2000-2013, yWorks GmbH. All rights reserved. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |