|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objecty.view.YLabel
y.view.EdgeLabel
public class 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 edge path.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class y.view.YLabel |
|---|
YLabel.BoundsProvider, YLabel.Factory, YLabel.Layout, YLabel.Painter, YLabel.UserDataHandler |
| 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 SIDE_SLIDER
and 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, AUTOSIZE_CONTENT, AUTOSIZE_NONE, BOTTOM_TEXT_POSITION, CENTER_TEXT_POSITION, contentHeight, contentWidth, defaultInsets, height, LEFT_ALIGNED_TEXT_POSITION, LEFT_TEXT_POSITION, model, offsetDirty, offsetX, offsetY, placement, RIGHT_ALIGNED_TEXT_POSITION, RIGHT_TEXT_POSITION, sizeDirty, TOP_TEXT_POSITION, 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 labeling 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)
Returns the possible edge label position specifiers for the given model. |
void |
bindRealizer(EdgeRealizer r)
Sets the realizer that renders this label. |
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 this label. |
double |
getDistance()
Returns the distance of the label to the edge. |
Edge |
getEdge()
Returns the Edge this EdgeLabel is associated with. |
static YLabel.Factory |
getFactory()
Retrieves the factory instance that can be used to store different configurations
of pluggable node label behaviors. |
protected Graph2D |
getGraph2D()
Returns that Graph2D instance that owns the Edge this edge is associated with or null
if this label is not associated with an Edge. |
EdgeLabelModel |
getLabelModel()
Returns the edge label model that determines the placement of this label instance. |
YPoint |
getLocation()
Returns the absolute coordinates of the labels location. |
Object |
getModelParameter()
Returns the parameters of the edge label model that determines the placement of this label instance. |
byte[] |
getModelPositions()
Returns the possible positions for the model that is set for this label instance. |
static byte[] |
getModelPositions(byte model)
Returns the possible edge label position specifiers for the given model specifier. |
EdgeRealizer |
getOwner()
Returns the realizer that renders this label. |
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 |
repaint()
Triggers a repaint of the bounds of this label in all views. |
void |
setConfiguration(String name)
Configures this instance to use the configuration specified by the given name. |
void |
setDistance(double _distance)
Sets the distance of the label to the edge. |
void |
setLabelModel(EdgeLabelModel m)
Sets the edge label model that determines the placement of this label instance. |
void |
setModel(byte mo)
Sets the placement model for this label. |
void |
setModelParameter(Object param)
EdgeLabelModel implementation. |
void |
setOffset(double x,
double y)
Sets the offset coordinates 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
SIDE_SLIDER
and 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 Objectpublic void adoptValues(YLabel label)
adoptValues in class YLabelpublic void calculateOffset()
calculateOffset in class YLabelpublic void setText(String text)
setText in class YLabelpublic void setDistance(double _distance)
public void setOffset(double x,
double y)
FREE. Otherwise
this method has no effect.
setOffset in class YLabelpublic double getDistance()
public void setPreferredPlacement(byte placement)
public byte getPreferredPlacement()
EdgeLabelLayout
getPreferredPlacement in interface EdgeLabelLayoutLabelLayoutConstants.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_EDGELabelLayoutConstantspublic 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 YLabelpublic byte getPosition()
getPosition in class YLabelpublic void setPosition(byte p)
setPosition in class YLabelpublic static Map modelToStringMap()
public static Map positionToStringMap()
public static Map preferredPlacementsToStringMap()
public static final byte[] getModelPositions(byte model)
model - An edge label model specifier.
public byte[] getModelPositions()
public static Vector availablePositions(Byte model)
model - A Byte whose byte value represents a valid edge label model specifier.public Edge getEdge()
protected Graph2D getGraph2D()
null
if this label is not associated with an Edge.
public EdgeRealizer getOwner()
public void bindRealizer(EdgeRealizer r)
public EdgeLabelModel getLabelModel()
getLabelModel in interface EdgeLabelLayoutpublic Object getModelParameter()
getModelParameter in interface LabelLayoutpublic void setModelParameter(Object param)
setModelParameter in interface LabelLayoutsetModelParameter in class YLabelparam - public void setLabelModel(EdgeLabelModel m)
public void setOffsetDirty()
YLabel
setOffsetDirty in class YLabelpublic void setSizeDirty()
YLabel
setSizeDirty in class YLabelpublic YRectangle getBox()
YLabel
getBox in interface LabelLayoutgetBox in class YLabelpublic void repaint()
repaint in class YLabelgetBox(),
View.updateView(double, double, double, double)public YPoint getLocation()
getLocation in class YLabel
public void write(ObjectOutputStream out)
throws IOException
YLabel
write in class YLabelIOException
public void read(ObjectInputStream in)
throws IOException,
ClassNotFoundException
YLabelYLabel.write(ObjectOutputStream) method.
read in class YLabelIOException
ClassNotFoundExceptionpublic void setConfiguration(String name)
YLabelNodeLabel.getFactory()
and getFactory() respectively.
setConfiguration in class YLabelname - the name of the configuration as it has been specified in YLabel.Factory.addConfiguration(String, java.util.Map)YLabel.Factory,
YLabel.Factory.addConfiguration(String, java.util.Map)public static YLabel.Factory getFactory()
configurations
of pluggable node label behaviors.
YLabel.Factory.addConfiguration(String, java.util.Map),
setConfiguration(String)
|
© Copyright 2000-2008, yWorks GmbH. All rights reserved. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||