ilog.views.graphlayout.labellayout.annealing
Class IlvAnnealingPolylineLabelDescriptor

java.lang.Object
  extended by ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor
      extended by ilog.views.graphlayout.labellayout.annealing.IlvAnnealingPolylineLabelDescriptor
All Implemented Interfaces:
IlvPersistentObject

public class IlvAnnealingPolylineLabelDescriptor
extends IlvAnnealingLabelDescriptor
implements IlvPersistentObject

The class IlvAnnealingPolylineLabelDescriptor can be used to specify that the label should be placed close to a polyline (the polyline labeling problem). A typical application is to place labels of roads on a map. The roads can be represented by polylines. The labels should be close to the related roads, but they should not overlap each other and should not overlap any road.

The following are two sample drawings that show link/line labeling with polyline label descriptors. In the left drawing, the "Start Label", "End Label" and "Center Label" were anchored at the start, end, center, respectively, of the corresponding link. The right drawing shows a link with multiple labels that have the right side in local side association specified as allowed side.

Click on the image to see it in normal size.

Since:
JViews 5.0

Field Summary
static int CENTER
          Option for the label anchor.
static int END
          Option for the label anchor.
static int FREE
          Option for the label anchor.
static int GLOBAL
          Option for the side association.
static int LOCAL
          Option for the side association.
static int START
          Option for the label anchor.
 
Fields inherited from class ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor
actDistFromPath, actPathLocation, IGNORED, LABEL, maxDistFromPath, maxPathLocation, OBSTACLE
 
Constructor Summary
IlvAnnealingPolylineLabelDescriptor()
          Creates a new empty instance of a polyline label descriptor.
IlvAnnealingPolylineLabelDescriptor(IlvInputStream stream)
          Creates a new IlvAnnealingPolylineLabelDescriptor from an IlvInputStream.
IlvAnnealingPolylineLabelDescriptor(Object label, IlvLinkImage link, int anchor)
          Creates a new instance of a polyline link label descriptor.
IlvAnnealingPolylineLabelDescriptor(Object label, Object relatedObstacle, IlvPoint[] referencePoints, float lineWidth, float minPercentageFromStart, float maxPercentageFromStart, float prefPercentageFromStart, float maxDistFromPath, float preferredDistFromPath, int preferredSide, int allowedSide, int sideAssociation, float topOverlap, float bottomOverlap, float leftOverlap, float rightOverlap)
          Creates a new instance of a polyline label descriptor.
IlvAnnealingPolylineLabelDescriptor(Object label, Object relatedObstacle, IlvPoint[] referencePoints, float lineWidth, float minPercentageFromStart, float maxPercentageFromStart, float maxDistFromPath, float preferredDistFromPath, int preferredSide, int allowedSide, int sideAssociation, float topOverlap, float bottomOverlap, float leftOverlap, float rightOverlap)
          Creates a new instance of a polyline label descriptor.
IlvAnnealingPolylineLabelDescriptor(Object label, Object relatedObstacle, int anchor, int preferredSide, int allowedSide, int sideAssociation)
          Creates a new instance of a polyline label descriptor.
IlvAnnealingPolylineLabelDescriptor(Object label, Object link, Object source, Object target, int anchor, float maxDistFromLink, float preferredDistFromLink, int preferredSide, int allowedSide, int sideAssociation, float topOverlap, float bottomOverlap, float leftOverlap, float rightOverlap)
          Creates a new instance of a polyline link label descriptor.
 
Method Summary
 boolean considerObstacle(Object obstacle)
          Returns true if the overlap between the label and the input obstacle should be considered during the quality calculation of the Simulated Annealing label layout algorithm.
 int getAllowedSide()
          Returns the allowed side where the label is placed.
 int getAnchor()
          Returns the anchor of the label.
 float getBottomOverlap()
          Returns the amount the label can overlap the related obstacle or reference polyline at the bottom side of the label.
 IlvRect getBoundingBox()
           
 float getLeftOverlap()
          Returns the amount the label can overlap the related obstacle or reference polyline at the left side of the label.
 float getLineWidth()
          Returns the specified line width of the polyline given by the reference points.
 float getMaxDistFromPath()
          Returns the maximal distance from the location on the path.
 float getMaxPercentageFromStart()
          Returns the percentage relative to the length of the polyline that defines the end point of the area of the polyline that should be used for the label.
protected  float getMinDist(Object obstacle, float minDist)
          Returns the minimal distance value between this label and the input obstacle.
 float getMinPercentageFromStart()
          Returns the percentage relative to the length of the polyline that defines the start point of the area of the polyline that should be used for the label.
 Object getObject()
           
 float getPreferredDistFromPath()
          Returns the preferred distance from the location on the path.
 double getPreferredPathLocation()
          Returns the preferred location on the path.
 float getPreferredPercentageFromStart()
          Returns the percentage relative to the length of the polyline that defines the preferred position for the label.
 int getPreferredSide()
          Returns the preferred side where the label is placed.
 IlvPoint[] getReferencePoints()
          Returns a copy of the specified reference points that define the polyline where the label must be placed.
 Object getRelatedObstacle()
          Returns the obstacle that is related to the label.
 Object getRelatedObstacleSource()
          Returns the source node if the related obstacle is a link.
 Object getRelatedObstacleTarget()
          Returns the target node if the related obstacle is a link.
 float getRightOverlap()
          Returns the amount the label can overlap the related obstacle or reference polyline at the right side of the label.
 int getSideAssociation()
          Returns the side association of the label.
 float getTopOverlap()
          Returns the amount the label can overlap the related obstacle or reference polyline at the top side of the label.
 void initialize(IlvLabelingModel labelingModel)
          Initializes the label descriptor before layout.
 void setAllowedSide(int side)
          Sets the allowed side where the label is placed.
 void setAnchor(int anchor)
          Sets the anchor of the label.
 void setBottomOverlap(float overlap)
          Sets the amount the label can overlap the related obstacle or reference polyline at the bottom side of the label.
 void setBoundingBox(IlvRect bbox)
           
 void setLeftOverlap(float overlap)
          Sets the amount the label can overlap the related obstacle or reference polyline at the left side of the label.
 void setLineWidth(float lineWidth)
          Sets the line width of the polyline given by the reference points.
 void setMaxDistFromPath(float distance)
          Sets the maximal distance from the location on the path.
 void setMaxPercentageFromStart(float maxPercentage)
          Sets the percentage relative to the length of the polyline that defines the end point of the area of the polyline that should be used for the label.
 void setMinPercentageFromStart(float minPercentage)
          Sets the percentage relative to the length of the polyline that defines the start point of the area of the polyline that should be used for the label.
 void setPosition(double pathLocation, float distFromPath)
          Sets the label conceptually to the specified position.
 void setPreferredDistFromPath(float distance)
          Sets the preferred distance from the location on the path.
 void setPreferredPercentageFromStart(float prefPercentage)
          Sets the percentage relative to the length of the polyline that defines the preferred position for the label.
 void setPreferredSide(int side)
          Sets the preferred side where the label is placed.
 void setReferencePoints(IlvPoint[] points)
          Sets the reference points that define the polyline where the label must be placed.
 void setRelatedObstacle(Object obstacle)
          Sets the obstacle that is related to the label.
 void setRelatedObstacleSource(Object source)
          Sets the source node if the related obstacle is a link.
 void setRelatedObstacleTarget(Object target)
          Sets the target node if the related obstacle is a link.
 void setRightOverlap(float overlap)
          Sets the amount the label can overlap the related obstacle or reference polyline at the right side of the label.
 void setSideAssociation(int association)
          Returns the side association of the label.
 void setTopOverlap(float overlap)
          Sets the amount the label can overlap the related obstacle or reference polyline at the top side of the label.
 void setTowardsPreferredPosition(double pathLocation, float distFromPath, int i, int maxI)
          Sets the label to a position that is closer to the preferred position than the input position given by pathLocation and distFromPath.
 void write(IlvOutputStream stream)
          Writes the label descriptor to the output stream.
 
Methods inherited from class ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor
getLabel, getRotation, getTreatAs, setTreatAs, updatePosition
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL

public static final int LOCAL
Option for the side association. The side association defines the meaning of left, right, top and bottom on the polyline. With the local side association, a polyline has two sides: left and right. These sides are relative to the flow direction of the polyline from start to end.

Compare the polyline with a road: at any point of the road, you can determine the left and right side of the road by looking away from the start into the direction where the road continues towards the end of the road. Notice that if you have an object (e.g. a city) at the left side and the road makes a sharp bend by 180 degree, the object after the bend appear at the right side. Hence, the meaning of left and right is local to the road, not global like a compass direction.

See Also:
Constant Field Values

GLOBAL

public static final int GLOBAL
Option for the side association. The side association defines the meaning of left, right, top and bottom on the polyline. With the global side association, the left side is towards the smaller x-coordinates, the right side towards the larger x-coordinates, the top side towards the smaller y-coordinates, the bottom side towards the larger y coordinates.

In this case, the meaning of the sides is globally defined, like the compass directions. It is independent from the flow direction of the polyline line segments. If you compare it with a map of roads, then left is towards the west direction of the map, right is towards the east direction of the map, top is towards the north direction and bottom is the towards the south direction of the map.

See Also:
Constant Field Values

CENTER

public static final int CENTER
Option for the label anchor. The label is placed near the center of the polyline.

See Also:
Constant Field Values

START

public static final int START
Option for the label anchor. The label is placed near the start of the polyline.

See Also:
Constant Field Values

END

public static final int END
Option for the label anchor. The label is placed near the end of the polyline.

See Also:
Constant Field Values

FREE

public static final int FREE
Option for the label anchor. The label has no anchor. It can be placed everywhere at the polyline.

See Also:
Constant Field Values
Constructor Detail

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor()
Creates a new empty instance of a polyline label descriptor. You have to fill the label descriptor with data before you can use the descriptor in the label layout. As a minimum, you have to specify either a related obstacle, or the reference points and the line width.

Since:
JViews 5.5
See Also:
setRelatedObstacle(java.lang.Object), setReferencePoints(ilog.views.IlvPoint[]), setLineWidth(float), setMinPercentageFromStart(float), setMaxPercentageFromStart(float), setPreferredPercentageFromStart(float), setMaxDistFromPath(float), setPreferredDistFromPath(float), setPreferredSide(int), setAllowedSide(int), setSideAssociation(int), setTopOverlap(float), setBottomOverlap(float), setLeftOverlap(float), setRightOverlap(float), IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor)

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(Object label,
                                           Object relatedObstacle,
                                           int anchor,
                                           int preferredSide,
                                           int allowedSide,
                                           int sideAssociation)
Creates a new instance of a polyline label descriptor. This can be used to describe that the label can move along a polyline obstacle. The label layout algorithm tries to place the label close, but not overlapping, to the polyline.

The label is anchored at the polyline obstacle. Valid options for the anchor are:

The label is placed at the allowed side of the polyline. Furthermore, the layout takes as hint the distance and side where the label should be preferably placed.

The meaning of the parameters allowedSide and preferredSide depends on the side association. Valid options for the side association are:

If the side association is LOCAL, the following options can be used to specify the allowed and preferred sides: If the side association is GLOBAL, the following options can be used to specify the allowed and preferred sides: Normally, the allowed side specification is strictly obeyed while the preferred side specification is only a recommendation for the layout algorithm. If multiple labels are placed at the same related obstacle, the allowed side is respected for all of them while usually only the first few labels can be placed at the preferred side of the related obstacle. In side association GLOBAL, it may happen that the allowed side specification is impossible. For instance, a strictly horizontal line has a top and a bottom side, but is not considered to have a left and right side. Therefore, to allow only the left or right side of this line cannot be obeyed.

Parameters:
label - The label.
relatedObstacle - The obstacle that is related to the label. The points of the polyline are retrieved from the related obstacle. It must be a polyline obstacle in the labeling model.
anchor - The anchor of the label.
preferredSide - The preferred side where the label should be placed.
allowedSide - The sides that are allowed for the label, or 0, if all sides are allowed.
sideAssociation - The association for the preferred and allowed side.
See Also:
IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor), IlvLabelingModel.isPolylineObstacle(java.lang.Object), LOCAL, GLOBAL

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(Object label,
                                           IlvLinkImage link,
                                           int anchor)
Creates a new instance of a polyline link label descriptor. This special constructor should be used only if the label should be placed along a polyline link in the default labeling model. The label layout algorithm tries to place the label close, but not overlapping, to the link.

The label is anchored at the polyline link. Valid options for the anchor are:

Parameters:
label - The label.
link - The link. It must be a polyline obstacle in the labeling model.
anchor - The anchor of the label.
See Also:
IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor), IlvLabelingModel.isPolylineObstacle(java.lang.Object), IlvLabelingModel.isObstacle(java.lang.Object), IlvLinkImage, IlvDefaultLabelingModel

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(Object label,
                                           Object link,
                                           Object source,
                                           Object target,
                                           int anchor,
                                           float maxDistFromLink,
                                           float preferredDistFromLink,
                                           int preferredSide,
                                           int allowedSide,
                                           int sideAssociation,
                                           float topOverlap,
                                           float bottomOverlap,
                                           float leftOverlap,
                                           float rightOverlap)
Creates a new instance of a polyline link label descriptor. This special constructor should be used only if the label should be placed along a polyline link. The label layout algorithm tries to place the label close, but not overlapping, to the link.

The label is anchored at the polyline link. Valid options for the anchor are:

The label is placed at the allowed side of the link. Furthermore, the layout takes as hint the distance and side where the label should be preferably placed.

The meaning of the parameters allowedSide and preferredSide depends on the side association. Valid options for the side association are:

If the side association is LOCAL, the following options can be used to specify the allowed and preferred sides: If the side association is GLOBAL, the following options can be used to specify the allowed and preferred sides: Normally, the allowed side specification is strictly obeyed while the preferred side specification is only a recommendation for the layout algorithm. If multiple labels are placed at the same link the allowed side is respected for all of them while usually only the first few labels can be placed at the preferred side of the link. In side association GLOBAL, it may happen that the allowed side specification is impossible. For instance, a strictly horizontal link has a top and a bottom side, but no left and right side (because at the left and right side are the end nodes of the link, where the label should not be placed). Therefore, to allow only the left or right side of this link cannot be obeyed.

Parameters:
label - The label.
link - The link. It must be a polyline obstacle in the labeling model.
source - The source node. It must be an obstacle in the labeling model.
target - The target node. It must be an obstacle in the labeling model.
anchor - The anchor of the label.
maxDistFromLink - The maximal distance the label is allowed to be placed away from the link.
preferredDistFromLink - The preferred distance the label is placed away from the link.
preferredSide - The preferred side where the label should be placed.
allowedSide - The sides that are allowed for the label, or 0, if all sides are allowed.
sideAssociation - The association for the preferred and allowed side.
topOverlap - The amount the label can overlap the link at the top side of the label.
bottomOverlap - The amount the label can overlap the link at the bottom side of the label.
leftOverlap - The amount the label can overlap the link at the left side of the label.
rightOverlap - The amount the label can overlap the link at the right side of the label.
See Also:
IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor), IlvLabelingModel.isPolylineObstacle(java.lang.Object), IlvLabelingModel.isObstacle(java.lang.Object), LOCAL, GLOBAL

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(Object label,
                                           Object relatedObstacle,
                                           IlvPoint[] referencePoints,
                                           float lineWidth,
                                           float minPercentageFromStart,
                                           float maxPercentageFromStart,
                                           float maxDistFromPath,
                                           float preferredDistFromPath,
                                           int preferredSide,
                                           int allowedSide,
                                           int sideAssociation,
                                           float topOverlap,
                                           float bottomOverlap,
                                           float leftOverlap,
                                           float rightOverlap)
Creates a new instance of a polyline label descriptor. This constructor exists for backward compatibility. See the other constructors for the details.


IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(Object label,
                                           Object relatedObstacle,
                                           IlvPoint[] referencePoints,
                                           float lineWidth,
                                           float minPercentageFromStart,
                                           float maxPercentageFromStart,
                                           float prefPercentageFromStart,
                                           float maxDistFromPath,
                                           float preferredDistFromPath,
                                           int preferredSide,
                                           int allowedSide,
                                           int sideAssociation,
                                           float topOverlap,
                                           float bottomOverlap,
                                           float leftOverlap,
                                           float rightOverlap)
Creates a new instance of a polyline label descriptor. This can be used to describe the movement of a label along a polyline. The label layout algorithm tries to place the label close, but not overlapping, to the polyline.

It is possible to specify that only a partial area of the polyline should be used. This is done by specifying the start and end points of the area along the polyline by using the minimal and maximal percentage of the polyline length that should be used. If the entire polyline should be used, specify the minimal percentage 0 and the maximal percentage 100. If the label should be placed in the first third of the area close to the start point, set minPercentageFromStart to 0 and maxPercentageFromStart to 33.3. If the label should be placed in the last third of the area close to the end point, set minPercentageFromStart to 66.6 and maxPercentageFromStart to 100. If the label should be placed close to the middle of the polyline, set minPercentageFromStart to 33.3 and maxPercentageFromStart to 66.6. Additionally, you can specify a preference. For instance, if you set prefPercentageFromStart to 50, then the label will be placed near the middle of the polyline whenever possible. Normally the minimal and maximal percentages are strictly obeyed, while the preferred percentage is only a recommendation for the layout algorithm. The preferred percentage must be between the minimal and the maximal percentage.

The label is placed no farther than maxDistFromPath away from the path. It is placed at the allowed side. Furthermore, the layout takes as a hint the distance and side where the label preferably should be placed. A label may partially overlap the related obstacle according to the specified overlap value.

The meaning of the parameters allowedSide and preferredSide depends on the side association. Valid options for the side association are:

If the side association is LOCAL, the following options can be used to specify the allowed and preferred sides: If the side association is GLOBAL, the following options can be used to specify the allowed and preferred sides: Normally the allowed side specification is strictly obeyed while the preferred side specification is only a recommendation for the layout algorithm. If multiple labels are placed at the same related obstacle, the allowed side is respected for all of them while usually only the first few labels can be placed at the preferred side of the related obstacle. In side association GLOBAL, it may happen that the allowed side specification is impossible. For instance, a strictly horizontal line has a top and a bottom side, but is not considered to have a left and right side. Therefore, to allow only the left or right side of this line cannot be obeyed.

Parameters:
label - The label.
relatedObstacle - The obstacle that is related to the label, for example, when labeling roads of a geographic map, the related obstacle should be the object representing the road that has this label. The algorithm does not count overlaps between the label and its related obstacle. If the layout algorithm should count all overlaps to all labels, the related obstacle should be null.
referencePoints - The points that define the polyline the label should be close to. If no reference points are given, the points are retrieved from the related obstacle. In this case, the related obstacle must be a polyline obstacle in the labeling model.
lineWidth - The line width of the polyline. If -1 is given, the line width is retrieved from the related obstacle. In this case, the related obstacle must be a polyline obstacle in the labeling model.
minPercentageFromStart - The start point of the area of the polyline that should be used, expressed as a percentage value relative to the length of the polyline.
maxPercentageFromStart - The end point of the area of the polyline that should be used, expressed as a percentage value relative to the length of the polyline.
prefPercentageFromStart - The preferred position of the label, expressed as a percentage value relative to the length of the polyline.
maxDistFromPath - The maximal distance the label is allowed to be placed away from the path.
preferredDistFromPath - The preferred distance the label is placed away from the path.
preferredSide - The preferred side where the label should be placed.
allowedSide - The sides that are allowed for the label, or 0 if all sides are allowed.
sideAssociation - The association for the preferred and allowed sides.
topOverlap - The amount the label can overlap the related obstacle at the top side of the label.
bottomOverlap - The amount the label can overlap the related obstacle at the bottom side of the label.
leftOverlap - The amount the label can overlap the related obstacle at the left side of the label.
rightOverlap - The amount the label can overlap the related obstacle at the right side of the label.
Since:
JViews 5.5
See Also:
IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor), IlvLabelingModel.isPolylineObstacle(java.lang.Object), LOCAL, GLOBAL

IlvAnnealingPolylineLabelDescriptor

public IlvAnnealingPolylineLabelDescriptor(IlvInputStream stream)
                                    throws IOException,
                                           IlvReadFileException
Creates a new IlvAnnealingPolylineLabelDescriptor from an IlvInputStream.

Parameters:
stream - The input stream from which the descriptor must be read.
Throws:
IlvReadFileException - if an error occurs while reading.
IOException
Method Detail

initialize

public void initialize(IlvLabelingModel labelingModel)
Initializes the label descriptor before layout. You should not call this directly. It is called once at the beginning of layout.

Specified by:
initialize in class IlvAnnealingLabelDescriptor
Parameters:
labelingModel - The labeling model attached to the layout algorithm.

setPosition

public void setPosition(double pathLocation,
                        float distFromPath)
Sets the label conceptually to the specified position. You should not call this directly.

For experts: This method does not really move the label in the labeling model, but updates internal data structures that allow to test easily what would happen if the label would be at the input position. The real move of the label via IlvLabelingModel.moveLabel(java.lang.Object, float, float, boolean) is delayed until the end of all tests.

Specified by:
setPosition in class IlvAnnealingLabelDescriptor
Parameters:
pathLocation - The location on the path.
distFromPath - The distance from the location on the path.
See Also:
IlvAnnealingLabelDescriptor.updatePosition(float, float)

setTowardsPreferredPosition

public void setTowardsPreferredPosition(double pathLocation,
                                        float distFromPath,
                                        int i,
                                        int maxI)
Sets the label to a position that is closer to the preferred position than the input position given by pathLocation and distFromPath.

You should not call this directly. The layout algorithm calls this method iteratively to test various positions that are closer to the preferred position.

Specified by:
setTowardsPreferredPosition in class IlvAnnealingLabelDescriptor
Parameters:
pathLocation - The current location on the path.
distFromPath - The current distance from the location on the path
i - The number of the iteration step, from 0 to maxI - 1.
maxI - The maximal number of iteration steps.
See Also:
setPosition(double, float), getPreferredPathLocation(), getPreferredDistFromPath()

getPreferredPathLocation

public double getPreferredPathLocation()
Returns the preferred location on the path.

Overrides:
getPreferredPathLocation in class IlvAnnealingLabelDescriptor

considerObstacle

public boolean considerObstacle(Object obstacle)
Returns true if the overlap between the label and the input obstacle should be considered during the quality calculation of the Simulated Annealing label layout algorithm. In fact, it returns false if the input obstacle is the related obstacle.

Overrides:
considerObstacle in class IlvAnnealingLabelDescriptor
Parameters:
obstacle - The obstacle to test.
Returns:
true if there is a penalty if the label overlaps the obstacle, and false, if there is no penalty.

getMinDist

protected float getMinDist(Object obstacle,
                           float minDist)
Returns the minimal distance value between this label and the input obstacle. The input minimal distance is the global value. Specific labels may want to deviate from the global value and can override this method.

Overrides:
getMinDist in class IlvAnnealingLabelDescriptor

setRelatedObstacle

public void setRelatedObstacle(Object obstacle)
Sets the obstacle that is related to the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
obstacle - The obstacle.
Since:
JViews 5.5
See Also:
getRelatedObstacle(), setReferencePoints(ilog.views.IlvPoint[])

getRelatedObstacle

public final Object getRelatedObstacle()
Returns the obstacle that is related to the label. It may return null if only an array of reference points was specified.

Overrides:
getRelatedObstacle in class IlvAnnealingLabelDescriptor
See Also:
setRelatedObstacle(java.lang.Object)

setRelatedObstacleSource

public void setRelatedObstacleSource(Object source)
Sets the source node if the related obstacle is a link.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
source - The source node to set.
Since:
JViews 5.5
See Also:
getRelatedObstacleSource()

getRelatedObstacleSource

public final Object getRelatedObstacleSource()
Returns the source node if the related obstacle is a link.

See Also:
setRelatedObstacleSource(java.lang.Object)

setRelatedObstacleTarget

public void setRelatedObstacleTarget(Object target)
Sets the target node if the related obstacle is a link.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
target - The target node to set.
Since:
JViews 5.5
See Also:
getRelatedObstacleTarget()

getRelatedObstacleTarget

public final Object getRelatedObstacleTarget()
Returns the target node if the related obstacle is a link.

See Also:
setRelatedObstacleTarget(java.lang.Object)

setReferencePoints

public void setReferencePoints(IlvPoint[] points)
Sets the reference points that define the polyline where the label must be placed. This should be used if there is no related obstacle, or if the related obstacle is not a polyline or a link. If you set the reference points to null, the shape of the related obstacle defines the where the label must be placed.

Note that a copy of the input point array is stored. The original input point array can be reused afterwards. If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
points - The reference points defining the polyline, or null to use the label's related obstacle.
Since:
JViews 5.5
See Also:
getReferencePoints(), setRelatedObstacle(java.lang.Object)

getReferencePoints

public final IlvPoint[] getReferencePoints()
Returns a copy of the specified reference points that define the polyline where the label must be placed. It returns null if no reference points were specified.

See Also:
setReferencePoints(ilog.views.IlvPoint[])

setLineWidth

public void setLineWidth(float lineWidth)
Sets the line width of the polyline given by the reference points. If the line width is set to -1, the line width of the related obstacle is used.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
lineWidth - The line width of the polyline, or -1 for the line width of the associated obstacle.
Since:
JViews 5.5
See Also:
getLineWidth()

getLineWidth

public final float getLineWidth()
Returns the specified line width of the polyline given by the reference points.

See Also:
setLineWidth(float)

setAnchor

public void setAnchor(int anchor)
Sets the anchor of the label. Possible anchors are: Internally, the anchor specification is translated into a specification of the minimal, maximal, and preferred percentages from start.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
anchor - The anchor of the label.
Since:
JViews 5.5
See Also:
getAnchor(), setMinPercentageFromStart(float), setMaxPercentageFromStart(float), setPreferredPercentageFromStart(float)

getAnchor

public final int getAnchor()
Returns the anchor of the label. Internally, the anchor specification is translated into a specification of the minimal, maximal, and preferred percentages from the start; therefore, in most situations it is more useful to query these percentages.

See Also:
setAnchor(int), getMinPercentageFromStart(), getMaxPercentageFromStart(), getPreferredPercentageFromStart()

setMinPercentageFromStart

public void setMinPercentageFromStart(float minPercentage)
Sets the percentage relative to the length of the polyline that defines the start point of the area of the polyline that should be used for the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
minPercentage - The start point of the label area, expressed as a percentage relative to the length of the polyline.
Since:
JViews 5.5
See Also:
getMinPercentageFromStart()

getMinPercentageFromStart

public final float getMinPercentageFromStart()
Returns the percentage relative to the length of the polyline that defines the start point of the area of the polyline that should be used for the label.

See Also:
setMinPercentageFromStart(float)

setMaxPercentageFromStart

public void setMaxPercentageFromStart(float maxPercentage)
Sets the percentage relative to the length of the polyline that defines the end point of the area of the polyline that should be used for the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
maxPercentage - The end point of the label area, expressed as a percentage relative to the length of the polyline.
Since:
JViews 5.5
See Also:
getMaxPercentageFromStart()

getMaxPercentageFromStart

public final float getMaxPercentageFromStart()
Returns the percentage relative to the length of the polyline that defines the end point of the area of the polyline that should be used for the label.

See Also:
setMaxPercentageFromStart(float)

setPreferredPercentageFromStart

public void setPreferredPercentageFromStart(float prefPercentage)
Sets the percentage relative to the length of the polyline that defines the preferred position for the label. This percentage must be between the minimal and maximal percentages.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
prefPercentage - The preferred position for the label, which must be a value between the minimal and maximal percentages.
Since:
JViews 5.5
See Also:
getPreferredPercentageFromStart(), setMinPercentageFromStart(float), setMaxPercentageFromStart(float)

getPreferredPercentageFromStart

public final float getPreferredPercentageFromStart()
Returns the percentage relative to the length of the polyline that defines the preferred position for the label.

Since:
JViews 5.5
See Also:
setPreferredPercentageFromStart(float)

setTopOverlap

public void setTopOverlap(float overlap)
Sets the amount the label can overlap the related obstacle or reference polyline at the top side of the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
overlap - The allowable amount of overlap at the top side of the label.
Since:
JViews 5.5
See Also:
getTopOverlap()

getTopOverlap

public final float getTopOverlap()
Returns the amount the label can overlap the related obstacle or reference polyline at the top side of the label.

See Also:
setTopOverlap(float)

setBottomOverlap

public void setBottomOverlap(float overlap)
Sets the amount the label can overlap the related obstacle or reference polyline at the bottom side of the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
overlap - The allowable amount of overlap at the bottom side of the label.
Since:
JViews 5.5
See Also:
getBottomOverlap()

getBottomOverlap

public final float getBottomOverlap()
Returns the amount the label can overlap the related obstacle or reference polyline at the bottom side of the label.

See Also:
setBottomOverlap(float)

setLeftOverlap

public void setLeftOverlap(float overlap)
Sets the amount the label can overlap the related obstacle or reference polyline at the left side of the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
overlap - The allowable amount of overlap at the left side of the label.
Since:
JViews 5.5
See Also:
getLeftOverlap()

getLeftOverlap

public final float getLeftOverlap()
Returns the amount the label can overlap the related obstacle or reference polyline at the left side of the label.

See Also:
setLeftOverlap(float)

setRightOverlap

public void setRightOverlap(float overlap)
Sets the amount the label can overlap the related obstacle or reference polyline at the right side of the label.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
overlap - The allowable amount of overlap at the right side of the label.
Since:
JViews 5.5
See Also:
getRightOverlap()

getRightOverlap

public final float getRightOverlap()
Returns the amount the label can overlap the related obstacle or reference polyline at the right side of the label.

See Also:
setRightOverlap(float)

setPreferredSide

public void setPreferredSide(int side)
Sets the preferred side where the label is placed. The meaning depends on the side association. If the side association is LOCAL, the following options can be used to specify the preferred side: If the side association is GLOBAL, the following options can be used to specify the preferred side: The preferred side is only a recommendation for the layout and is not always strictly obeyed. In particular, if multiple labels are placed at the same related obstacle, only the first few labels can be placed at the preferred side of the obstacle.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
side - The preferred side of label placement.
Since:
JViews 5.5
See Also:
getPreferredSide(), setSideAssociation(int)

getPreferredSide

public final int getPreferredSide()
Returns the preferred side where the label is placed. The possible return values are defined in IlvDirection.

See Also:
setPreferredSide(int)

setAllowedSide

public void setAllowedSide(int side)
Sets the allowed side where the label is placed. The meaning depends on the side association. If the side association is LOCAL, the following options can be used to specify the allowed side: If the side association is GLOBAL, the following options can be used to specify the allowed side: Normally the allowed side specification is strictly obeyed. In side association GLOBAL, it may happen that the allowed side specification is impossible. For instance, a strictly horizontal line has a top and a bottom side, but is not considered to have a left and right side. Therefore, to allow only the left or right side of this line cannot be obeyed.

If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
side - The allowed side specification for label placement.
Since:
JViews 5.5
See Also:
getAllowedSide(), setSideAssociation(int)

getAllowedSide

public final int getAllowedSide()
Returns the allowed side where the label is placed. The possible return values are defined in IlvDirection.

See Also:
setAllowedSide(int)

setSideAssociation

public void setSideAssociation(int association)
Returns the side association of the label. This defines the meaning of the preferred and allowed sides. Possible side associations are: If you use this method to change a descriptor that is currently installed for a label, you should reinstall it by calling IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor) again to make the change active.

Parameters:
association - The side association of the label.
Since:
JViews