|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.layout.DiscreteNodeLabelModel
A node label model that allows placement of labels at eight positions around a node and at four positions inside the node.
It's possible to specify an inset value that controls the distance between label and node. Furthermore there's the possibility to mask out arbitrary node 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 |
BOTTOM
Symbolic position specifier. |
static int |
BOTTOM_LEFT
Symbolic position specifier. |
static int |
BOTTOM_RIGHT
Symbolic position specifier. |
static int |
CENTER
Symbolic position specifier. |
static int |
CORNER_MASK
Position mask that constrains the positions to DiscreteNodeLabelModel.NORTH_EAST , DiscreteNodeLabelModel.NORTH_WEST , DiscreteNodeLabelModel.SOUTH_EAST and DiscreteNodeLabelModel.SOUTH_WEST . |
static int |
EAST
Symbolic position specifier. |
static int |
EIGHT_POS_MASK
Position mask that allows only the eight node-external positions. |
static int |
INTERNAL_MASK
Position mask that allows only the eight node-internal positions. |
static int |
LEFT
Symbolic position specifier. |
static int |
NORTH
Symbolic position specifier. |
static int |
NORTH_EAST
Symbolic position specifier. |
static int |
NORTH_WEST
Symbolic position specifier. |
static int |
RIGHT
Symbolic position specifier. |
static int |
SANDWICH_MASK
Position mask that constrains the positions to DiscreteNodeLabelModel.NORTH and DiscreteNodeLabelModel.SOUTH . |
static int |
SIDES_MASK
Position mask that constrains the positions to DiscreteNodeLabelModel.EAST , DiscreteNodeLabelModel.WEST , DiscreteNodeLabelModel.NORTH and DiscreteNodeLabelModel.SOUTH . |
static int |
SOUTH
Symbolic position specifier. |
static int |
SOUTH_EAST
Symbolic position specifier. |
static int |
SOUTH_WEST
Symbolic position specifier. |
static int |
TOP
Symbolic position specifier. |
static int |
TOP_LEFT
Symbolic position specifier. |
static int |
TOP_RIGHT
Symbolic position specifier. |
static int |
WEST
Symbolic position specifier. |
Constructor Summary | |
DiscreteNodeLabelModel()
Returns a new instance of DiscreteNodeLabelModel. |
|
DiscreteNodeLabelModel(int candidateMask)
Returns a new instance of DiscreteNodeLabelModel. |
|
DiscreteNodeLabelModel(int candidateMask,
double inset)
Returns a new instance of DiscreteNodeLabelModel. |
Method Summary | |
Object |
getDefaultParameter()
Returns the default position. |
YList |
getLabelCandidates(NodeLabelLayout nl,
NodeLayout nodeLayout)
Returns a list of candidate positions for label. |
protected YPoint |
getLabelPlacement(YDimension labelSize,
NodeLayout nodeLayout,
int pos)
Returns the position for a given label model parameter |
YPoint |
getLabelPlacement(YDimension labelSize,
NodeLayout nodeLayout,
Object param)
Returns the positions of the lower upper corner of the label with given parameter. |
boolean |
isParameterValid(Object parameter)
Returns if a given parameter is valid in the model. |
void |
setDistance(double distance)
Sets the distance of the label to the node for external label positions. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NORTH
public static final int NORTH_WEST
public static final int NORTH_EAST
public static final int EAST
public static final int WEST
public static final int SOUTH
public static final int SOUTH_WEST
public static final int SOUTH_EAST
public static final int CENTER
public static final int BOTTOM
public static final int TOP
public static final int LEFT
public static final int RIGHT
public static final int TOP_LEFT
public static final int TOP_RIGHT
public static final int BOTTOM_LEFT
public static final int BOTTOM_RIGHT
public static final int SANDWICH_MASK
DiscreteNodeLabelModel.NORTH
and DiscreteNodeLabelModel.SOUTH
.
public static final int INTERNAL_MASK
public static final int SIDES_MASK
DiscreteNodeLabelModel.EAST
, DiscreteNodeLabelModel.WEST
, DiscreteNodeLabelModel.NORTH
and DiscreteNodeLabelModel.SOUTH
.
public static final int CORNER_MASK
DiscreteNodeLabelModel.NORTH_EAST
, DiscreteNodeLabelModel.NORTH_WEST
, DiscreteNodeLabelModel.SOUTH_EAST
and DiscreteNodeLabelModel.SOUTH_WEST
.
public static final int EIGHT_POS_MASK
Constructor Detail |
public DiscreteNodeLabelModel()
INTERNAL
and the distance to the node
is set to 4.
public DiscreteNodeLabelModel(int candidateMask)
candidateMask
- the allowed positions for the label.public DiscreteNodeLabelModel(int candidateMask, double inset)
candidateMask
- the allowed positions for the label.inset
- the distance of the label to the node.Method Detail |
public void setDistance(double distance)
distance
- a nonnegative integer.public Object getDefaultParameter()
getDefaultParameter
in interface NodeLabelModel
public boolean isParameterValid(Object parameter)
public YPoint getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, Object param)
getLabelPlacement
in interface NodeLabelModel
labelSize
- the size of the label.nodeLayout
- the geometric description of the labeled node.param
- an instance of Integer containing a vaild position.public YList getLabelCandidates(NodeLabelLayout nl, NodeLayout nodeLayout)
getLabelCandidates
in interface NodeLabelModel
protected YPoint getLabelPlacement(YDimension labelSize, NodeLayout nodeLayout, 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 |