public class LabelsConfiguration extends LocalizedObject implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Class and Description |
---|---|
static class |
LabelsConfiguration.LabelPriority |
static class |
LabelsConfiguration.PositioningType |
Modifier and Type | Field and Description |
---|---|
protected boolean |
allowsOverlappingLabels
Defines if labels can overlap, overriding the project flag
|
protected boolean |
allowsPartialLabels
Defines if labels can be partially included in the map (edges of the view)
|
protected Attribute |
angleAttribute
Defines the attribute that contain the rotation angle (in degrees).
|
protected boolean |
autoLabelling
If autoLabel is active, labels will be drawn for all the elements if the
current scale is somewhere between the the maximum and minimum
scale limits.
|
static int |
CLOCKWISE
Deprecated.
Use the constant CLOCKWISE from the class GeometryUtil
|
static int |
COUNTERCLOCKWISE
Deprecated.
Use the constant COUNTERCLOCKWISE from the class GeometryUtil
|
protected boolean |
curvedLabels
Defines if labels follow the curve of a polyline.
|
static java.lang.Integer |
DEFAULT_LAYER_PRIORITY |
static LabelsConfiguration.PositioningType |
DEFAULT_POSITIONING_TYPE |
protected boolean |
drawFrame |
protected boolean |
dynamicPlacement
Defines if labels can be dynamically placed to improve their visibility on the map.
|
protected double |
fixedScale |
protected boolean |
followMapRotation
Defines if labels should follow map rotation.
|
static java.util.Comparator<LabelsConfiguration.LabelPriority> |
LABEL_PRIORITY_COMPARATOR |
protected int |
labelPosition
Defines the the position of the label in reference to the corresponding
element the position are represented the same way as in the LayerInfo class (
where NORTH_WEST = 0 ,NORTH = 1 ...)
|
protected java.lang.String |
labelText |
protected double |
maximumScale
Defines the current maximum scale at which the labels should be drawn
on a layer if autoLabel mode is active.
|
protected double |
minimumScale
Sets the current minimum scale at which the labels should be drawn on
a layer if autoLabel mode is active.
|
protected int |
offsetX |
protected int |
offsetY |
protected boolean |
orientedLabels
Defines if labels should be oriented when drawn on polylines.
|
protected boolean |
parseNumericLabels |
protected boolean |
preventLabelDuplication
Defines if labels duplication should be prevent.
|
protected int |
rotationDirection
Defines the direction of the labels rotation (CLOCKWISE or COUNTERCLOCKWISE).
|
protected GeometryUtil.RotationOrigin |
rotationOrigin |
protected int |
rotationUnit
Defines the unit of the labels rotation (DEGREE or RADIAN).
|
protected boolean |
symbolUnderLabels |
Constructor and Description |
---|
LabelsConfiguration() |
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
clone() |
boolean |
doOrientedLabels()
Deprecated.
use isOrientedLabels() instead
|
boolean |
doPreventLabelDuplication()
Deprecated.
use isPreventLabelDuplication() instead
|
Attribute |
getAngleAttribute() |
java.awt.Color |
getDrawFrameBorderColor() |
java.awt.Color |
getDrawFrameColor()
Returns the color of the polygon frame drawn behind the label.
|
double |
getFixedScale() |
java.lang.String |
getLabelText() |
java.lang.String |
getLabelText(java.util.Locale locale)
Returns the label text value for for a specific locale.
|
java.lang.Integer |
getLayerPriority() |
double |
getMaximumScale()
Returns the maximum scale for drawing labels.
|
double |
getMinimumScale()
Returns the minimum scale for drawing labels.
|
int |
getOffsetX() |
int |
getOffsetY() |
int |
getPosition()
Returns the label relative position.
|
LabelsConfiguration.PositioningType |
getPositioningType() |
int[] |
getPositionPriority() |
Attribute |
getPriorityAttribute() |
int |
getRotationDirection() |
GeometryUtil.RotationOrigin |
getRotationOrigin() |
int |
getRotationUnit() |
Attribute |
getScaleAttribute() |
boolean |
isAllowsOverlappingLabels()
Returns whether or not labels overlapping is permitted.
|
boolean |
isAllowsPartialLabels()
Returns whether or not partial labels are permitted.
|
boolean |
isAutoLabelling()
Returns whether or not automatic labelling is enabled.
|
boolean |
isCurvedLabels()
Returns whether or not curved labels is enabled.
|
boolean |
isDrawable(double scale)
Returns true if labels should be drawn at the specified scale.
|
boolean |
isDrawFrame()
Indicates whether a polygon frame should be drawn behind the label.
|
boolean |
isDynamicPlacement()
Returns whether or not dynamic placement is enabled.
|
boolean |
isFollowMapRotation() |
boolean |
isFollowSymbolPosition() |
boolean |
isOrientedLabels()
Returns whether or not labels should be drawn oriented.
|
boolean |
isParseNumericLabels() |
boolean |
isPreventLabelDuplication()
Returns whether or not labels duplication prevention is enabled.
|
boolean |
isPriorityAttributeReversed() |
boolean |
isSymbolUnderLabels() |
void |
removeTranslationsOtherThan(java.util.Locale[] locales)
Removes any
Locale from this object that are not in the specified locales . |
void |
setAllowsOverlappingLabels(boolean allowsOverlappingLabels)
Sets whether or not labels overlapping is permitted.
|
void |
setAllowsPartialLabels(boolean allowsPartialLabels)
Sets whether or not partial labels are permitted.
|
void |
setAngleAttribute(Attribute angleAttribute) |
void |
setAutoLabelling(boolean autoLabelling)
Sets whether or not automatic labelling is enabled.
|
void |
setCurvedLabels(boolean curvedLabels)
Sets whether or not curved labels is enabled.
|
void |
setDrawFrame(boolean drawFrame)
Sets whether a polygon frame should be drawn behind the label.
|
void |
setDrawFrameBorderColor(java.awt.Color drawFrameBorderColor) |
void |
setDrawFrameColor(java.awt.Color drawFrameColor)
Sets the color of the polygon frame drawn behind the label.
|
void |
setDynamicPlacement(boolean dynamicPlacement)
Sets whether or not dynamic placement is enabled.
|
void |
setFixedScale(double fixedScale) |
void |
setFollowMapRotation(boolean mapRotationIgnored) |
void |
setFollowSymbolPosition(boolean followSymbolPosition) |
void |
setLabelText(java.lang.String labelText) |
void |
setLabelText(java.lang.String labelText,
java.util.Locale locale)
Sets the label text text with the specified string for a specific locale.
|
void |
setLayerPriority(java.lang.Integer layerPriority) |
void |
setMaximumScale(double maximumScale)
Sets the maximum scale for drawing labels.
|
void |
setMinimumScale(double minimumScale)
Sets the minimum scale for drawing labels.
|
void |
setOffsetX(int offsetX) |
void |
setOffsetY(int offsetY) |
void |
setOrientedLabels(boolean orientedLabels)
Sets whether or not label should be drawn oriented on linear geometries.
|
void |
setParseNumericLabels(boolean parseNumericLabels) |
void |
setPosition(int labelPosition)
Sets the label relative position.
|
void |
setPositioningType(LabelsConfiguration.PositioningType positioningType) |
void |
setPositionPriority(int[] positionPriority) |
void |
setPreventLabelDuplication(boolean preventLabelDuplication)
Enables or disables labels duplication prevention.
|
void |
setPriorityAttribute(Attribute priorityAttribute) |
void |
setPriorityAttributeReversed(boolean priorityAttributeReversed) |
void |
setRotationDirection(int rotationDirection) |
void |
setRotationOrigin(GeometryUtil.RotationOrigin rotationOrigin) |
void |
setRotationUnit(int rotationUnit) |
void |
setScaleAttribute(Attribute scaleAttribute) |
void |
setSymbolUnderLabels(boolean symbolUnderLabels) |
getAvailableLocales, getTranslation, isTranslationExists, setTranslation, updateTranslations
public static final java.util.Comparator<LabelsConfiguration.LabelPriority> LABEL_PRIORITY_COMPARATOR
public static final LabelsConfiguration.PositioningType DEFAULT_POSITIONING_TYPE
public static final java.lang.Integer DEFAULT_LAYER_PRIORITY
@Deprecated public static final int CLOCKWISE
@Deprecated public static final int COUNTERCLOCKWISE
protected double minimumScale
protected double maximumScale
protected boolean autoLabelling
protected boolean orientedLabels
protected boolean preventLabelDuplication
protected boolean allowsOverlappingLabels
protected boolean allowsPartialLabels
protected boolean dynamicPlacement
protected boolean symbolUnderLabels
protected boolean parseNumericLabels
protected int labelPosition
LabelManager
protected double fixedScale
protected int offsetX
protected int offsetY
protected Attribute angleAttribute
protected int rotationDirection
protected int rotationUnit
protected GeometryUtil.RotationOrigin rotationOrigin
protected boolean followMapRotation
protected java.lang.String labelText
protected boolean drawFrame
protected boolean curvedLabels
public Attribute getAngleAttribute()
public void setAngleAttribute(Attribute angleAttribute)
public int getRotationDirection()
public void setRotationDirection(int rotationDirection)
public int getRotationUnit()
public void setRotationUnit(int rotationUnit)
public boolean isFollowMapRotation()
public void setFollowMapRotation(boolean mapRotationIgnored)
public java.lang.String getLabelText()
public java.lang.String getLabelText(java.util.Locale locale)
locale
- public void setLabelText(java.lang.String labelText)
public void setLabelText(java.lang.String labelText, java.util.Locale locale)
labelText
- the new label text textlocale
- public boolean isDrawable(double scale)
scale
- the scale used for the calculation.public int getPosition()
LabelManager
public void setPosition(int labelPosition)
labelPosition
- the label relative position.LabelManager
public double getMaximumScale()
public void setMaximumScale(double maximumScale)
maximumScale
- the maximum scale.public double getMinimumScale()
public void setMinimumScale(double minimumScale)
minimumScale
- the minimum scale.public boolean isAutoLabelling()
public void setAutoLabelling(boolean autoLabelling)
autoLabelling
- the new state of the property.@Deprecated public boolean doOrientedLabels()
public boolean isOrientedLabels()
@Deprecated public boolean doPreventLabelDuplication()
public boolean isPreventLabelDuplication()
public void setPreventLabelDuplication(boolean preventLabelDuplication)
preventLabelDuplication
- the new state of the property.public void setOrientedLabels(boolean orientedLabels)
orientedLabels
- the new state of the property.public boolean isAllowsOverlappingLabels()
public void setAllowsOverlappingLabels(boolean allowsOverlappingLabels)
allowsOverlappingLabels
- the flag state.public void setParseNumericLabels(boolean parseNumericLabels)
public boolean isParseNumericLabels()
public boolean isSymbolUnderLabels()
public void setSymbolUnderLabels(boolean symbolUnderLabels)
public double getFixedScale()
public void setFixedScale(double fixedScale)
public int getOffsetX()
public void setOffsetX(int offsetX)
public int getOffsetY()
public void setOffsetY(int offsetY)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean isDrawFrame()
public void setDrawFrame(boolean drawFrame)
drawFrame
- true if frame must be drawnpublic java.awt.Color getDrawFrameColor()
public void setDrawFrameColor(java.awt.Color drawFrameColor)
drawFrameColor
- the color of the polygonpublic boolean isAllowsPartialLabels()
public void setAllowsPartialLabels(boolean allowsPartialLabels)
public boolean isDynamicPlacement()
public void setDynamicPlacement(boolean dynamicPlacement)
public boolean isCurvedLabels()
public void setCurvedLabels(boolean curvedLabels)
public java.awt.Color getDrawFrameBorderColor()
public void setDrawFrameBorderColor(java.awt.Color drawFrameBorderColor)
public GeometryUtil.RotationOrigin getRotationOrigin()
public void setRotationOrigin(GeometryUtil.RotationOrigin rotationOrigin)
public Attribute getScaleAttribute()
public void setScaleAttribute(Attribute scaleAttribute)
public LabelsConfiguration.PositioningType getPositioningType()
public void setPositioningType(LabelsConfiguration.PositioningType positioningType)
public int[] getPositionPriority()
public void setPositionPriority(int[] positionPriority)
public java.lang.Integer getLayerPriority()
public void setLayerPriority(java.lang.Integer layerPriority)
public Attribute getPriorityAttribute()
public void setPriorityAttribute(Attribute priorityAttribute)
public boolean isPriorityAttributeReversed()
public void setPriorityAttributeReversed(boolean priorityAttributeReversed)
public boolean isFollowSymbolPosition()
public void setFollowSymbolPosition(boolean followSymbolPosition)
public void removeTranslationsOtherThan(java.util.Locale[] locales)
LocalizedObject
Locale
from this object that are not in the specified locales
.
locales[0]
should be the default languageremoveTranslationsOtherThan
in class LocalizedObject