public class ScalebarGraphic
extends java.lang.Object
| Constructor and Description |
|---|
ScalebarGraphic() |
| Modifier and Type | Method and Description |
|---|---|
protected static java.lang.String |
createLabelText(DistanceUnit scaleUnit,
double value,
DistanceUnit intervalUnit)
Format the label text.
|
protected static int |
getBarSize(ScaleBarRenderSettings settings)
Get the bar size.
|
protected static int |
getLabelDistance(ScaleBarRenderSettings settings)
Get the label distance..
|
protected static java.awt.Dimension |
getMaxLabelSize(ScaleBarRenderSettings settings)
Get the maximum width and height of the labels.
|
protected static double |
getNearestNiceValue(double value,
DistanceUnit scaleUnit,
boolean lockUnits)
Reduce the given value to the nearest smaller 1 significant digit number starting
with 1, 2 or 5.
|
protected static java.awt.Dimension |
getSize(ScalebarAttribute.ScalebarAttributeValues scalebarParams,
ScaleBarRenderSettings settings,
java.awt.Dimension maxLabelSize)
Get the size of the painting area required to draw the scalebar with labels.
|
java.net.URI |
render(MapfishMapContext mapContext,
ScalebarAttribute.ScalebarAttributeValues scalebarParams,
java.io.File tempFolder,
Template template)
Render the scalebar.
|
public final java.net.URI render(MapfishMapContext mapContext, ScalebarAttribute.ScalebarAttributeValues scalebarParams, java.io.File tempFolder, Template template) throws java.io.IOException, javax.xml.parsers.ParserConfigurationException
mapContext - The context of the map for which the scalebar is created.scalebarParams - The scalebar parameters.tempFolder - The directory in which the graphic file is created.template - The template that containts the scalebar processorjava.io.IOExceptionjavax.xml.parsers.ParserConfigurationExceptionprotected static java.awt.Dimension getSize(ScalebarAttribute.ScalebarAttributeValues scalebarParams, ScaleBarRenderSettings settings, java.awt.Dimension maxLabelSize)
scalebarParams - Parameters for the scalebar.settings - Parameters for rendering the scalebar.maxLabelSize - The max. size of the labels.protected static java.awt.Dimension getMaxLabelSize(ScaleBarRenderSettings settings)
settings - Parameters for rendering the scalebar.protected static java.lang.String createLabelText(DistanceUnit scaleUnit, double value, DistanceUnit intervalUnit)
scaleUnit - The unit used for the scalebar.value - The scale value.intervalUnit - The scaled unit for the intervals.protected static double getNearestNiceValue(double value,
DistanceUnit scaleUnit,
boolean lockUnits)
value - the value to find a nice number for.scaleUnit - the unit of the value.lockUnits - if set, the values are not scaled to a "nicer" unit.protected static int getBarSize(ScaleBarRenderSettings settings)
settings - Parameters for rendering the scalebar.protected static int getLabelDistance(ScaleBarRenderSettings settings)
settings - Parameters for rendering the scalebar.