|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--y.view.YLabel | +--y.view.EdgeLabel
This class represents a label associated with an EdgeRealizer.
EdgeLabel has special label models and positions that are suitable for placing the label along an edgepath.
Field Summary | |
static byte |
ANYWHERE
Edge label position specifier. |
static byte |
CENTER
Edge label position specifier. |
static byte |
CENTER_RATIO
Edge label position specifier. |
static byte |
CENTER_SLIDER
Edge label model specifier. |
static byte |
CENTERED
Edge label model specifier. |
static byte |
DYNAMIC
Edge label position specifier for label models EdgeLabel.SIDE_SLIDER
and EdgeLabel.CENTER_SLIDER .
|
static byte |
FREE
Edge label model specifier. |
static byte |
HEAD
Edge label position specifier. |
static byte |
HEAD_RATIO
Edge label position specifier. |
static byte |
SCENTR
Edge label position specifier. |
static byte |
SHEAD
Edge label position specifier. |
static byte |
SIDE_SLIDER
Edge label model specifier. |
static byte |
SIX_POS
Edge label model specifier. |
static byte |
STAIL
Edge label position specifier. |
static byte |
TAIL
Edge label position specifier. |
static byte |
TAIL_RATIO
Edge label position specifier. |
static byte |
TCENTR
Edge label position specifier. |
static byte |
THEAD
Edge label position specifier. |
static byte |
THREE_CENTER
Edge label model specifier. |
static byte |
TTAIL
Edge label position specifier. |
static byte |
TWO_POS
Edge label model specifier. |
static byte |
UNDEFINED
|
Fields inherited from class y.view.YLabel |
ALIGN_CENTER, ALIGN_LEFT, ALIGN_RIGHT, defaultInsets, height, model, offsetDirty, offsetX, offsetY, placement, sizeDirty, width |
Fields inherited from interface y.layout.LabelLayoutConstants |
PLACE_ANYWHERE, PLACE_AT_CENTER, PLACE_AT_SOURCE, PLACE_AT_TARGET, PLACE_LEFT_OF_EDGE, PLACE_ON_EDGE, PLACE_RIGHT_OF_EDGE, PLACEMENT_ALONG_EDGE_MASK, PLACEMENT_ON_SIDE_OF_EDGE_MASK |
Constructor Summary | |
EdgeLabel()
Default is visible label with empty text, model 2-pos |
|
EdgeLabel(String str)
Default: CENTERED labelling and visible. |
|
EdgeLabel(String st,
byte mode)
Edge Label with positioning model mode. |
Method Summary | |
void |
adoptValues(YLabel label)
Adopts the values from the given label. |
static Vector |
availablePositions(Byte model)
|
void |
bindRealizer(EdgeRealizer r)
|
void |
calculateOffset()
Calculates the offset coordinates of this label. |
Object |
clone()
Returns a copy of this instance |
Object |
getBestModelParameterForLocation(double x,
double y)
Returns the best model parameter for this label at the given location. |
Object |
getBestModelParameterForOffset(double offsetX,
double offsetY)
Returns the best model parameter for this label with the given offset. |
YRectangle |
getBox()
Returns the bounding box of the label |
double |
getDistance()
Returns the distance of the label to the edge. |
Edge |
getEdge()
|
protected Graph2D |
getGraph2D()
|
EdgeLabelModel |
getLabelModel()
Returns the edge label model associated with this label layout |
YPoint |
getLocation()
Returns the absolute coordinates of the labels locaalcOffion. |
Object |
getModelParameter()
Returns the label model parameter that describes the position of this label. |
byte[] |
getModelPositions()
|
static byte[] |
getModelPositions(byte model)
|
EdgeRealizer |
getOwner()
|
byte |
getPosition()
Returns the actual position of the label. |
byte |
getPreferredPlacement()
Returns the preferred placement of this label. |
double |
getRatio()
Returns the source-target distance ratio of the label |
boolean |
hasFreePositioning()
Whether or not this label has free positioning. |
boolean |
hasSliderPositioning()
|
static Map |
modelToStringMap()
|
static Map |
positionToStringMap()
|
static Map |
preferredPlacementsToStringMap()
|
void |
read(ObjectInputStream in)
Reads in the serialized form of this label. |
void |
setDistance(double _distance)
Sets the distance of the label to the edge. |
void |
setLabelModel(EdgeLabelModel m)
|
void |
setModel(byte mo)
Sets the placement model for this label. |
void |
setModelParameter(Object param)
Sets the label model parameter that describes the position of this label. |
void |
setOffset(double x,
double y)
Sets the offset coordinats of this label. |
void |
setOffsetDirty()
Marks the label offsets as dirty. |
void |
setPosition(byte p)
Determines which position the label should have in relation to the node. |
void |
setPreferredPlacement(byte placement)
|
void |
setRatio(double rat)
Sets the source-target distance ratio of the label |
void |
setSizeDirty()
Marks the size of the label as dirty |
void |
setText(String text)
Sets the text of this edge label. |
void |
write(ObjectOutputStream out)
Writes out this label in a serialized form. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final byte HEAD
public static final byte TAIL
public static final byte CENTER
public static final byte SHEAD
public static final byte THEAD
public static final byte STAIL
public static final byte TTAIL
public static final byte SCENTR
public static final byte TCENTR
public static final byte ANYWHERE
public static final byte CENTER_RATIO
public static final byte TAIL_RATIO
public static final byte HEAD_RATIO
public static final byte DYNAMIC
EdgeLabel.SIDE_SLIDER
and EdgeLabel.CENTER_SLIDER
.
Places the label dynamically.
public static final byte TWO_POS
HEAD
and TAIL
.
public static final byte CENTERED
CENTER
.
public static final byte SIX_POS
HEAD
, SHEAD
, THEAD
,
TAIL
, STAIL
and TTAIL
.
public static final byte THREE_CENTER
CENTER
, SCENTR
and TCENTR
.
public static final byte FREE
ANYWHERE
.
public static final byte CENTER_SLIDER
DYNAMIC
.
public static final byte SIDE_SLIDER
DYNAMIC
.
public static final byte UNDEFINED
Constructor Detail |
public EdgeLabel(String st, byte mode)
public EdgeLabel(String str)
public EdgeLabel()
Method Detail |
public Object clone()
clone
in class Object
public void adoptValues(YLabel label)
adoptValues
in class YLabel
public void calculateOffset()
calculateOffset
in class YLabel
public void setText(String text)
setText
in class YLabel
public void setDistance(double _distance)
public void setOffset(double x, double y)
EdgeLabel.FREE
. Otherwise
this method has no effect.
setOffset
in class YLabel
public double getDistance()
public void setPreferredPlacement(byte placement)
public byte getPreferredPlacement()
EdgeLabelLayout
getPreferredPlacement
in interface EdgeLabelLayout
LabelLayoutConstants.PLACE_ANYWHERE
, LabelLayoutConstants.PLACE_AT_SOURCE
,
LabelLayoutConstants.PLACE_AT_TARGET
or LabelLayoutConstants.PLACE_AT_CENTER
and
LabelLayoutConstants.PLACE_LEFT_OF_EDGE
, LabelLayoutConstants.PLACE_RIGHT_OF_EDGE
and LabelLayoutConstants.PLACE_ON_EDGE
LabelLayoutConstants
public void setRatio(double rat)
public Object getBestModelParameterForOffset(double offsetX, double offsetY)
public Object getBestModelParameterForLocation(double x, double y)
public double getRatio()
public boolean hasFreePositioning()
public boolean hasSliderPositioning()
public void setModel(byte mo)
setModel
in class YLabel
public byte getPosition()
getPosition
in class YLabel
public void setPosition(byte p)
setPosition
in class YLabel
public static Map modelToStringMap()
public static Map positionToStringMap()
public static Map preferredPlacementsToStringMap()
public static final byte[] getModelPositions(byte model)
public byte[] getModelPositions()
public static Vector availablePositions(Byte model)
public Edge getEdge()
protected Graph2D getGraph2D()
public EdgeRealizer getOwner()
public void bindRealizer(EdgeRealizer r)
public EdgeLabelModel getLabelModel()
EdgeLabelLayout
getLabelModel
in interface EdgeLabelLayout
public Object getModelParameter()
LabelLayout
getModelParameter
in interface LabelLayout
public void setModelParameter(Object param)
LabelLayout
setModelParameter
in interface LabelLayout
setModelParameter
in class YLabel
public void setLabelModel(EdgeLabelModel m)
public void setOffsetDirty()
YLabel
setOffsetDirty
in class YLabel
public void setSizeDirty()
YLabel
setSizeDirty
in class YLabel
public YRectangle getBox()
LabelLayout
getBox
in interface LabelLayout
getBox
in class YLabel
public YPoint getLocation()
getLocation
in class YLabel
public void write(ObjectOutputStream out) throws IOException
YLabel
write
in class YLabel
IOException
public void read(ObjectInputStream in) throws IOException, ClassNotFoundException
YLabel
YLabel.write(ObjectOutputStream)
method.
read
in class YLabel
IOException
ClassNotFoundException
|
© 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 |