Class LabelsConfiguration

java.lang.Object
com.kheops.jmap.metadata.LocalizedObject
com.kheops.jmap.client.layers.LabelsConfiguration
All Implemented Interfaces:
Serializable, Cloneable

public class LabelsConfiguration extends LocalizedObject implements Serializable, Cloneable
See Also:
  • Field Details

    • LABEL_PRIORITY_COMPARATOR

      public static final Comparator<LabelsConfiguration.LabelPriority> LABEL_PRIORITY_COMPARATOR
    • DEFAULT_POSITIONING_TYPE

      public static final LabelsConfiguration.PositioningType DEFAULT_POSITIONING_TYPE
    • DEFAULT_LAYER_PRIORITY

      public static final Integer DEFAULT_LAYER_PRIORITY
    • CLOCKWISE

      @Deprecated public static final int CLOCKWISE
      Deprecated.
      Use the constant CLOCKWISE from the class GeometryUtil
      Constant for the clockwise direction.
      See Also:
    • COUNTERCLOCKWISE

      @Deprecated public static final int COUNTERCLOCKWISE
      Deprecated.
      Use the constant COUNTERCLOCKWISE from the class GeometryUtil
      Constant for the counterclockwise direction.
      See Also:
    • minimumScale

      protected double minimumScale
      Sets the current minimum scale at which the labels should be drawn on a layer if autoLabel mode is active.
    • maximumScale

      protected double maximumScale
      Defines the current maximum scale at which the labels should be drawn on a layer if autoLabel mode is active.
    • autoLabelling

      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.
    • orientedLabels

      protected boolean orientedLabels
      Defines if labels should be oriented when drawn on polylines.
    • preventLabelDuplication

      protected boolean preventLabelDuplication
      Defines if labels duplication should be prevent.
    • allowsOverlappingLabels

      protected boolean allowsOverlappingLabels
      Defines if labels can overlap, overriding the project flag
    • allowsPartialLabels

      protected boolean allowsPartialLabels
      Defines if labels can be partially included in the map (edges of the view)
    • dynamicPlacement

      protected boolean dynamicPlacement
      Defines if labels can be dynamically placed to improve their visibility on the map.
    • symbolUnderLabels

      protected boolean symbolUnderLabels
    • parseNumericLabels

      protected boolean parseNumericLabels
    • labelPosition

      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 ...)
      See Also:
    • fixedScale

      protected double fixedScale
    • offsetX

      protected int offsetX
    • offsetY

      protected int offsetY
    • angleAttribute

      protected Attribute angleAttribute
      Defines the attribute that contain the rotation angle (in degrees).
    • rotationDirection

      protected int rotationDirection
      Defines the direction of the labels rotation (CLOCKWISE or COUNTERCLOCKWISE).
    • rotationUnit

      protected int rotationUnit
      Defines the unit of the labels rotation (DEGREE or RADIAN).
    • rotationOrigin

      protected GeometryUtil.RotationOrigin rotationOrigin
    • followMapRotation

      protected boolean followMapRotation
      Defines if labels should follow map rotation.
    • labelText

      protected String labelText
    • drawFrame

      protected boolean drawFrame
    • curvedLabels

      protected boolean curvedLabels
      Defines if labels follow the curve of a polyline.
  • Constructor Details

    • LabelsConfiguration

      public LabelsConfiguration()
  • Method Details

    • getLabelText

      public String getLabelText(Locale locale)
      Returns the label text value for a specific locale.
      Parameters:
      locale -
      Returns:
      the label text
    • setLabelText

      public void setLabelText(String labelText, Locale locale)
      Sets the label text with the specified string for a specific locale.
      Parameters:
      labelText - the new label text
      locale -
    • 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 public boolean doOrientedLabels()
      Deprecated.
      use isOrientedLabels() instead
      Returns 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 public boolean doPreventLabelDuplication()
      Deprecated.
      use isPreventLabelDuplication() instead
      Returns 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

      public Object clone()
      Overrides:
      clone in class Object
    • 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

      public Color getDrawFrameColor()
      Returns the color of the polygon frame drawn behind the label.
      Returns:
      color of the polygon
      Since:
      6.0
    • setDrawFrameColor

      public void setDrawFrameColor(Color drawFrameColor)
      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

      public void setDrawFrameBorderColor(Color drawFrameBorderColor)
    • removeTranslationsOtherThan

      public void removeTranslationsOtherThan(Locale[] locales)
      Description copied from class: LocalizedObject
      Removes any Locale from this object that are not in the specified locales. locales[0] should be the default language
      Overrides:
      removeTranslationsOtherThan in class LocalizedObject
      Parameters:
      locales -