|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.SliderEdgeLabelModel
This class implements the slider labeling model for edges.
Nested Class Summary | |
static class |
SliderEdgeLabelModel.ModelParameter
The model parameters for the slider model. |
Field Summary | |
static byte |
CENTER_RATIO
|
static byte |
CENTER_SLIDER
|
static byte |
HEAD_RATIO
|
static byte |
LEFT_RATIO
|
static byte |
RIGHT_RATIO
|
static byte |
SIDE_SLIDER
|
static byte |
TAIL_RATIO
|
Constructor Summary | |
SliderEdgeLabelModel(byte mode)
Returns a new slider edge model. |
Method Summary | |
Object |
createModelParameter(YRectangle labelBounds,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode)
Returns a model parameter that suits the given edge label context best. |
Object |
getDefaultParameter()
Returns the default position. |
YList |
getLabelCandidates(EdgeLabelLayout label,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode)
Returns a list of instances of EdgeLabelCandidates representing the label candidates. |
YPoint |
getLabelPlacement(YDimension labelSize,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode,
Object para)
Returns the location of the upper left corner of the label according to a certain parameter. |
YVector |
getOffsetVec(double dx,
double dy,
double width,
double height,
byte labelPosition)
Returns the offset vector for distances to the edge. |
void |
setDensity(double density)
Set the density to generate label candidate positions. |
void |
setDistances(double minDistance,
double maxDistance)
Set the minimum and maximum distance for the label to the edge. |
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 CENTER_RATIO
public static final byte TAIL_RATIO
public static final byte HEAD_RATIO
public static final byte LEFT_RATIO
public static final byte RIGHT_RATIO
Constructor Detail |
public SliderEdgeLabelModel(byte mode)
mode
- which slider model to use.Method Detail |
public void setDistances(double minDistance, double maxDistance)
minDistance
- the minimal distance from the label to the edge.maxDistance
- the maximal distance from the label to the edge.public void setDensity(double density)
density
- the density factor.public Object getDefaultParameter()
getDefaultParameter
in interface EdgeLabelModel
public YPoint getLabelPlacement(YDimension labelSize, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode, Object para)
getLabelPlacement
in interface EdgeLabelModel
labelSize
- the size of the label that should be placededgeLayout
- 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 paramter 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
- label for which candidates should be generatededgeLayout
- 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.public Object createModelParameter(YRectangle labelBounds, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode)
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.public YVector getOffsetVec(double dx, double dy, double width, double height, byte labelPosition)
|
© Copyright 2000-2003, yWorks GmbH. All rights reserved. 2003 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |