deegree 2.3 (2010/04/09 10:10 build-4-official)

org.deegree.graphics.legend
Class LegendElementCollection

java.lang.Object
  extended by org.deegree.graphics.legend.LegendElement
      extended by org.deegree.graphics.legend.LegendElementCollection

public class LegendElementCollection
extends LegendElement

LegendElementCollection is a collection of LegendElements and is a LegendElement too. It can be used to group elements or to create more complex elements.

Version:
$Revision: 7363 $ $Date: 2007-05-29 20:47:55 +0200 (Di, 29 Mai 2007) $
Author:
Andreas Poth

Field Summary
(package private)  ArrayList<LegendElement> collection
           
(package private)  String title
           
 
Fields inherited from class org.deegree.graphics.legend.LegendElement
active, bi, bufferBetweenLegendAndLabel, height, label, labelPosition, orientation, ruleslist, width
 
Constructor Summary
LegendElementCollection()
          empty constructor
LegendElementCollection(String title)
           
 
Method Summary
 void addLegendElement(LegendElement legendElement)
          adds a LegendElement to the collection.
 BufferedImage exportAsImage(String mime)
          exports the LegendElement as BufferedImage
 LegendElement[] getLegendElements()
           
 int getSize()
          returns the number of legend elements as an int
 String getTitle()
          returns the title of the LegendElement
 void setTitle(String title)
          sets the title of the LegendElement.
 
Methods inherited from class org.deegree.graphics.legend.LegendElement
addRule, calculateFontMetrics, drawLineStringLegend, drawPointLegend, drawPolygonLegend, getBufferBetweenLegendAndLabel, getHeight, getLabel, getLabelOrientation, getLabelPlacement, getRules, getWidth, isActive, setActive, setBufferBetweenLegendAndLabel, setHeight, setLabel, setLabelOrientation, setLabelPlacement, setRules, setWidth
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

collection

ArrayList<LegendElement> collection

title

String title
Constructor Detail

LegendElementCollection

public LegendElementCollection()
empty constructor


LegendElementCollection

public LegendElementCollection(String title)
Parameters:
title -
Method Detail

addLegendElement

public void addLegendElement(LegendElement legendElement)
adds a LegendElement to the collection.

Parameters:
legendElement - to add

getLegendElements

public LegendElement[] getLegendElements()
Returns:
all legend elements

setTitle

public void setTitle(String title)
sets the title of the LegendElement. The title will be displayed on top of the LegendElementCollection

Parameters:
title - title of the LegendElement

getTitle

public String getTitle()
returns the title of the LegendElement

Returns:
the title of the LegendElement

getSize

public int getSize()
returns the number of legend elements as an int

Returns:
number of legend elements

exportAsImage

public BufferedImage exportAsImage(String mime)
                            throws LegendException
Description copied from class: LegendElement
exports the LegendElement as BufferedImage

Overrides:
exportAsImage in class LegendElement
Parameters:
mime - the mime type of the requested legend (like image/png, etc)
Returns:
the legend as image
Throws:
LegendException

deegree 2.3 (2010/04/09 10:10 build-4-official)

an open source project founded by lat/lon, Bonn, Germany.
For more information visit: http://www.deegree.org