Package org.mapfish.print.attribute
Class ScalebarAttribute.ScalebarAttributeValues
- java.lang.Object
-
- org.mapfish.print.attribute.ScalebarAttribute.ScalebarAttributeValues
-
- Enclosing class:
- ScalebarAttribute
public class ScalebarAttribute.ScalebarAttributeValues extends java.lang.Object
The value ofScalebarAttribute
.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.String
align
The horizontal alignment of the scalebar inside the scalebar graphic (default: left).java.lang.String
backgroundColor
The background color for the scalebar graphic (default: rgba(255, 255, 255, 0)).java.lang.String
barBgColor
The color used to draw the alternating blocks for style "bar" and "bar_sub" (default: white).java.lang.Integer
barSize
The thickness of the bar or the height of the tick marks on the line (in pixel).java.lang.String
color
The color used to draw the bar and lines (default: black).java.lang.String
font
The font used for the labels (default: Helvetica).java.lang.String
fontColor
The font color of the labels (default: black).java.lang.Integer
fontSize
The font size (in pt) of the labels (default: 12).boolean
geodetic
Use geodetic measurement calculations for the scalebar.java.lang.Integer
intervals
The number of intervals (default: 3).java.lang.Integer
labelDistance
The distance between scalebar and labels (in pixel).float
labelRotation
Rotate the label to some degree.java.lang.Integer
lineWidth
The thickness of the lines or the bar border (in pixel).java.lang.Boolean
lockUnits
Force that the given unit is used (default: false).java.lang.String
orientation
The scalebar orientation.java.lang.Integer
padding
The padding around the scalebar (in pixel).java.lang.Boolean
renderAsSvg
Indicates if the scalebar graphic is rendered as SVG (will default toConfiguration.defaultToSvg
).java.lang.Boolean
subIntervals
Should sub-intervals be shown? Default: falsejava.lang.String
type
The scalebar type.java.lang.String
unit
The unit to use.java.lang.String
verticalAlign
The vertical alignment of the scalebar inside the scalebar graphic (default: bottom).
-
Constructor Summary
Constructors Constructor Description ScalebarAttributeValues(java.awt.Dimension size, boolean createSubReport)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HorizontalAlign
getAlign()
java.awt.Color
getBackgroundColor()
java.awt.Color
getBarBgColor()
java.awt.Color
getColor()
java.awt.Color
getFontColor()
float
getLabelRotation()
Orientation
getOrientation()
java.awt.Dimension
getSize()
Type
getType()
DistanceUnit
getUnit()
VerticalAlign
getVerticalAlign()
boolean
isCreateSubReport()
void
postConstruct()
Initialize default values and validate that the config is correct.
-
-
-
Field Detail
-
type
public java.lang.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 java.lang.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 java.lang.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 java.lang.Integer intervals
The number of intervals (default: 3). There must be at least two intervals.
-
subIntervals
public java.lang.Boolean subIntervals
Should sub-intervals be shown? Default: falseThe 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 java.lang.Integer barSize
The thickness of the bar or the height of the tick marks on the line (in pixel).
-
lineWidth
public java.lang.Integer lineWidth
The thickness of the lines or the bar border (in pixel).
-
labelDistance
public java.lang.Integer labelDistance
The distance between scalebar and labels (in pixel).
-
padding
public java.lang.Integer padding
The padding around the scalebar (in pixel).
-
font
public java.lang.String font
The font used for the labels (default: Helvetica).
-
fontSize
public java.lang.Integer fontSize
The font size (in pt) of the labels (default: 12).
-
fontColor
public java.lang.String fontColor
The font color of the labels (default: black).
-
color
public java.lang.String color
The color used to draw the bar and lines (default: black).
-
barBgColor
public java.lang.String barBgColor
The color used to draw the alternating blocks for style "bar" and "bar_sub" (default: white).
-
backgroundColor
public java.lang.String backgroundColor
The background color for the scalebar graphic (default: rgba(255, 255, 255, 0)).
-
orientation
public java.lang.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 java.lang.String align
The horizontal alignment of the scalebar inside the scalebar graphic (default: left).
-
verticalAlign
public java.lang.String verticalAlign
The vertical alignment of the scalebar inside the scalebar graphic (default: bottom).
-
renderAsSvg
public java.lang.Boolean renderAsSvg
Indicates if the scalebar graphic is rendered as SVG (will default toConfiguration.defaultToSvg
).
-
-
Method Detail
-
postConstruct
public final void postConstruct()
Initialize default values and validate that the config is correct.
-
getSize
public final java.awt.Dimension getSize()
-
getColor
public final java.awt.Color getColor()
-
getFontColor
public final java.awt.Color getFontColor()
-
getBarBgColor
public final java.awt.Color getBarBgColor()
-
getBackgroundColor
public final java.awt.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()
-
-