class LegendItem extends Item
Add a Legend to a cartographic document.
| Modifiers | Name | Description |
|---|---|---|
protected static class |
LegendItem.LegendEntry |
|
protected static enum |
LegendItem.LegendEntryType |
| Type | Name and description |
|---|---|
java.awt.Color |
backgroundColor |
java.util.List<LegendEntry> |
entries |
int |
gapBetweenEntries |
int |
legendEntryHeight |
int |
legendEntryWidth |
java.lang.String |
numberFormat |
java.awt.Color |
textColor |
java.awt.Font |
textFont |
java.lang.String |
title |
java.awt.Color |
titleColor |
java.awt.Font |
titleFont |
| Constructor and description |
|---|
LegendItem
(int x, int y, int width, int height)Create a Legend from the top left with the given width and height. |
| Type Params | Return Type | Name and description |
|---|---|---|
|
LegendItem |
addColorMapEntry(java.lang.String title, ColorMap colorMap)Add a ColorMap legend entry |
|
LegendItem |
addGroupEntry(java.lang.String title)Add a Group Entry |
|
LegendItem |
addImageEntry(java.lang.String title, java.awt.Image image)Add an Image Entry |
|
LegendItem |
addLayer(Layer layer)Add Legend entries for a Layer |
|
LegendItem |
addLineEntry(java.lang.String title, Style symbolizer)Add a Line legend entry |
|
LegendItem |
addMap(Map map)Add Legend entries for a Map |
|
LegendItem |
addPointEntry(java.lang.String title, Style symbolizer)Add a Point legend entry |
|
LegendItem |
addPolygonEntry(java.lang.String title, Style symbolizer)Add a Polygon legend entry |
|
LegendItem |
addRaster(Raster raster)Add Legend entries for a Raster |
|
LegendItem |
backgroundColor(java.awt.Color backgroundColor)Set the background color |
|
LegendItem |
gapBetweenEntries(int gapBetweenEntries)Set the gap between entries |
|
LegendItem |
legendEntryHeight(int legendEntryHeight)Set the legen entry height |
|
LegendItem |
legendEntryWidth(int legendEntryWidth)Set the legend entry width |
|
LegendItem |
numberFormat(java.lang.String numberFormat)Set the number format |
|
LegendItem |
textColor(java.awt.Color textColor)Set the text Color |
|
LegendItem |
textFont(java.awt.Font textFont)Set the text Font |
|
LegendItem |
title(java.lang.String title)Set the legend title |
|
LegendItem |
titleColor(java.awt.Color titleColor)Set the title Color |
|
LegendItem |
titleFont(java.awt.Font titleFont)Set the title Font |
|
java.lang.String |
toString() |
| Methods inherited from class | Name |
|---|---|
class Item |
getRectangle |
Create a Legend 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 pixelsAdd a ColorMap legend entry
title - The titlesymbolizer - The Raster's SymbolizerAdd a Group Entry
title - The titleAdd an Image Entry
title - The titleAdd Legend entries for a Layer
layer - A LayerAdd a Line legend entry
title - The titlesymbolizer - The Line's SymbolizerAdd Legend entries for a Map
map - The MapAdd a Point legend entry
title - The titlesymbolizer - The Point's SymbolizerAdd a Polygon legend entry
title - The titlesymbolizer - The Polygon's SymbolizerAdd Legend entries for a Raster
raster - The RasterSet the background color
backgroundColor - The background colorSet the gap between entries
gapBetweenEntries - The gap between entriesSet the legen entry height
legendEntryHeight - The legend entry heightSet the legend entry width
legendEntryWidth - The legend entry widthSet the number format
numberFormat - The number formatSet the text Color
textColor - The text ColorSet the text Font
textFont - The text FontSet the legend title
title - The titleSet the title Color
titleColor - The title ColorSet the title Font
titleFont - The title FontGroovy Documentation