Search this API

y.view
Class EdgeLabel

java.lang.Object
  extended by y.view.YLabel
      extended by y.view.EdgeLabel
All Implemented Interfaces:
EdgeLabelLayout, LabelLayout, LabelLayoutConstants

public class EdgeLabel
extends YLabel
implements EdgeLabelLayout

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.SelectionChangeHandler, 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 CUSTOM_LABEL_MODEL
          Edge label model specifier that signals that a user-defined, custom EdgeLabelModel is used.
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, offsetRectangle, 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_SOURCE_PORT, PLACE_AT_TARGET, PLACE_AT_TARGET_PORT, 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(java.lang.String str)
          Default: CENTERED labeling and visible.
EdgeLabel(java.lang.String st, byte mode)
          Edge Label with positioning model mode.
 
Method Summary
 void adoptValues(YLabel label)
          Adopts the values from the given label.
static java.util.Vector availablePositions(java.lang.Byte model)
          Returns the possible edge label position specifiers for the given model.
 void bindRealizer(EdgeRealizer r)
          Binds the given edge realizer to this label.
 void calculateOffset()
          Calculates the offset coordinates of this label.
 java.lang.Object clone()
          Returns a copy of this instance
 java.lang.Object getBestModelParameterForBounds(OrientedRectangle bounds)
          Returns the best model parameter for this label such that the label's oriented bounds will match the specified bounds as closely as possible within the label's current label model.
 java.lang.Object getBestModelParameterForLocation(double x, double y)
          Returns the best model parameter for this label at the given location.
 java.lang.Object getBestModelParameterForOffset(double offsetX, double offsetY)
          Returns the best model parameter for this label with the given offset.
 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.
 java.lang.Object getModelParameter()
          Returns the current parameter of the edge label model.
 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.
 OrientedRectangle getOrientedBox()
          Returns the label's oriented bounding box.
 EdgeRealizer getOwner()
          Returns the realizer that is bound to this edge label.
 byte getPosition()
          Returns the actual position of the label.
 byte getPreferredPlacement()
          Deprecated. use getPreferredPlacementDescriptor() instead.
 PreferredPlacementDescriptor getPreferredPlacementDescriptor()
          Determines a descriptor that holds information about where, on which side of the edge and with which orientation to place the edge label, preferably.
 double getRatio()
          Returns the source-target distance ratio of the label.
 EdgeRealizer getRealizer()
          Returns the realizer that is bound to this edge label.
 boolean hasFreePositioning()
          Determines whether or not this label has free positioning.
 boolean hasSliderPositioning()
          Determines whether the model is CENTER_SLIDER or SIDE_SLIDER.
static java.util.Map modelToStringMap()
          Creates a map that maps the model constants to strings.
static java.util.Map positionToStringMap()
          Creates a map that maps the position constants to strings.
static java.util.Map preferredPlacementsToStringMap()
          Creates a map that maps the preferred placement constant to strings.
 void read(java.io.ObjectInputStream in)
          Deprecated. Use the GraphML format instead.
 void repaint()
          Triggers a repaint of the bounds of this label in all views.
 void setConfiguration(java.lang.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)
          Deprecated. Use setLabelModel(y.layout.EdgeLabelModel, Object) instead.
 void setLabelModel(EdgeLabelModel m, java.lang.Object p)
          Sets the edgeLabelModel implementation and a suitable model parameter.
 void setModel(byte mo)
          Sets the placement model for this label.
 void setModelParameter(java.lang.Object param)
          Sets the current parameter for the edge label model.
 void setOffset(double x, double y)
          Deprecated. Client code should not set a label's offset directly, but rather use getBestModelParameterForBounds(y.geom.OrientedRectangle) and setModelParameter(Object) to create and specify a parameter that represents the desired label position in the label's model.
 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)
          Deprecated. use setPreferredPlacementDescriptor(y.layout.PreferredPlacementDescriptor) instead.
 void setPreferredPlacementDescriptor(PreferredPlacementDescriptor descriptor)
          Specifies a descriptor that holds information about where, on which side of the edge, and with which orientation to place edge label, preferably.
 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(java.lang.String text)
          Sets the text of this edge label.
 void write(java.io.ObjectOutputStream out)
          Deprecated. Use the GraphML format instead.
 
Methods inherited from class y.view.YLabel
calculateSize, calculateSize, calcUnionRect, contains, getAlignment, getAutoSizePolicy, getBackgroundColor, getBox, getConfiguration, getContentBox, getContentHeight, getContentWidth, getFont, getFontName, getFontSize, getFontStyle, getHeight, getHorizontalTextPosition, getIcon, getIconBox, getIconLocation, getIconTextGap, getInsets, getLineColor, getLocation, getModel, getOffset, getOffsetX, getOffsetY, getRotationAngle, getText, getTextBox, getTextColor, getTextLocation, getUserData, getVerticalTextPosition, getWidth, internalSetAutoSizePolicy, internalSetOffsetDirty, internalSetSizeDirty, intersects, isFractionMetricsForSizeCalculationEnabled, isOffsetDirty, isSelected, isSizeDirty, isUnderlinedTextEnabled, isVisible, paint, paintBox, paintContent, paintImpl, setAlignment, setAutoSizePolicy, setBackgroundColor, setContentHeight, setContentSize, setContentWidth, setFont, setFontName, setFontSize, setFontStyle, setFractionMetricsForSizeCalculationEnabled, setHorizontalTextPosition, setHTMLRenderingEnabled, setIcon, setIconTextGap, setInsets, setLineColor, setOffset, setOffsetX, setOffsetY, setRotationAngle, setSelected, setTextColor, setUnderlinedTextEnabled, setUserData, setVerticalTextPosition, setVisible, toString, transformCTW
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface y.layout.LabelLayout
getBox
 

Field Detail

HEAD

public static final byte HEAD
Edge label position specifier. Places the label at the center of the longest edge segment above the segment.

See Also:
Constant Field Values

TAIL

public static final byte TAIL
Edge label position specifier. Places the label at the center of the longest edge segment below the segment.

See Also:
Constant Field Values

CENTER

public static final byte CENTER
Edge label position specifier. Places the label at the center of the longest edge segment.

See Also:
Constant Field Values

SHEAD

public static final byte SHEAD
Edge label position specifier. Places the label at the source node above the edge segment.

See Also:
Constant Field Values

THEAD

public static final byte THEAD
Edge label position specifier. Places the label at the target node above the edge segment.

See Also:
Constant Field Values

STAIL

public static final byte STAIL
Edge label position specifier. Places the label at the source node below the edge segment.

See Also:
Constant Field Values

TTAIL

public static final byte TTAIL
Edge label position specifier. Places the label at the target node below the edge segment.

See Also:
Constant Field Values

SCENTR

public static final byte SCENTR
Edge label position specifier. Places the label at the source node centered on the edge segment.

See Also:
Constant Field Values

TCENTR

public static final byte TCENTR
Edge label position specifier. Places the label at the target node centered on the edge segment.

See Also:
Constant Field Values

ANYWHERE

public static final byte ANYWHERE
Edge label position specifier. The position can be anywhere and depends on the specified label offset.

See Also:
Constant Field Values

CENTER_RATIO

public static final byte CENTER_RATIO
Edge label position specifier. Places the label on the edge path. The actual placement depends on a ratio value between 0.0 and 1.0.

See Also:
Constant Field Values

TAIL_RATIO

public static final byte TAIL_RATIO
Edge label position specifier. Places the label below the edge path. The actual placement depends on a ratio value between 0.0 and 1.0.

See Also:
Constant Field Values

HEAD_RATIO

public static final byte HEAD_RATIO
Edge label position specifier. Places the label above the edge path. The actual placement depends on a ratio value between 0.0 and 1.0.

See Also:
Constant Field Values

DYNAMIC

public static final byte DYNAMIC
Edge label position specifier for label models SIDE_SLIDER and CENTER_SLIDER. Places the label dynamically.

See Also:
Constant Field Values

UNDEFINED

public static final byte UNDEFINED
See Also:
Constant Field Values

TWO_POS

public static final byte TWO_POS
Edge label model specifier. Valid positions for this model are HEAD and TAIL.

See Also:
setModel(byte), Constant Field Values

CENTERED

public static final byte CENTERED
Edge label model specifier. Valid position for this model is CENTER.

See Also:
setModel(byte), Constant Field Values

SIX_POS

public static final byte SIX_POS
Edge label model specifier. Valid positions for this model are HEAD, SHEAD, THEAD, TAIL, STAIL and TTAIL.

See Also:
setModel(byte), Constant Field Values

THREE_CENTER

public static final byte THREE_CENTER
Edge label model specifier. Valid positions for this model are CENTER, SCENTR and TCENTR.

See Also:
setModel(byte), Constant Field Values

FREE

public static final byte FREE
Edge label model specifier. Valid position for this model is ANYWHERE.

See Also:
setModel(byte), Constant Field Values

CENTER_SLIDER

public static final byte CENTER_SLIDER
Edge label model specifier. Valid position for this model is DYNAMIC.

See Also:
setModel(byte), Constant Field Values

SIDE_SLIDER

public static final byte SIDE_SLIDER
Edge label model specifier. Valid position for this model is DYNAMIC.

See Also:
setModel(byte), Constant Field Values

CUSTOM_LABEL_MODEL

public static final byte CUSTOM_LABEL_MODEL
Edge label model specifier that signals that a user-defined, custom EdgeLabelModel is used. This specifier should not be used directly, rather a custom NodeLabelModel should be set using setLabelModel(y.layout.EdgeLabelModel,java.lang.Object).

Note: When copying/cloning an edge label (via adoptValues(YLabel)), custom label models are copied by reference. I.e. the original/prototype label instance and the copied label instance will share the custom model instance.

See Also:
Constant Field Values
Constructor Detail

EdgeLabel

public EdgeLabel(java.lang.String st,
                 byte mode)
Edge Label with positioning model mode. Default for 2-pos is head.


EdgeLabel

public EdgeLabel(java.lang.String str)
Default: CENTERED labeling and visible.


EdgeLabel

public EdgeLabel()
Default is visible label with empty text, model 2-pos

Method Detail

clone

public java.lang.Object clone()
Returns a copy of this instance

Overrides:
clone in class java.lang.Object

adoptValues

public void adoptValues(YLabel label)
Adopts the values from the given label.

Overrides:
adoptValues in class YLabel

calculateOffset

public void calculateOffset()
Calculates the offset coordinates of this label. The location of a label depends on its model and model position.

Specified by:
calculateOffset in class YLabel

setText

public void setText(java.lang.String text)
Sets the text of this edge label. If this label is bound to a Graph2D the a Graph2DEvent with this label as the subject will be emitted to all registered Graph2DListeners.

Overrides:
setText in class YLabel

setDistance

public void setDistance(double _distance)
Sets the distance of the label to the edge. If the current label model is an instance of this method calls the model's setDistance (or in the case of SliderEdgeLabelModel the setDistances) method with the given distance value. All other types of label models (including SmartEdgeLabelModel) are ignored.


setOffset

public void setOffset(double x,
                      double y)
Deprecated. Client code should not set a label's offset directly, but rather use getBestModelParameterForBounds(y.geom.OrientedRectangle) and setModelParameter(Object) to create and specify a parameter that represents the desired label position in the label's model.

Sets the positional offset for this label. Offsets are measured relative to the source intersection point of the label's edge. Invoking this method is equivalent to calling
setOffset(new OrientedRectangle(x, y + height, width, height));

Overrides:
setOffset in class YLabel
Parameters:
x - the x-offset of the upper left corner of a paraxial rectangle relative to the x-coordinate of the source intersection point of the label's edge.
y - the y-offset of the upper left corner of a paraxial rectangle relative to the y-coordinate of the source intersection point of the label's edge.

getDistance

public double getDistance()
Returns the distance of the label to the edge.


setPreferredPlacement

public void setPreferredPlacement(byte placement)
Deprecated. use setPreferredPlacementDescriptor(y.layout.PreferredPlacementDescriptor) instead.

Specifies the preferred placement for label aware layout algorithms.

Defaults to LabelLayoutConstants.PLACE_ANYWHERE.

Note: Invoking this method will replace the edge label's preferred placement descriptor with an immutable descriptor instance corresponding to the specified placement mask.

Parameters:
placement - an ORed combination of LabelLayoutConstants.PLACE_ANYWHERE, LabelLayoutConstants.PLACE_AT_SOURCE, LabelLayoutConstants.PLACE_AT_TARGET, LabelLayoutConstants.PLACE_AT_SOURCE_PORT, LabelLayoutConstants.PLACE_AT_TARGET_PORT or LabelLayoutConstants.PLACE_AT_CENTER and LabelLayoutConstants.PLACE_LEFT_OF_EDGE, LabelLayoutConstants.PLACE_RIGHT_OF_EDGE, or LabelLayoutConstants.PLACE_ON_EDGE.
See Also:
setPreferredPlacement(byte)

getPreferredPlacement

public byte getPreferredPlacement()
Deprecated. use getPreferredPlacementDescriptor() instead.

Returns the preferred placement for label aware layout algorithms.

Defaults to LabelLayoutConstants.PLACE_ANYWHERE.

Returns:
an ORed combination of LabelLayoutConstants.PLACE_ANYWHERE, LabelLayoutConstants.PLACE_AT_SOURCE, LabelLayoutConstants.PLACE_AT_TARGET, LabelLayoutConstants.PLACE_AT_SOURCE_PORT, LabelLayoutConstants.PLACE_AT_TARGET_PORT or LabelLayoutConstants.PLACE_AT_CENTER and LabelLayoutConstants.PLACE_LEFT_OF_EDGE, LabelLayoutConstants.PLACE_RIGHT_OF_EDGE, or LabelLayoutConstants.PLACE_ON_EDGE.
See Also:
setPreferredPlacement(byte)

getPreferredPlacementDescriptor

public PreferredPlacementDescriptor getPreferredPlacementDescriptor()
Determines a descriptor that holds information about where, on which side of the edge and with which orientation to place the edge label, preferably.

Note: The default descriptor is immutable. Moreover, a cloned label shares the original label's descriptor instance. (Most notably, labels are cloned when copying an EdgeRealizer instance with labels.) Therefore client code should set a new descriptor instance to adjust preferred placement of edge labels.

Specified by:
getPreferredPlacementDescriptor in interface EdgeLabelLayout
Returns:
the preferred placement descriptor.
See Also:
setPreferredPlacementDescriptor(y.layout.PreferredPlacementDescriptor)

setPreferredPlacementDescriptor

public void setPreferredPlacementDescriptor(PreferredPlacementDescriptor descriptor)
Specifies a descriptor that holds information about where, on which side of the edge, and with which orientation to place edge label, preferably.

Parameters:
descriptor - the new preferred placement descriptor.
Throws:
java.lang.IllegalArgumentException - if the specified descriptor is null.
See Also:
getPreferredPlacementDescriptor()

getRatio

public double getRatio()
Returns the source-target distance ratio of the label.

See Also:
setRatio(double)

setRatio

public void setRatio(double rat)
Sets the source-target distance ratio of the label.

See Also:
getRatio()

getBestModelParameterForBounds

public java.lang.Object getBestModelParameterForBounds(OrientedRectangle bounds)
Returns the best model parameter for this label such that the label's oriented bounds will match the specified bounds as closely as possible within the label's current label model. This method will return null if no suitable parameter can be determined (e.g. if this label is not associated to a "live" edge).

Specified by:
getBestModelParameterForBounds in class YLabel
Parameters:
bounds - the desired label bounds in absolute world coordinates.
Returns:
the model parameter that encodes the best match for the specified absolute bounds or null if no suitable model parameter could be determined.

getBestModelParameterForOffset

public java.lang.Object getBestModelParameterForOffset(double offsetX,
                                                       double offsetY)
Returns the best model parameter for this label with the given offset. The specified coordinates are interpreted as offset from the source intersection point of this label's associated edge to a paraxial rectangle whose width and height equal this label's width and height.

Parameters:
offsetX - the offset in x-direction from the source intersection point of this label's associated edge to the desired label bounds.
offsetY - the offset in y-direction from the source intersection point of this label's associated edge to the desired label bounds.
Returns:
the model parameter that encodes the best match for the specified offset.

getBestModelParameterForLocation

public java.lang.Object getBestModelParameterForLocation(double x,
                                                         double y)
Returns the best model parameter for this label at the given location. The specified coordinates are interpreted as the upper left corner of a paraxial rectangle whose width and height equal this label's width and height.

Parameters:
x - the x-coordinate of the upper left corner of the desired label bounds.
y - the y-coordinate of the upper left corner of the desired label bounds.
Returns:
the model parameter that encodes the best match for the specified location.

hasFreePositioning

public boolean hasFreePositioning()
Determines whether or not this label has free positioning. To specify the position for a label with free positioning use
label.setModelParameter(label.getBestModelParameterForBounds(newBounds));
with an OrientedRectangle newBounds that specifies the desired position (and orientation) for the label.


hasSliderPositioning

public boolean hasSliderPositioning()
Determines whether the model is CENTER_SLIDER or SIDE_SLIDER.


setModel

public void setModel(byte mo)
Sets the placement model for this label. Each model defines a set of legal positions for a label and each position defines an coordinate where the label will be placed.

Note: Client code should not use CUSTOM_LABEL_MODEL here. Custom edge label models should be set using setLabelModel(y.layout.EdgeLabelModel,java.lang.Object).

Overrides:
setModel in class YLabel
Parameters:
mo - one of

getPosition

public byte getPosition()
Returns the actual position of the label.

Overrides:
getPosition in class YLabel

setPosition

public void setPosition(byte p)
Determines which position the label should have in relation to the node. (e.g. CENTER). The position has to be valid in the current model.

Overrides:
setPosition in class YLabel

modelToStringMap

public static java.util.Map modelToStringMap()
Creates a map that maps the model constants to strings.


positionToStringMap

public static java.util.Map positionToStringMap()
Creates a map that maps the position constants to strings.


preferredPlacementsToStringMap

public static java.util.Map preferredPlacementsToStringMap()
Creates a map that maps the preferred placement constant to strings.


getModelPositions

public static final byte[] getModelPositions(byte model)
Returns the possible edge label position specifiers for the given model specifier.

Parameters:
model - An edge label model specifier.
Returns:
the possible edge label position specifiers for the given model

getModelPositions

public byte[] getModelPositions()
Returns the possible positions for the model that is set for this label instance.


availablePositions

public static java.util.Vector availablePositions(java.lang.Byte model)
Returns the possible edge label position specifiers for the given model.

Parameters:
model - A Byte whose byte value represents a valid edge label model specifier.

getEdge

public Edge getEdge()
Returns the Edge this EdgeLabel is associated with.


getGraph2D

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.


getRealizer

public EdgeRealizer getRealizer()
Returns the realizer that is bound to this edge label. Calls getOwner().

See Also:
EdgeRealizer.addLabel(EdgeLabel), bindRealizer(EdgeRealizer)

getOwner

public EdgeRealizer getOwner()
Returns the realizer that is bound to this edge label.

See Also:
EdgeRealizer.addLabel(EdgeLabel), bindRealizer(EdgeRealizer)

bindRealizer

public void bindRealizer(EdgeRealizer r)
Binds the given edge realizer to this label.

Parameters:
r - the realizer to which this label will be associated.

getLabelModel

public EdgeLabelModel getLabelModel()
Returns the edge label model that determines the placement of this label instance.

Specified by:
getLabelModel in interface EdgeLabelLayout
Returns:
the EdgeLabelModel associated with this EdgeLabelLayout

getModelParameter

public java.lang.Object getModelParameter()
Returns the current parameter of the edge label model.

Specified by:
getModelParameter in interface LabelLayout
Returns:
the model parameter that determines the placement of this label instance.
See Also:
LabelLayout.setModelParameter(Object)

setModelParameter

public void setModelParameter(java.lang.Object param)
Sets the current parameter for the edge label model.

Specified by:
setModelParameter in interface LabelLayout
Specified by:
setModelParameter in class YLabel
Parameters:
param - the model parameter that determines the placement of this label instance.

setLabelModel

public void setLabelModel(EdgeLabelModel m)
Deprecated. Use setLabelModel(y.layout.EdgeLabelModel, Object) instead.

Sets the edge label model that determines the placement of this label instance.


setLabelModel

public void setLabelModel(EdgeLabelModel m,
                          java.lang.Object p)
Sets the edgeLabelModel implementation and a suitable model parameter.

Additionally, this realizer's model property is updated according to the specified EdgeLabelModel:

For all other EdgeLabelModel implementations (including subclasses of the above mentioned types), the model property will be set to CUSTOM_LABEL_MODEL.

Parameters:
m - the EdgeLabelModel implementation to be used.
p - a model parameter suitable for the specified label model.

setOffsetDirty

public void setOffsetDirty()
Description copied from class: YLabel
Marks the label offsets as dirty.

Overrides:
setOffsetDirty in class YLabel

setSizeDirty

public void setSizeDirty()
Description copied from class: YLabel
Marks the size of the label as dirty

Overrides:
setSizeDirty in class YLabel

getOrientedBox

public OrientedRectangle getOrientedBox()
Returns the label's oriented bounding box. The oriented box is determined by interpreting the label's offset relative to the source intersection point of the label's associated realizer. The oriented box is given in absolute world coordinates.

Specified by:
getOrientedBox in interface LabelLayout
Specified by:
getOrientedBox in class YLabel
Returns:
the label's oriented bounding box.
See Also:
YLabel.getContentBox()

repaint

public void repaint()
Triggers a repaint of the bounds of this label in all views.

Specified by:
repaint in class YLabel
See Also:
YLabel.getBox(), View.updateView(double, double, double, double)

write

public void write(java.io.ObjectOutputStream out)
           throws java.io.IOException
Deprecated. Use the GraphML format instead.

Description copied from class: YLabel
Writes out this label in a serialized form.

Overrides:
write in class YLabel
Throws:
java.io.IOException

read

public void read(java.io.ObjectInputStream in)
          throws java.io.IOException,
                 java.lang.ClassNotFoundException
Deprecated. Use the GraphML format instead.

Description copied from class: YLabel
Reads in the serialized form of this label. The label must have been written out before by it's YLabel.write(ObjectOutputStream) method.

Overrides:
read in class YLabel
Throws:
java.io.IOException
java.lang.ClassNotFoundException

setConfiguration

public void setConfiguration(java.lang.String name)
Description copied from class: YLabel
Configures this instance to use the configuration specified by the given name. A configuration must have been registered with the factory previously in order to work. This can be done by using the factory instances provided by NodeLabel.getFactory() and getFactory() respectively.

Specified by:
setConfiguration in class YLabel
Parameters:
name - the name of the configuration as it has been specified in YLabel.Factory.addConfiguration(String, java.util.Map)
See Also:
YLabel.Factory, YLabel.Factory.addConfiguration(String, java.util.Map)

getFactory

public static YLabel.Factory getFactory()
Retrieves the factory instance that can be used to store different configurations of pluggable node label behaviors.

Returns:
the factory singleton instance that can be used to register different configurations for node labels.
See Also:
YLabel.Factory.addConfiguration(String, java.util.Map), setConfiguration(String)

© Copyright 2000-2021,
yWorks GmbH.
All rights reserved.