|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Legend | +--com.jrefinery.chart.StandardLegend
A chart legend shows the names and visual representations of the series that are plotted in a chart.
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
Default font. |
Fields inherited from class com.jrefinery.chart.Legend |
EAST, HORIZONTAL, INVERTED, NORTH, SOUTH, WEST |
Constructor Summary | |
StandardLegend(JFreeChart chart)
Constructs a new legend with default settings. |
|
StandardLegend(JFreeChart chart,
int outerGap,
Spacer innerGap,
java.awt.Paint backgroundPaint,
java.awt.Stroke outlineStroke,
java.awt.Paint outlinePaint,
java.awt.Font itemFont,
java.awt.Paint itemPaint)
Constructs a new legend. |
Method Summary | |
java.awt.geom.Rectangle2D |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D available)
Draws the legend on a Java 2D graphics device (such as the screen or a printer). |
protected java.awt.geom.Rectangle2D |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D available,
boolean horizontal,
boolean inverted)
Draws the legend. |
java.awt.Paint |
getBackgroundPaint()
Returns the background color for the legend. |
java.awt.Font |
getItemFont()
Returns the series label font. |
java.awt.Paint |
getItemPaint()
Returns the series label color. |
java.awt.Paint |
getKeyBoxOutlinePaint()
Returns the paint used to outline key boxes. |
java.awt.Stroke |
getKeyBoxOutlineStroke()
Returns the stroke used to outline key boxes. |
java.awt.Paint |
getOutlinePaint()
Returns the outline color. |
java.awt.Stroke |
getOutlineStroke()
Returns the outline pen/brush. |
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background color of the legend. |
void |
setItemFont(java.awt.Font font)
Sets the series label font. |
void |
setItemPaint(java.awt.Paint paint)
Sets the series label color. |
void |
setKeyBoxOutlinePaint(java.awt.Paint paint)
Sets the paint used to outline key boxes. |
void |
setKeyBoxOutlineStroke(java.awt.Stroke stroke)
Sets the stroke used to outline key boxes. |
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline color. |
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline pen/brush. |
Methods inherited from class com.jrefinery.chart.Legend |
addChangeListener, createInstance, getAnchor, getChart, getOuterGap, getOutlineKeyBoxes, notifyListeners, removeChangeListener, setAnchor, setOutlineKeyBoxes |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.awt.Font DEFAULT_FONT
Constructor Detail |
public StandardLegend(JFreeChart chart)
chart
- the chart that the legend belongs to.public StandardLegend(JFreeChart chart, int outerGap, Spacer innerGap, java.awt.Paint backgroundPaint, java.awt.Stroke outlineStroke, java.awt.Paint outlinePaint, java.awt.Font itemFont, java.awt.Paint itemPaint)
chart
- the chart that the legend belongs to.outerGap
- the gap around the outside of the legend.innerGap
- the gap inside the legend.backgroundPaint
- the background color.outlineStroke
- the pen/brush used to draw the outline.outlinePaint
- the color used to draw the outline.itemFont
- the font used to draw the legend items.itemPaint
- the color used to draw the legend items.Method Detail |
public java.awt.Paint getBackgroundPaint()
public void setBackgroundPaint(java.awt.Paint paint)
Registered listeners are notified that the legend has changed.
paint
- the new background color.public java.awt.Stroke getOutlineStroke()
public void setOutlineStroke(java.awt.Stroke stroke)
Registered listeners are notified that the legend has changed.
stroke
- the new outline pen/brush.public java.awt.Paint getOutlinePaint()
public void setOutlinePaint(java.awt.Paint paint)
Registered listeners are notified that the legend has changed.
paint
- the new outline color.public java.awt.Font getItemFont()
public void setItemFont(java.awt.Font font)
Registered listeners are notified that the legend has changed.
font
- the new series label font.public java.awt.Paint getItemPaint()
public void setItemPaint(java.awt.Paint paint)
Registered listeners are notified that the legend has changed.
paint
- the new series label color.public java.awt.Stroke getKeyBoxOutlineStroke()
public void setKeyBoxOutlineStroke(java.awt.Stroke stroke)
Registered listeners are notified of the change.
stroke
- the stroke.public java.awt.Paint getKeyBoxOutlinePaint()
public void setKeyBoxOutlinePaint(java.awt.Paint paint)
Registered listeners are notified of the change.
paint
- the paint.public java.awt.geom.Rectangle2D draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D available)
draw
in class Legend
g2
- the graphics device.available
- the area within which the legend, and afterwards the plot, should be
drawn.protected java.awt.geom.Rectangle2D draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D available, boolean horizontal, boolean inverted)
g2
- the graphics device.available
- the area available for drawing the chart.horizontal
- a flag indicating whether the legend items are laid out horizontally.inverted
- ???
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |