public class IlvAnnealingPolylineLabelDescriptor extends IlvAnnealingLabelDescriptor implements IlvPersistentObject
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.
Modifier and Type | Field and Description |
---|---|
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.
|
actDistFromPath, actPathLocation, IGNORED, LABEL, maxDistFromPath, maxPathLocation, OBSTACLE
Constructor and Description |
---|
IlvAnnealingPolylineLabelDescriptor()
Creates a new empty instance of a polyline label descriptor.
|
IlvAnnealingPolylineLabelDescriptor(IlvAnnealingPolylineLabelDescriptor d)
Creates a copy of a 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 lbl,
Object relObstacle,
IlvPoint[] refPoints,
double linw,
double minPercFromStart,
double maxPercFromStart,
double prefPercFromStart,
double maxDist,
double prefDist,
int prefSide,
int allowSide,
int sideAssoc,
double top,
double bottom,
double left,
double right)
Creates a new instance of a polyline label descriptor.
|
IlvAnnealingPolylineLabelDescriptor(Object label,
Object relatedObstacle,
IlvPoint[] referencePoints,
double lineWidth,
double minPercentageFromStart,
double maxPercentageFromStart,
double maxDistFromPath,
double preferredDistFromPath,
int preferredSide,
int allowedSide,
int sideAssociation,
double topOverlap,
double bottomOverlap,
double leftOverlap,
double 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,
double maxDistFromLink,
double preferredDistFromLink,
int preferredSide,
int allowedSide,
int sideAssociation,
double topOverlap,
double bottomOverlap,
double leftOverlap,
double rightOverlap)
Creates a new instance of a polyline link label descriptor.
|
Modifier and Type | Method and Description |
---|---|
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. |
IlvAnnealingLabelDescriptor |
copy()
Returns a copy of this label descriptor.
|
int |
getAllowedSide()
Returns the allowed side where the label is placed.
|
int |
getAnchor()
Returns the anchor of the label.
|
double |
getBottomOverlap()
Returns the amount the label can overlap the related obstacle or
reference polyline at the bottom side of the label.
|
double |
getLeftOverlap()
Returns the amount the label can overlap the related obstacle or
reference polyline at the left side of the label.
|
double |
getLineWidth()
Returns the specified line width of the polyline given by the
reference points.
|
double |
getMaxDistFromPath()
Returns the maximum distance from the location on the path.
|
double |
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 double |
getMinDist(Object obstacle,
double min)
Returns the minimum distance value between this label and the input
obstacle.
|
double |
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.
|
double |
getPreferredDistFromPath()
Returns the preferred distance from the location on the path.
|
double |
getPreferredPathLocation()
Returns the preferred location on the path.
|
double |
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.
|
double |
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.
|
double |
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(double overlap)
Sets the amount the label can overlap the related obstacle or
reference polyline at the bottom side of the label.
|
void |
setLeftOverlap(double overlap)
Sets the amount the label can overlap the related obstacle or
reference polyline at the left side of the label.
|
void |
setLineWidth(double lineWidth)
Sets the line width of the polyline given by the reference points.
|
void |
setMaxDistFromPath(double distance)
Sets the maximum distance from the location on the path.
|
void |
setMaxPercentageFromStart(double 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(double 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,
double distFromPath)
Sets the label conceptually to the specified position.
|
void |
setPreferredDistFromPath(double distance)
Sets the preferred distance from the location on the path.
|
void |
setPreferredPercentageFromStart(double 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(double 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)
Sets the side association of the label.
|
void |
setTopOverlap(double 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,
double 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.
|
getActDistFromPath, getActPathLocation, getLabel, getMaxPathLocation, getRotation, getTreatAs, isAutoCorrect, isFixed, setActDistFromPath, setActPathLocation, setAutoCorrect, setFixed, setMaxPathLocation, setTreatAs, updatePosition
public static final int LOCAL
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.
public static final int GLOBAL
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.
public static final int CENTER
public static final int START
public static final int END
public static final int FREE
public IlvAnnealingPolylineLabelDescriptor()
setRelatedObstacle(Object)
,
setReferencePoints(IlvPoint[])
,
setLineWidth(double)
,
setMinPercentageFromStart(double)
,
setMaxPercentageFromStart(double)
,
setPreferredPercentageFromStart(double)
,
setMaxDistFromPath(double)
,
setPreferredDistFromPath(double)
,
setPreferredSide(int)
,
setAllowedSide(int)
,
setSideAssociation(int)
,
setTopOverlap(double)
,
setBottomOverlap(double)
,
setLeftOverlap(double)
,
setRightOverlap(double)
,
IlvAnnealingLabelLayout.setLabelDescriptor(Object, IlvAnnealingLabelDescriptor)
public IlvAnnealingPolylineLabelDescriptor(Object label, Object relatedObstacle, int anchor, int preferredSide, int allowedSide, int sideAssociation)
The label is anchored at the polyline obstacle. Valid options for the anchor are:
CENTER
- The label is placed near the center of the
polyline. START
- The label is placed closer to the start point
of the polyline. END
- The label is placed closer to the end point of
the polyline. FREE
- The label is placed anywhere at the polyline.
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:
LOCAL
- sides are specified local to the flow
direction of the polyline. GLOBAL
- sides are specified relative to the global
coordinates. LOCAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side in polyline
flow direction. IlvDirection.Right
- right side in polyline
flow direction. GLOBAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side. IlvDirection.Right
- right side. IlvDirection.Top
- top side. IlvDirection.Bottom
- bottom side. IlvDirection.TopLeft
- top side or left side.
IlvDirection.TopRight
- top side or right
side. IlvDirection.BottomLeft
- bottom side or left
side. IlvDirection.BottomRight
- bottom side or
right side. 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.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.IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor)
,
IlvLabelingModel.isPolylineObstacle(java.lang.Object)
,
LOCAL
,
GLOBAL
public IlvAnnealingPolylineLabelDescriptor(Object label, IlvLinkImage link, int anchor)
The label is anchored at the polyline link. Valid options for the anchor are:
label
- The label.link
- The link. It must be a polyline obstacle in the labeling
model.anchor
- The anchor of the label.IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor)
,
IlvLabelingModel.isPolylineObstacle(java.lang.Object)
,
IlvLabelingModel.isObstacle(java.lang.Object)
,
IlvLinkImage
,
IlvDefaultLabelingModel
public IlvAnnealingPolylineLabelDescriptor(Object label, Object link, Object source, Object target, int anchor, double maxDistFromLink, double preferredDistFromLink, int preferredSide, int allowedSide, int sideAssociation, double topOverlap, double bottomOverlap, double leftOverlap, double rightOverlap)
The label is anchored at the polyline link. Valid options for the anchor are:
CENTER
- The label is placed near the center of the
link. START
- The label is placed closer to the source of
the link. END
- The label is placed closer to the destination
of the link. FREE
- The label is placed anywhere at the link.
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:
LOCAL
- sides are specified local to the flow
direction of the link. GLOBAL
- sides are specified relative to the global
coordinates. LOCAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side in link flow.
IlvDirection.Right
- right side in link flow.
GLOBAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side. IlvDirection.Right
- right side. IlvDirection.Top
- top side. IlvDirection.Bottom
- bottom side. IlvDirection.TopLeft
- top side or left side.
IlvDirection.TopRight
- top side or right
side. IlvDirection.BottomLeft
- bottom side or left
side. IlvDirection.BottomRight
- bottom side or
right side. 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.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 maximum 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.IlvAnnealingLabelLayout.setLabelDescriptor(java.lang.Object, ilog.views.graphlayout.labellayout.annealing.IlvAnnealingLabelDescriptor)
,
IlvLabelingModel.isPolylineObstacle(java.lang.Object)
,
IlvLabelingModel.isObstacle(java.lang.Object)
,
LOCAL
,
GLOBAL
public IlvAnnealingPolylineLabelDescriptor(Object label, Object relatedObstacle, IlvPoint[] referencePoints, double lineWidth, double minPercentageFromStart, double maxPercentageFromStart, double maxDistFromPath, double preferredDistFromPath, int preferredSide, int allowedSide, int sideAssociation, double topOverlap, double bottomOverlap, double leftOverlap, double rightOverlap)
public IlvAnnealingPolylineLabelDescriptor(Object lbl, Object relObstacle, IlvPoint[] refPoints, double linw, double minPercFromStart, double maxPercFromStart, double prefPercFromStart, double maxDist, double prefDist, int prefSide, int allowSide, int sideAssoc, double top, double bottom, double left, double right)
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 minimum and maximum
percentage of the polyline length that should be used. If the entire
polyline should be used, specify the minimum percentage 0 and the
maximum 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 minimum and maximum percentages are strictly obeyed, while the
preferred percentage is only a recommendation for the layout
algorithm. The preferred percentage must be between the minimum and
the maximum 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:
LOCAL
- Sides are specified local to the flow
direction of the polyline. GLOBAL
- Sides are specified relative to the global
coordinates. LOCAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side in polyline
flow direction. IlvDirection.Right
- right side in polyline
flow direction. GLOBAL
, the following options
can be used to specify the allowed and preferred sides:
IlvDirection.Left
- left side.IlvDirection.Right
- right side.IlvDirection.Top
- top side.IlvDirection.Bottom
- bottom side.IlvDirection.TopLeft
- top side or left
side.IlvDirection.TopRight
- top side or right
side.IlvDirection.BottomLeft
- bottom side or left
side.IlvDirection.BottomRight
- bottom side or
right side.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.lbl
- The label.relObstacle
- 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
.refPoints
- 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.linw
- 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.minPercFromStart
- 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.maxPercFromStart
- 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.prefPercFromStart
- The preferred position of the label, expressed
as a percentage value relative to the length of the polyline.maxDist
- The maximum distance the label is allowed to be placed
away from the path.prefDist
- The preferred distance the label is placed away from the
path.prefSide
- The preferred side where the label should be placed.allowSide
- The sides that are allowed for the label, or 0 if all
sides are allowed.sideAssoc
- The association for the preferred and allowed sides.top
- The amount the label can overlap the related obstacle at the
top side of the label.bottom
- The amount the label can overlap the related obstacle at
the bottom side of the label.left
- The amount the label can overlap the related obstacle at the
left side of the label.right
- The amount the label can overlap the related obstacle at
the right side of the label.IlvAnnealingLabelLayout.setLabelDescriptor(Object, IlvAnnealingLabelDescriptor)
,
IlvLabelingModel.isPolylineObstacle(Object)
,
LOCAL
,
GLOBAL
public IlvAnnealingPolylineLabelDescriptor(IlvAnnealingPolylineLabelDescriptor d)
d
- The original label descriptor.public IlvAnnealingPolylineLabelDescriptor(IlvInputStream stream) throws IOException, IlvReadFileException
IlvAnnealingPolylineLabelDescriptor
from
an IlvInputStream
.stream
- The input stream from which the descriptor must be read.IlvReadFileException
- if an error occurs while reading.IOException
public IlvAnnealingLabelDescriptor copy()
copy
in class IlvAnnealingLabelDescriptor
public void initialize(IlvLabelingModel labelingModel)
initialize
in class IlvAnnealingLabelDescriptor
labelingModel
- The labeling model attached to the layout
algorithm.public void setPosition(double pathLocation, double distFromPath)
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(Object, double, double, boolean)
is
delayed until the end of all tests.
setPosition
in class IlvAnnealingLabelDescriptor
pathLocation
- The location on the path.distFromPath
- The distance from the location on the path.IlvAnnealingLabelDescriptor.updatePosition(double, double)
public void setTowardsPreferredPosition(double pathLocation, double distFromPath, int i, int maxI)
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.
setTowardsPreferredPosition
in class IlvAnnealingLabelDescriptor
pathLocation
- The current location on the path.distFromPath
- The current distance from the location on the pathi
- The number of the iteration step, from 0 to maxI -
1
.maxI
- The maximum number of iteration steps.setPosition(double, double)
,
getPreferredPathLocation()
,
getPreferredDistFromPath()
public double getPreferredPathLocation()
getPreferredPathLocation
in class IlvAnnealingLabelDescriptor
public boolean considerObstacle(Object obstacle)
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.considerObstacle
in class IlvAnnealingLabelDescriptor
obstacle
- The obstacle to test.true
if there is a penalty if the label overlaps
the obstacle, and false
, if there is no penalty.protected double getMinDist(Object obstacle, double min)
getMinDist
in class IlvAnnealingLabelDescriptor
obstacle
- The input obstacle.min
- The input minimum distance.public void setRelatedObstacle(Object obstacle)
obstacle
- The obstacle.getRelatedObstacle()
,
setReferencePoints(IlvPoint[])
public final Object getRelatedObstacle()
null
if only an array of reference points was specified.getRelatedObstacle
in class IlvAnnealingLabelDescriptor
setRelatedObstacle(Object)
public void setRelatedObstacleSource(Object source)
source
- The source node to set.getRelatedObstacleSource()
public final Object getRelatedObstacleSource()
setRelatedObstacleSource(Object)
public void setRelatedObstacleTarget(Object target)
target
- The target node to set.getRelatedObstacleTarget()
public final Object getRelatedObstacleTarget()
setRelatedObstacleTarget(Object)
public void setReferencePoints(IlvPoint[] points)
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.
points
- The reference points defining the polyline, or
null
to use the label's related obstacle.getReferencePoints()
,
setRelatedObstacle(Object)
public final IlvPoint[] getReferencePoints()
null
if no reference points were specified.setReferencePoints(IlvPoint[])
public void setLineWidth(double lineWidth)
-1
, the line width of the
related obstacle is used.lineWidth
- The line width of the polyline, or -1
for
the line width of the associated obstacle.getLineWidth()
public final double getLineWidth()
setLineWidth(double)
public void setAnchor(int anchor)
anchor
- The anchor of the label.getAnchor()
,
setMinPercentageFromStart(double)
,
setMaxPercentageFromStart(double)
,
setPreferredPercentageFromStart(double)
public final int getAnchor()
public void setMinPercentageFromStart(double minPercentage)
The default value is 0
.
minPercentage
- The start point of the label area, expressed as a
percentage relative to the length of the polyline.getMinPercentageFromStart()
public final double getMinPercentageFromStart()
setMinPercentageFromStart(double)
public void setMaxPercentageFromStart(double maxPercentage)
The default value is 100
.
maxPercentage
- The end point of the label area, expressed as a
percentage relative to the length of the polyline.getMaxPercentageFromStart()
public final double getMaxPercentageFromStart()
setMaxPercentageFromStart(double)
public void setPreferredPercentageFromStart(double prefPercentage)
The default value is 50
.
prefPercentage
- The preferred position for the label, which must
be a value between the minimum and maximum percentages.getPreferredPercentageFromStart()
,
setMinPercentageFromStart(double)
,
setMaxPercentageFromStart(double)
public final double getPreferredPercentageFromStart()
setPreferredPercentageFromStart(double)
public void setTopOverlap(double overlap)
The default value is 0
.
overlap
- The allowable amount of overlap at the top side of the
label.getTopOverlap()
public final double getTopOverlap()
setTopOverlap(double)
public void setBottomOverlap(double overlap)
The default value is 0
.
overlap
- The allowable amount of overlap at the bottom side of the
label.getBottomOverlap()
public final double getBottomOverlap()
setBottomOverlap(double)
public void setLeftOverlap(double overlap)
The default value is 0
.
overlap
- The allowable amount of overlap at the left side of the
label.getLeftOverlap()
public final double getLeftOverlap()
setLeftOverlap(double)
public void setRightOverlap(double overlap)
The default value is 0
.
overlap
- The allowable amount of overlap at the right side of the
label.getRightOverlap()
public final double getRightOverlap()
setRightOverlap(double)
public void setPreferredSide(int side)
LOCAL
, the following options can be used to specify the
preferred side:
IlvDirection.Left
- left side in polyline
flow direction.IlvDirection.Right
- right side in polyline
flow direction.GLOBAL
, the following options
can be used to specify the preferred side:
IlvDirection.Left
- left side.IlvDirection.Right
- right side.IlvDirection.Top
- top side.IlvDirection.Bottom
- bottom side.IlvDirection.TopLeft
- top side or left
side.IlvDirection.TopRight
- top side or right
side.IlvDirection.BottomLeft
- bottom side or left
side.IlvDirection.BottomRight
- bottom side or
right side.IlvDirection.Left
.
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.
side
- The preferred side of label placement.getPreferredSide()
,
setSideAssociation(int)
public final int getPreferredSide()
IlvDirection
.setPreferredSide(int)
public void setAllowedSide(int side)
LOCAL
, the following options can be used to specify the
allowed side:
IlvDirection.Left
- left side in polyline
flow direction.IlvDirection.Right
- right side in polyline
flow direction.0
- both sides.GLOBAL
, the following options
can be used to specify the allowed side:
IlvDirection.Left
- left side.IlvDirection.Right
- right side.IlvDirection.Top
- top side.IlvDirection.Bottom
- bottom side.IlvDirection.TopLeft
- top side or left
side.IlvDirection.TopRight
- top side or right
side.IlvDirection.BottomLeft
- bottom side or left
side.IlvDirection.BottomRight
- bottom side or
right side.0
- all sides.0
.
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.
side
- The allowed side specification for label placement.getAllowedSide()
,
setSideAssociation(int)
public final int getAllowedSide()
IlvDirection
.setAllowedSide(int)
public void setSideAssociation(int association)
LOCAL
.association
- The side association of the label.setAllowedSide(int)
,
setPreferredSide(int)
,
getSideAssociation()
public final int getSideAssociation()
setSideAssociation(int)
public void setPreferredDistFromPath(double distance)
The default value is 0
.
distance
- The preferred distance from the path.getPreferredDistFromPath()
,
setMaxDistFromPath(double)
public final double getPreferredDistFromPath()
getPreferredDistFromPath
in class IlvAnnealingLabelDescriptor
setPreferredDistFromPath(double)
public void setMaxDistFromPath(double distance)
The default value is 0
.
setMaxDistFromPath
in class IlvAnnealingLabelDescriptor
distance
- The maximum distance from the path.getMaxDistFromPath()
public final double getMaxDistFromPath()
getMaxDistFromPath
in class IlvAnnealingLabelDescriptor
setMaxDistFromPath(double)
public void write(IlvOutputStream stream) throws IOException
IlvGraphic
.write
in interface IlvPersistentObject
stream
- The output stream.IOException
- standard IO error.© Copyright Rogue Wave Software, Inc. 1997, 2018. All Rights Reserved.