Package com.kheops.jmap.client.layers
Class LabelsConfiguration
java.lang.Object
com.kheops.jmap.metadata.LocalizedObject
com.kheops.jmap.client.layers.LabelsConfiguration
- All Implemented Interfaces:
Serializable,Cloneable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected booleanDefines if labels can overlap, overriding the project flagprotected booleanDefines if labels can be partially included in the map (edges of the view)protected AttributeDefines the attribute that contain the rotation angle (in degrees).protected booleanIf 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 final intDeprecated.Use the constant CLOCKWISE from the class GeometryUtilstatic final intDeprecated.Use the constant COUNTERCLOCKWISE from the class GeometryUtilprotected booleanDefines if labels follow the curve of a polyline.static final Integerstatic final LabelsConfiguration.PositioningTypeprotected booleanprotected booleanDefines if labels can be dynamically placed to improve their visibility on the map.protected doubleprotected booleanDefines if labels should follow map rotation.static final Comparator<LabelsConfiguration.LabelPriority> protected intDefines 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 Stringprotected doubleDefines the current maximum scale at which the labels should be drawn on a layer if autoLabel mode is active.protected doubleSets the current minimum scale at which the labels should be drawn on a layer if autoLabel mode is active.protected intprotected intprotected booleanDefines if labels should be oriented when drawn on polylines.protected booleanprotected booleanDefines if labels duplication should be prevent.protected intDefines the direction of the labels rotation (CLOCKWISE or COUNTERCLOCKWISE).protected GeometryUtil.RotationOriginprotected intDefines the unit of the labels rotation (DEGREE or RADIAN).protected boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()booleanDeprecated.use isOrientedLabels() insteadbooleanDeprecated.use isPreventLabelDuplication() insteadReturns the color of the polygon frame drawn behind the label.doublegetLabelText(Locale locale) Returns the label text value for a specific locale.doubleReturns the maximum scale for drawing labels.doubleReturns the minimum scale for drawing labels.intintintReturns the label relative position.booleanReturns whether labels overlapping is permitted.booleanReturns whether partial labels are permitted.booleanReturns whether automatic labelling is enabled.booleanReturns whether curved labels is enabled.booleanisDrawable(double scale) Returns true if labels should be drawn at the specified scale.booleanIndicates whether a polygon frame should be drawn behind the label.booleanReturns whether dynamic placement is enabled.booleanReturns whether labels should be drawn oriented.booleanbooleanReturns whether labels duplication prevention is enabled.booleanvoidremoveTranslationsOtherThan(Locale[] locales) Removes anyLocalefrom this object that are not in the specifiedlocales.voidsetAllowsOverlappingLabels(boolean allowsOverlappingLabels) Sets whether labels overlapping is permitted.voidsetAllowsPartialLabels(boolean allowsPartialLabels) Sets whether partial labels are permitted.voidsetAutoLabelling(boolean autoLabelling) Sets whether automatic labelling is enabled.voidsetCurvedLabels(boolean curvedLabels) Sets whether curved labels is enabled.voidsetDrawFrame(boolean drawFrame) Sets whether a polygon frame should be drawn behind the label.voidsetDrawFrameBorderColor(Color drawFrameBorderColor) voidsetDrawFrameColor(Color drawFrameColor) Sets the color of the polygon frame drawn behind the label.voidsetDynamicPlacement(boolean dynamicPlacement) Sets whether dynamic placement is enabled.voidsetFixedScale(double fixedScale) voidsetLabelText(String labelText, Locale locale) Sets the label text with the specified string for a specific locale.voidsetMaximumScale(double maximumScale) Sets the maximum scale for drawing labels.voidsetMinimumScale(double minimumScale) Sets the minimum scale for drawing labels.voidsetOffsetX(int offsetX) voidsetOffsetY(int offsetY) voidsetOrientedLabels(boolean orientedLabels) Sets whether label should be drawn oriented on linear geometries.voidsetParseNumericLabels(boolean parseNumericLabels) voidsetPosition(int labelPosition) Sets the label relative position.voidsetPreventLabelDuplication(boolean preventLabelDuplication) Enables or disables labels duplication prevention.voidsetSymbolUnderLabels(boolean symbolUnderLabels) Methods inherited from class com.kheops.jmap.metadata.LocalizedObject
getAvailableLocales, getTranslation, isTranslationExists, setTranslation, updateTranslations
-
Field Details
-
LABEL_PRIORITY_COMPARATOR
-
DEFAULT_POSITIONING_TYPE
-
DEFAULT_LAYER_PRIORITY
-
CLOCKWISE
Deprecated.Use the constant CLOCKWISE from the class GeometryUtilConstant for the clockwise direction.- See Also:
-
COUNTERCLOCKWISE
Deprecated.Use the constant COUNTERCLOCKWISE from the class GeometryUtilConstant for the counterclockwise direction.- See Also:
-
minimumScale
protected double minimumScaleSets the current minimum scale at which the labels should be drawn on a layer if autoLabel mode is active. -
maximumScale
protected double maximumScaleDefines the current maximum scale at which the labels should be drawn on a layer if autoLabel mode is active. -
autoLabelling
protected boolean autoLabellingIf 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. -
orientedLabels
protected boolean orientedLabelsDefines if labels should be oriented when drawn on polylines. -
preventLabelDuplication
protected boolean preventLabelDuplicationDefines if labels duplication should be prevent. -
allowsOverlappingLabels
protected boolean allowsOverlappingLabelsDefines if labels can overlap, overriding the project flag -
allowsPartialLabels
protected boolean allowsPartialLabelsDefines if labels can be partially included in the map (edges of the view) -
dynamicPlacement
protected boolean dynamicPlacementDefines if labels can be dynamically placed to improve their visibility on the map. -
symbolUnderLabels
protected boolean symbolUnderLabels -
parseNumericLabels
protected boolean parseNumericLabels -
labelPosition
protected int labelPositionDefines 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 ...)- See Also:
-
fixedScale
protected double fixedScale -
offsetX
protected int offsetX -
offsetY
protected int offsetY -
angleAttribute
Defines the attribute that contain the rotation angle (in degrees). -
rotationDirection
protected int rotationDirectionDefines the direction of the labels rotation (CLOCKWISE or COUNTERCLOCKWISE). -
rotationUnit
protected int rotationUnitDefines the unit of the labels rotation (DEGREE or RADIAN). -
rotationOrigin
-
followMapRotation
protected boolean followMapRotationDefines if labels should follow map rotation. -
labelText
-
drawFrame
protected boolean drawFrame -
curvedLabels
protected boolean curvedLabelsDefines if labels follow the curve of a polyline.
-
-
Constructor Details
-
LabelsConfiguration
public LabelsConfiguration()
-
-
Method Details
-
getLabelText
Returns the label text value for a specific locale.- Parameters:
locale-- Returns:
- the label text
-
setLabelText
Sets the label text with the specified string for a specific locale.- Parameters:
labelText- the new label textlocale-
-
isDrawable
public boolean isDrawable(double scale) Returns true if labels should be drawn at the specified scale. This is based on the minimum and maximum zoom scales stored in this labels configuration.- Parameters:
scale- the scale used for the calculation.- Returns:
- true if labels should be drawn at the specified scale.
-
getPosition
public int getPosition()Returns the label relative position.- Returns:
- the label relative position.
- See Also:
-
setPosition
public void setPosition(int labelPosition) Sets the label relative position.- Parameters:
labelPosition- the label relative position.- See Also:
-
getMaximumScale
public double getMaximumScale()Returns the maximum scale for drawing labels.- Returns:
- the maximum scale.
-
setMaximumScale
public void setMaximumScale(double maximumScale) Sets the maximum scale for drawing labels.- Parameters:
maximumScale- the maximum scale.
-
getMinimumScale
public double getMinimumScale()Returns the minimum scale for drawing labels.- Returns:
- the minimum scale.
-
setMinimumScale
public void setMinimumScale(double minimumScale) Sets the minimum scale for drawing labels.- Parameters:
minimumScale- the minimum scale.
-
isAutoLabelling
public boolean isAutoLabelling()Returns whether automatic labelling is enabled.- Returns:
- whether automatic labelling is enabled.
-
setAutoLabelling
public void setAutoLabelling(boolean autoLabelling) Sets whether automatic labelling is enabled.- Parameters:
autoLabelling- the new state of the property.
-
doOrientedLabels
Deprecated.use isOrientedLabels() insteadReturns whether labels should be drawn oriented.- Returns:
- whether labels should be drawn oriented.
-
isOrientedLabels
public boolean isOrientedLabels()Returns whether labels should be drawn oriented.- Returns:
- whether labels should be drawn oriented.
- Since:
- 6.0
-
doPreventLabelDuplication
Deprecated.use isPreventLabelDuplication() insteadReturns whether labels duplication prevention is enabled.- Returns:
- whether labels duplication prevention is enabled.
-
isPreventLabelDuplication
public boolean isPreventLabelDuplication()Returns whether labels duplication prevention is enabled.- Returns:
- whether labels duplication prevention is enabled.
- Since:
- 6.0
-
setPreventLabelDuplication
public void setPreventLabelDuplication(boolean preventLabelDuplication) Enables or disables labels duplication prevention.- Parameters:
preventLabelDuplication- the new state of the property.
-
setOrientedLabels
public void setOrientedLabels(boolean orientedLabels) Sets whether label should be drawn oriented on linear geometries.- Parameters:
orientedLabels- the new state of the property.
-
isAllowsOverlappingLabels
public boolean isAllowsOverlappingLabels()Returns whether labels overlapping is permitted.- Returns:
- whether labels overlapping is permitted.
-
setAllowsOverlappingLabels
public void setAllowsOverlappingLabels(boolean allowsOverlappingLabels) Sets whether labels overlapping is permitted.- Parameters:
allowsOverlappingLabels- the flag state.
-
setParseNumericLabels
public void setParseNumericLabels(boolean parseNumericLabels) -
isParseNumericLabels
public boolean isParseNumericLabels() -
isSymbolUnderLabels
public boolean isSymbolUnderLabels() -
setSymbolUnderLabels
public void setSymbolUnderLabels(boolean symbolUnderLabels) -
getFixedScale
public double getFixedScale() -
setFixedScale
public void setFixedScale(double fixedScale) -
getOffsetX
public int getOffsetX() -
setOffsetX
public void setOffsetX(int offsetX) -
getOffsetY
public int getOffsetY() -
setOffsetY
public void setOffsetY(int offsetY) -
clone
-
isDrawFrame
public boolean isDrawFrame()Indicates whether a polygon frame should be drawn behind the label.- Returns:
- true if frame must be drawn
-
setDrawFrame
public void setDrawFrame(boolean drawFrame) Sets whether a polygon frame should be drawn behind the label.- Parameters:
drawFrame- true if frame must be drawn
-
getDrawFrameColor
Returns the color of the polygon frame drawn behind the label.- Returns:
- color of the polygon
- Since:
- 6.0
-
setDrawFrameColor
Sets the color of the polygon frame drawn behind the label.- Parameters:
drawFrameColor- the color of the polygon- Since:
- 6.0
-
isAllowsPartialLabels
public boolean isAllowsPartialLabels()Returns whether partial labels are permitted.- Returns:
- whether partial labels overlapping are permitted.
-
setAllowsPartialLabels
public void setAllowsPartialLabels(boolean allowsPartialLabels) Sets whether partial labels are permitted. -
isDynamicPlacement
public boolean isDynamicPlacement()Returns whether dynamic placement is enabled.- Returns:
- whether dynamic placement is enabled.
-
setDynamicPlacement
public void setDynamicPlacement(boolean dynamicPlacement) Sets whether dynamic placement is enabled. -
isCurvedLabels
public boolean isCurvedLabels()Returns whether curved labels is enabled. This property applies only on Polylines.- Returns:
- whether curved labels is enabled.
-
setCurvedLabels
public void setCurvedLabels(boolean curvedLabels) Sets whether curved labels is enabled. This property applies only on Polylines. -
setDrawFrameBorderColor
-
removeTranslationsOtherThan
Description copied from class:LocalizedObjectRemoves anyLocalefrom this object that are not in the specifiedlocales.locales[0]should be the default language- Overrides:
removeTranslationsOtherThanin classLocalizedObject- Parameters:
locales-
-