|
Search this API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object y.layout.RotatedSliderEdgeLabelModel
public class RotatedSliderEdgeLabelModel
An edge label model that allows placement of labels at a set of continuous positions along both sides of an edge or directly on the edge path.
The set of positions can be influenced by specifying the density value that controls the spacing between adjacent label positions. Furthermore, it's possible to specify distance values that control the distance between label and edge and between label and nodes.
Field Summary | |
---|---|
static byte |
CENTER_SLIDER
Symbolic slider mode specifier. |
static byte |
SIDE_SLIDER
Symbolic slider mode specifier. |
static byte |
SINGLE_SIDE_SLIDER
Symbolic slider mode specifier. |
Constructor Summary | |
---|---|
RotatedSliderEdgeLabelModel(byte mode)
Returns a new instance of RotatedSliderEdgeLabelModel. |
Method Summary | |
---|---|
Object |
createModelParameter(OrientedRectangle labelBounds,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode)
Creates a model parameter that represents the given edge label context best within this model. |
double |
getAngle()
Returns the angle (measured in radians) of the label model. |
Object |
getDefaultParameter()
Returns a model parameter that encodes the default position of this model's allowed edge label positions. |
double |
getDistance()
Returns the distance between the label's box and the edge's path. |
YList |
getLabelCandidates(EdgeLabelLayout label,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode)
Returns a list of candidate positions for the given edge label. |
OrientedRectangle |
getLabelPlacement(YDimension labelSize,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode,
Object para)
Returns the bounds of the label for the position encoded by the given model parameter. |
byte |
getMode()
Returns the model's slider mode. |
boolean |
isAutoFlippingEnabled()
Determines whether or not edge labels get flipped if they would be upside down in their current position. |
boolean |
isAutoRotationEnabled()
Returns whether or not edge labels are automatically rotated according to the angle of the corresponding reference edge segment. |
boolean |
isDistanceRelativeToEdge()
Returns a value indicating whether the distance to the edge is interpreted relatively to the edge's path. |
void |
setAngle(double angle)
Sets the angle (measured in radians) of the label model. |
void |
setAutoFlippingEnabled(boolean autoFlippingEnabled)
Specifies whether or not edge labels get flipped if they would be upside down in their current position. |
void |
setAutoRotationEnabled(boolean enabled)
Specifies whether or not edge labels have to be automatically rotated according to the angle of the corresponding reference edge segment. |
void |
setDistance(double distance)
Sets the distance between the label's box and the edge's path. |
void |
setDistanceRelativeToEdge(boolean distanceRelativeToEdge)
Sets a value indicating whether the distance to the edge is interpreted relatively to the edge's path. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final byte CENTER_SLIDER
public static final byte SIDE_SLIDER
public static final byte SINGLE_SIDE_SLIDER
Constructor Detail |
---|
public RotatedSliderEdgeLabelModel(byte mode)
mode
- Determines which slider mode to use.
Possible values are CENTER_SLIDER
, SINGLE_SIDE_SLIDER
or SIDE_SLIDER
.Method Detail |
---|
public byte getMode()
public boolean isDistanceRelativeToEdge()
distance
is less than 0
and to the right of the
edge segment if distance
is greater than 0
.
If this value is not set, the label is placed below the edge segment
(in geometric sense) if distance
is less than 0
and above the edge segment if distance
is greater than
0
.
The default value is true
.
setDistanceRelativeToEdge(boolean)
,
setDistance(double)
public void setDistanceRelativeToEdge(boolean distanceRelativeToEdge)
distance
is less than 0
and to the right of the
edge segment if distance
is greater than 0
.
If this value is not set, the label is placed below the edge segment (in
geometric sense) if distance
ls less than 0
and
above the edge segment if distance
is greater than
0
.
The default value is true
.
isDistanceRelativeToEdge()
,
setDistance(double)
public double getDistance()
setDistance(double)
,
isDistanceRelativeToEdge()
,
setDistanceRelativeToEdge(boolean)
public void setDistance(double distance)
distanceRelativeToEdge
.
distance
- the distance between the label's box and the edge's path.getDistance()
,
isDistanceRelativeToEdge()
,
setDistanceRelativeToEdge(boolean)
public boolean isAutoRotationEnabled()
By default, this feature is enabled.
true
if edge labels are automatically rotated
according to the angle of the corresponding reference edge segment and
false
if they are not.setAutoRotationEnabled(boolean)
public void setAutoRotationEnabled(boolean enabled)
By default, this feature is enabled.
enabled
- true
if edge labels are automatically rotated
according to the angle of the corresponding reference edge segment.isAutoRotationEnabled()
public boolean isAutoFlippingEnabled()
By default, this feature is disabled.
true
if edge labels get flipped if they would be upside down in their current position,
false
otherwise.setAutoFlippingEnabled(boolean)
public void setAutoFlippingEnabled(boolean autoFlippingEnabled)
By default, this feature is disabled.
autoFlippingEnabled
- true
if edge labels get flipped if they would be upside down in their
current position.isAutoFlippingEnabled()
public double getAngle()
public void setAngle(double angle)
angle
- the angle of the label model.public Object getDefaultParameter()
getDefaultParameter
in interface EdgeLabelModel
EdgeLabelModel.getLabelPlacement(YDimension, EdgeLayout, NodeLayout, NodeLayout, Object)
method.public OrientedRectangle getLabelPlacement(YDimension labelSize, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode, Object para)
EdgeLabelModel
getLabelPlacement
in interface EdgeLabelModel
labelSize
- The size of the label that should be placed.edgeLayout
- The layout of the edge to which the label belongs.sourceNode
- The layout of the source node of the label owning edge.targetNode
- The layout of the target node of the label owning edge.para
- 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(EdgeLabelLayout label, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode)
getLabelCandidates
in interface EdgeLabelModel
label
- The label for which candidates should be generated.edgeLayout
- The layout of the edge to which the label belongs.sourceNode
- The layout of the source node of the label owning edge.targetNode
- The layout of the target node of the label owning edge.
EdgeLabelCandidate
objects.public Object createModelParameter(OrientedRectangle labelBounds, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode)
EdgeLabelModel
createModelParameter
in interface EdgeLabelModel
labelBounds
- The bounds of the label for which a parameter representation is sought.edgeLayout
- The layout of the edge to which the label belongs.sourceNode
- The layout of the source node of the label owning edge.targetNode
- The layout of the target node of the label owning edge.
EdgeLabelModel.getLabelPlacement(YDimension, EdgeLayout, NodeLayout, 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 |