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