|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jfree.chart.Legend
org.jfree.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.Paint |
DEFAULT_BACKGROUND_PAINT
The default background paint. |
static org.jfree.ui.Spacer |
DEFAULT_INNER_GAP
The default inner gap. |
static java.awt.Font |
DEFAULT_ITEM_FONT
The default item font. |
static org.jfree.ui.Spacer |
DEFAULT_OUTER_GAP
The default outer gap. |
static java.awt.Paint |
DEFAULT_OUTLINE_PAINT
The default outline paint. |
static java.awt.Stroke |
DEFAULT_OUTLINE_STROKE
The default outline stroke. |
static java.awt.Font |
DEFAULT_TITLE_FONT
The default title font. |
static double |
NO_PREFERRED_WIDTH
Used with setPreferredWidth(double) to indicate that no preferred
width is desired and defaults are to be used. |
Fields inherited from class org.jfree.chart.Legend |
EAST, EAST_NORTHEAST, EAST_SOUTHEAST, HORIZONTAL, INVERTED, NORTH, NORTH_NORTHEAST, NORTH_NORTHWEST, SOUTH, SOUTH_SOUTHEAST, SOUTH_SOUTHWEST, WEST, WEST_NORTHWEST, WEST_SOUTHWEST |
Constructor Summary | |
StandardLegend()
Constructs a new legend with default settings. |
|
StandardLegend(JFreeChart chart)
Deprecated. use the default constructor instead and let JFreeChart manage the chart reference |
Method Summary | |
protected java.awt.geom.Rectangle2D |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D available,
boolean horizontal,
boolean inverted,
ChartRenderingInfo info)
Draws the legend. |
java.awt.geom.Rectangle2D |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D available,
ChartRenderingInfo info)
Draws the legend on a Java 2D graphics device (such as the screen or a printer). |
boolean |
equals(java.lang.Object obj)
Tests an object for equality with this legend. |
java.awt.Paint |
getBackgroundPaint()
Returns the background paint for the legend. |
int |
getBoundingBoxArcHeight()
Returns the height of the arc used to round off the corners of the bounding box. |
int |
getBoundingBoxArcWidth()
Returns the width of the arc used to round off the corners of the bounding box. |
boolean |
getDisplaySeriesLines()
Returns a flag that controls whether or not the legend displays the series line stroke. |
boolean |
getDisplaySeriesShapes()
Returns a flag that controls whether or not the legend displays the series shapes. |
org.jfree.ui.Spacer |
getInnerGap()
Returns the inner gap for the legend. |
java.awt.Font |
getItemFont()
Returns the series label font. |
java.awt.Paint |
getItemPaint()
Returns the series label paint. |
org.jfree.ui.Spacer |
getOuterGap()
Returns the outer gap for the legend. |
java.awt.Paint |
getOutlinePaint()
Returns the outline paint. |
boolean |
getOutlineShapes()
Returns the flag that indicates whether or not outlines are drawn around shapes. |
java.awt.Stroke |
getOutlineStroke()
Returns the outline stroke. |
double |
getPreferredWidth()
Returns the preferred width of the legend bounding box if such width has been defined; otherwise returns NO_PREFERRED_WIDTH . |
LegendRenderingOrder |
getRenderingOrder()
Returns the legend rendering order. |
java.awt.Paint |
getShapeOutlinePaint()
Returns the paint used to outline shapes. |
java.awt.Stroke |
getShapeOutlineStroke()
Returns the stroke used to outline shapes. |
double |
getShapeScaleX()
Returns the x scale factor for shapes displayed in the legend. |
double |
getShapeScaleY()
Returns the y scale factor for shapes displayed in the legend. |
java.lang.String |
getTitle()
Gets the title for the legend. |
java.awt.Font |
getTitleFont()
Returns the title font. |
void |
setBackgroundPaint(java.awt.Paint paint)
Sets the background paint for the legend and sends a LegendChangeEvent to all
registered listeners. |
void |
setBoundingBoxArcHeight(int arcHeight)
Sets the height of the arc used to round off the corners of the bounding box. |
void |
setBoundingBoxArcWidth(int arcWidth)
Sets the width of the arc used to round off the corners of the bounding box. |
void |
setDisplaySeriesLines(boolean flag)
Sets a flag that controls whether or not the legend displays the series line stroke. |
void |
setDisplaySeriesShapes(boolean flag)
Sets a flag that controls whether or not the legend displays the series shapes. |
void |
setInnerGap(org.jfree.ui.Spacer innerGap)
Sets the inner gap for the legend and sends a LegendChangeEvent to all
registered listeners. |
void |
setItemFont(java.awt.Font font)
Sets the series label font and sends a LegendChangeEvent to all registered
listeners. |
void |
setItemPaint(java.awt.Paint paint)
Sets the series label paint and sends a LegendChangeEvent to all registered
listeners. |
void |
setOuterGap(org.jfree.ui.Spacer outerGap)
Sets the outer gap for the legend and sends a LegendChangeEvent to all
registered listeners. |
void |
setOutlinePaint(java.awt.Paint paint)
Sets the outline paint and sends a LegendChangeEvent to all registered listeners. |
void |
setOutlineShapes(boolean flag)
Sets the flag that controls whether or not outlines are drawn around shapes, and sends a LegendChangeEvent to all registered listeners. |
void |
setOutlineStroke(java.awt.Stroke stroke)
Sets the outline stroke and sends a LegendChangeEvent to all registered
listeners. |
void |
setPreferredWidth(double width)
Sets the preferred width of the legend bounding box. |
void |
setRenderingOrder(LegendRenderingOrder order)
Sets the legend rendering order and sends a LegendChangeEvent to all registered
listeners. |
void |
setShapeOutlinePaint(java.awt.Paint paint)
Sets the paint used to outline shapes. |
void |
setShapeOutlineStroke(java.awt.Stroke stroke)
Sets the stroke used to outline shapes and sends a LegendChangeEvent to all
registered listeners. |
void |
setShapeScaleX(double factor)
Sets the x scale factor for shapes displayed in the legend and sends a LegendChangeEvent to all registered listeners. |
void |
setShapeScaleY(double factor)
Sets the y scale factor for shapes displayed in the legend and sends a LegendChangeEvent to all registered listeners. |
void |
setTitle(java.lang.String title)
Sets the title of the legend and sends a LegendChangeEvent to all registered
listeners. |
void |
setTitleFont(java.awt.Font font)
Sets the title font and sends a LegendChangeEvent to all registered listeners. |
Methods inherited from class org.jfree.chart.Legend |
addChangeListener, clone, createInstance, getAnchor, getChart, isAnchoredToBottom, isAnchoredToCenter, isAnchoredToLeft, isAnchoredToMiddle, isAnchoredToRight, isAnchoredToTop, notifyListeners, registerChart, removeChangeListener, setAnchor |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final org.jfree.ui.Spacer DEFAULT_OUTER_GAP
public static final org.jfree.ui.Spacer DEFAULT_INNER_GAP
public static final java.awt.Stroke DEFAULT_OUTLINE_STROKE
public static final java.awt.Paint DEFAULT_OUTLINE_PAINT
public static final java.awt.Paint DEFAULT_BACKGROUND_PAINT
public static final java.awt.Font DEFAULT_TITLE_FONT
public static final java.awt.Font DEFAULT_ITEM_FONT
public static final double NO_PREFERRED_WIDTH
setPreferredWidth(double)
to indicate that no preferred
width is desired and defaults are to be used.
Constructor Detail |
public StandardLegend()
public StandardLegend(JFreeChart chart)
chart
- the chart that the legend belongs to.Method Detail |
public org.jfree.ui.Spacer getOuterGap()
null
).public void setOuterGap(org.jfree.ui.Spacer outerGap)
LegendChangeEvent
to all
registered listeners.
outerGap
- the outer gap (null
not permitted).public org.jfree.ui.Spacer getInnerGap()
null
).public void setInnerGap(org.jfree.ui.Spacer innerGap)
LegendChangeEvent
to all
registered listeners.
innerGap
- the inner gap (null
not permitted).public java.awt.Paint getBackgroundPaint()
null
).public void setBackgroundPaint(java.awt.Paint paint)
LegendChangeEvent
to all
registered listeners.
paint
- the paint (null
not permitted).public java.awt.Stroke getOutlineStroke()
null
).public void setOutlineStroke(java.awt.Stroke stroke)
LegendChangeEvent
to all registered
listeners.
stroke
- the stroke (null
not permitted).public java.awt.Paint getOutlinePaint()
null
).public void setOutlinePaint(java.awt.Paint paint)
LegendChangeEvent
to all registered listeners.
paint
- the paint (null
not permitted).public java.lang.String getTitle()
null
).public void setTitle(java.lang.String title)
LegendChangeEvent
to all registered
listeners.
title
- the title (null
permitted).public java.awt.Font getTitleFont()
null
).public void setTitleFont(java.awt.Font font)
LegendChangeEvent
to all registered listeners.
font
- the font (null
not permitted).public java.awt.Font getItemFont()
null
).public void setItemFont(java.awt.Font font)
LegendChangeEvent
to all registered
listeners.
font
- the font (null
not permitted).public java.awt.Paint getItemPaint()
null
).public void setItemPaint(java.awt.Paint paint)
LegendChangeEvent
to all registered
listeners.
paint
- the paint (null
not permitted).public boolean getOutlineShapes()
public void setOutlineShapes(boolean flag)
LegendChangeEvent
to all registered listeners.
flag
- the flag.public java.awt.Stroke getShapeOutlineStroke()
null
).public void setShapeOutlineStroke(java.awt.Stroke stroke)
LegendChangeEvent
to all
registered listeners.
stroke
- the stroke (null
not permitted).public java.awt.Paint getShapeOutlinePaint()
public void setShapeOutlinePaint(java.awt.Paint paint)
LegendChangeEvent
is sent to all
registered listeners.
paint
- the paint.public void setDisplaySeriesShapes(boolean flag)
flag
- the new value of the flag.public boolean getDisplaySeriesShapes()
true
if the series shapes should be displayed, false
otherwise.public double getShapeScaleX()
public void setShapeScaleX(double factor)
LegendChangeEvent
to all registered listeners.
factor
- the factor.public double getShapeScaleY()
public void setShapeScaleY(double factor)
LegendChangeEvent
to all registered listeners.
factor
- the factor.public void setDisplaySeriesLines(boolean flag)
flag
- the new value of the flag.public boolean getDisplaySeriesLines()
true
if the series lines should be displayed, false
otherwise.public LegendRenderingOrder getRenderingOrder()
null
).public void setRenderingOrder(LegendRenderingOrder order)
LegendChangeEvent
to all registered
listeners.
order
- the order (null
not permitted).public int getBoundingBoxArcWidth()
public void setBoundingBoxArcWidth(int arcWidth)
LegendChangeEvent
is sent to all registered listeners.
arcWidth
- the new arc width.public int getBoundingBoxArcHeight()
public void setBoundingBoxArcHeight(int arcHeight)
LegendChangeEvent
is sent to all registered listeners.
arcHeight
- the new arc height.public double getPreferredWidth()
NO_PREFERRED_WIDTH
.
NO_PREFERRED_WIDTH
.public void setPreferredWidth(double width)
The preferred width takes effect only when the legend's anchor is set to one of the three EAST anchors or to one of the three WEST anchors.
A LegendChangeEvent
is sent to all registered listeners.
width
- the new width.public java.awt.geom.Rectangle2D draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D available, ChartRenderingInfo info)
draw
in class Legend
g2
- the graphics device.available
- the area within which the legend, and afterwards the plot, should be
drawn.info
- collects rendering info (optional).
protected java.awt.geom.Rectangle2D draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D available, boolean horizontal, boolean inverted, ChartRenderingInfo info)
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
- ???info
- collects rendering info (optional).
public boolean equals(java.lang.Object obj)
equals
in class Legend
obj
- the object.
true
or false
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |