com.jrefinery.chart
Class LegendTitle

java.lang.Object
  extended by com.jrefinery.chart.AbstractTitle
      extended by com.jrefinery.chart.LegendTitle
All Implemented Interfaces:
java.lang.Cloneable

public abstract class LegendTitle
extends AbstractTitle

A chart title that displays a legend for the data in the chart.

The title can be populated with legend items manually, or you can assign a reference to the chart, in which case the legend items will be automatically created to match the dataset.


Field Summary
protected  LegendItemCollection items
          A container for the legend items.
protected  LegendItemLayout layout
          The object responsible for arranging the legend items to fit in whatever space is available.
 
Fields inherited from class com.jrefinery.chart.AbstractTitle
BOTTOM, CENTER, DEFAULT_HORIZONTAL_ALIGNMENT, DEFAULT_POSITION, DEFAULT_SPACER, DEFAULT_VERTICAL_ALIGNMENT, EAST, horizontalAlignment, LEFT, listeners, MIDDLE, NORTH, notify, position, RIGHT, SOUTH, spacer, TOP, verticalAlignment, WEST
 
Constructor Summary
LegendTitle()
          Constructs a new, empty LegendTitle.
LegendTitle(LegendItemLayout layout)
           
 
Method Summary
 void addLegendItem(LegendItem item)
          Adds a legend item to the LegendTitle.
 void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D area)
          Draws the title on a Java 2D graphics device (such as the screen or a printer).
 
Methods inherited from class com.jrefinery.chart.AbstractTitle
addChangeListener, clone, getHorizontalAlignment, getNotify, getPosition, getPreferredHeight, getPreferredWidth, getSpacer, getVerticalAlignment, isValidHorizontalAlignment, isValidPosition, isValidVerticalAlignment, notifyListeners, removeChangeListener, setHorizontalAlignment, setNotify, setPosition, setSpacer, setVerticalAlignment
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

items

protected LegendItemCollection items
A container for the legend items.


layout

protected LegendItemLayout layout
The object responsible for arranging the legend items to fit in whatever space is available.

Constructor Detail

LegendTitle

public LegendTitle()
Constructs a new, empty LegendTitle.


LegendTitle

public LegendTitle(LegendItemLayout layout)
Method Detail

addLegendItem

public void addLegendItem(LegendItem item)
Adds a legend item to the LegendTitle.


draw

public void draw(java.awt.Graphics2D g2,
                 java.awt.geom.Rectangle2D area)
Draws the title on a Java 2D graphics device (such as the screen or a printer).

Specified by:
draw in class AbstractTitle
Parameters:
g2 - The graphics device.
area - The area for the chart and all its titles.


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.