|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.DiscreteEdgeLabelModel
An edge label model that allows placement of labels at some positions along an edge.
It's possible to specify an distance value that controls the distance between label and edge. Furthermore there's the possibility to mask out arbitrary edge label candidates. This can either be done by specifing predefined candidate masks or by or-ing allowed label candidates to a user defined mask.
Field Summary | |
static int |
CENTER
|
static int |
CENTERED
|
static int |
HEAD
|
static int |
SCENTER
|
static int |
SHEAD
|
static int |
SIX_POS
|
static int |
STAIL
|
static int |
TAIL
|
static int |
TCENTER
|
static int |
THEAD
|
static int |
THREE_CENTER
|
static int |
TTAIL
|
static int |
TWO_POS
|
Constructor Summary | |
DiscreteEdgeLabelModel()
Returns a new instance of DiscreteEdgeLabelModel. |
|
DiscreteEdgeLabelModel(int candidateMask)
Returns a new instance of DiscreteEdgeLabelModel. |
Method Summary | |
Object |
createModelParameter(YRectangle labelBounds,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode)
Creates a model parameter that represents the given edge label context best within this model. |
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. |
protected YPoint |
getLabelPlacement(YDimension labelSize,
EdgeLayout edgeLayout,
NodeLayout sourceNode,
NodeLayout targetNode,
int pos)
Return the position for a given label model parameter |
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. |
boolean |
isParameterValid(Object parameter)
Returns if a given parameter is valid in the model. |
void |
setDistance(double value)
Sets the distance from 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 int SHEAD
public static final int HEAD
public static final int THEAD
public static final int STAIL
public static final int TAIL
public static final int TTAIL
public static final int SCENTER
public static final int CENTER
public static final int TCENTER
public static final int TWO_POS
public static final int CENTERED
public static final int SIX_POS
public static final int THREE_CENTER
Constructor Detail |
public DiscreteEdgeLabelModel()
SIX_POS
.
public DiscreteEdgeLabelModel(int candidateMask)
candidateMask
- the allowed positions for the label.Method Detail |
public void setDistance(double value)
public Object getDefaultParameter()
getDefaultParameter
in interface EdgeLabelModel
public Object createModelParameter(YRectangle 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.public boolean isParameterValid(Object parameter)
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.protected YPoint getLabelPlacement(YDimension labelSize, EdgeLayout edgeLayout, NodeLayout sourceNode, NodeLayout targetNode, int pos)
|
© 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 |