class ScaleBarItem extends Item
Adds scale bar to a cartographic document.
| Modifiers | Name | Description |
|---|---|---|
static class |
ScaleBarItem.ScaleBarInfo |
|
static enum |
ScaleBarItem.Units |
| Type | Name and description |
|---|---|
int |
border |
java.awt.Color |
fillColor |
java.awt.Font |
font |
Map |
map |
java.awt.Color |
strokeColor |
float |
strokeWidth |
ScaleBarItem.Units |
units |
| Constructor and description |
|---|
ScaleBarItem
(int x, int y, int width, int height)Create a scale bar from the top left with the given width and height. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
ScaleBarItem |
border(int border)Set the border padding |
|
ScaleBarItem.ScaleBarInfo |
calculateScaleBarInfo()Calculate the scale bar information |
|
ScaleBarItem |
fillColor(java.awt.Color fillColor)Set the fill Color |
|
ScaleBarItem |
font(java.awt.Font font)Set the Font |
|
ScaleBarItem |
map(Map map)Set the Map to use when calculating the map scale |
|
ScaleBarItem |
strokeColor(java.awt.Color strokeColor)Set stroke Color |
|
ScaleBarItem |
strokeWidth(float strokeWidth)Set the stroke width |
|
ScaleBarItem |
units(ScaleBarItem.Units units)Set the Units (US or METRIC) to use |
| Methods inherited from class | Name |
|---|---|
class Item |
getRectangle |
Create a scale bar from the top left with the given width and height.
x - The number of pixels from the lefty - The number of pixels from the topwidth - The width in pixelsheight - The height in pixelsSet the border padding
border - The border paddingCalculate the scale bar information
Set the fill Color
fillColor - The fill ColorSet the Font
font - The FontSet the Map to use when calculating the map scale
map - The MapSet stroke Color
strokeColor - The stroke ColorSet the stroke width
strokeWidth - The stroke widthSet the Units (US or METRIC) to use
units - Units (US or METRIC)Groovy Documentation