Class ScalebarAttribute.ScalebarAttributeValues

java.lang.Object
org.mapfish.print.attribute.ScalebarAttribute.ScalebarAttributeValues
Enclosing class:
ScalebarAttribute

public static class ScalebarAttribute.ScalebarAttributeValues extends Object
The value of ScalebarAttribute.
  • Field Details

    • type

      public String type
      The scalebar type.

      Available types:

      • "line": A simple line with graduations.
      • "bar" (default): A thick bar with alternating black and white zones marking the intervals. The colors can be customized by changing the properties `color` and `barBgColor`.
      • "bar_sub": Like "bar", but with little ticks for the labels.
    • unit

      public String unit
      The unit to use.

      The unit can be any of:

      • m (mm, cm, m or km)
      • ft (in, ft, yd, mi)
      • degrees (min, sec, °)

      If the value is too big or too small, the module will switch to one of the unit in parenthesis (the same unit is used for every interval). If this behavior is not desired, the `lockUnits` parameter will force the declared unit (or map unit if no unit is declared) to be used for the scalebar.

    • geodetic

      public boolean geodetic
      Use geodetic measurement calculations for the scalebar.
    • lockUnits

      public Boolean lockUnits
      Force that the given unit is used (default: false). For example if the unit is set to meters and `lockUnits` is enabled, then meters is always used, even when kilometers would create nicer values.
    • intervals

      public Integer intervals
      The number of intervals (default: 3). There must be at least two intervals.
    • subIntervals

      public Boolean subIntervals
      Should sub-intervals be shown? Default: false

      The main intervals are divided into additional sub-intervals to provide visual guidance. The number of sub-intervals depends on the length of an interval.

    • barSize

      public Integer barSize
      The thickness of the bar or the height of the tick marks on the line (in pixel).
    • lineWidth

      public Integer lineWidth
      The thickness of the lines or the bar border (in pixel).
    • labelDistance

      public Integer labelDistance
      The distance between scalebar and labels (in pixel).
    • padding

      public Integer padding
      The padding around the scalebar (in pixel).
    • font

      public String font
      The font used for the labels (default: Helvetica).
    • fontSize

      public Integer fontSize
      The font size (in pt) of the labels (default: 12).
    • fontColor

      public String fontColor
      The font color of the labels (default: black).
    • color

      public String color
      The color used to draw the bar and lines (default: black).
    • barBgColor

      public String barBgColor
      The color used to draw the alternating blocks for style "bar" and "bar_sub" (default: white).
    • backgroundColor

      public String backgroundColor
      The background color for the scalebar graphic (default: rgba(255, 255, 255, 0)).
    • orientation

      public String orientation
      The scalebar orientation.

      Available options:

      • "horizontalLabelsBelow" (default): Horizontal scalebar and the labels are shown below the bar.
      • "horizontalLabelsAbove": Horizontal scalebar and the labels are shown above the bar.
      • "verticalLabelsLeft": Vertical scalebar and the labels are shown left of the bar.
      • "verticalLabelsRight": Vertical scalebar and the labels are shown right of the bar.
    • labelRotation

      public float labelRotation
      Rotate the label to some degree.
    • align

      public String align
      The horizontal alignment of the scalebar inside the scalebar graphic (default: left).
    • verticalAlign

      public String verticalAlign
      The vertical alignment of the scalebar inside the scalebar graphic (default: bottom).
    • renderAsSvg

      public Boolean renderAsSvg
      Indicates if the scalebar graphic is rendered as SVG (will default to Configuration.defaultToSvg).
  • Constructor Details

    • ScalebarAttributeValues

      public ScalebarAttributeValues(Dimension size, boolean createSubReport)
      Constructor.
      Parameters:
      size - The size of the scalebar graphic in the Jasper report (in pixels).
      createSubReport - Create a sub-report?
  • Method Details

    • postConstruct

      public final void postConstruct()
      Initialize default values and validate that the config is correct.
    • getSize

      public final Dimension getSize()
    • getColor

      public final Color getColor()
    • getFontColor

      public final Color getFontColor()
    • getBarBgColor

      public final Color getBarBgColor()
    • getBackgroundColor

      public final Color getBackgroundColor()
    • getType

      public final Type getType()
      Returns:
      Return the scalebar type.
    • getUnit

      public final DistanceUnit getUnit()
      Returns:
      Return the unit to use for the scalebar.
    • getOrientation

      public final Orientation getOrientation()
      Returns:
      Return the scalebar orientation.
    • getLabelRotation

      public final float getLabelRotation()
      Returns:
      Return the label rotation
    • getAlign

      public final HorizontalAlign getAlign()
      Returns:
      Return the horizontal alignment.
    • getVerticalAlign

      public final VerticalAlign getVerticalAlign()
      Returns:
      Return the vertical alignment.
    • isCreateSubReport

      public final boolean isCreateSubReport()