Fairness.Graphing
Class Legend

java.lang.Object
  extended by Fairness.Graphing.Legend
All Implemented Interfaces:
edu.rit.swing.Displayable, edu.rit.swing.Drawable

public class Legend
extends java.lang.Object
implements edu.rit.swing.Displayable

Legend provides a Displayable legend that is drawn on the bottom of another Displayable (such as a Graph). Currently this class is used only internally in the Graph to draw its legend.


Constructor Summary
Legend(edu.rit.swing.Displayable host)
          Creates a new Legend that draws over the given host.
 
Method Summary
 void addLegendItem(edu.rit.swing.Displayable d)
          Adds an item to be displayed in the Legend -- normally a LegendItem.
 void draw(java.awt.Graphics2D g2d)
          Draw this drawable object in the given graphics context.
 java.awt.Paint getBackgroundPaint()
          Returns this displayable object's background paint.
 java.awt.geom.Rectangle2D getBoundingBox()
          Returns this displayable object's bounding box.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Legend

public Legend(edu.rit.swing.Displayable host)
Creates a new Legend that draws over the given host.

Method Detail

addLegendItem

public void addLegendItem(edu.rit.swing.Displayable d)
Adds an item to be displayed in the Legend -- normally a LegendItem.

Parameters:
d - non-null Displayable

getBoundingBox

public java.awt.geom.Rectangle2D getBoundingBox()
Returns this displayable object's bounding box. This is the smallest rectangle that encloses all of this displayable object.

Specified by:
getBoundingBox in interface edu.rit.swing.Displayable

getBackgroundPaint

public java.awt.Paint getBackgroundPaint()
Returns this displayable object's background paint.

Specified by:
getBackgroundPaint in interface edu.rit.swing.Displayable

draw

public void draw(java.awt.Graphics2D g2d)
Draw this drawable object in the given graphics context. Upon return from this method, the given graphics context's state (color, font, transform, clip, and so on) is the same as it was upon entry to this method.

Specified by:
draw in interface edu.rit.swing.Drawable
Parameters:
g2d - 2-D graphics context.