|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.jrefinery.chart.Legend
A chart legend shows the names and visual representations of the series that are plotted in a chart.
StandardLegend
Field Summary | |
static int |
EAST
Constant anchor value for legend position EAST. |
protected static int |
HORIZONTAL
Internal value indicating the bit holding the value of interest in the anchor value. |
protected static int |
INVERTED
Internal value indicating the bit holding the value of interest in the anchor value. |
static int |
NORTH
Constant anchor value for legend position NORTH. |
static int |
SOUTH
Constant anchor value for legend position SOUTH. |
static int |
WEST
Constant anchor value for legend position WEST. |
Constructor Summary | |
Legend(JFreeChart chart,
int outerGap)
Default constructor: returns a new legend. |
Method Summary | |
void |
addChangeListener(LegendChangeListener listener)
Registers an object for notification of changes to the legend. |
static Legend |
createInstance(JFreeChart chart)
Static factory method that returns a concrete subclass of Legend. |
abstract 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). |
int |
getAnchor()
Returns the current anchor of this legend. |
JFreeChart |
getChart()
Returns the chart that this legend belongs to. |
double |
getOuterGap()
Returns the outer gap for the legend. |
boolean |
getOutlineKeyBoxes()
Returns the flag that indicates whether or not outlines are drawn around key boxes. |
protected void |
notifyListeners(LegendChangeEvent event)
Notifies all registered listeners that the chart legend has changed in some way. |
void |
removeChangeListener(LegendChangeListener listener)
Deregisters an object for notification of changes to the legend. |
void |
setAnchor(int anchor)
Sets the current anchor of this legend. |
void |
setOutlineKeyBoxes(boolean flag)
Sets the flag that controls whether or not outlines are drawn around key boxes. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int WEST
public static final int NORTH
public static final int EAST
public static final int SOUTH
protected static final int INVERTED
protected static final int HORIZONTAL
Constructor Detail |
public Legend(JFreeChart chart, int outerGap)
chart
- the chart that the legend belongs to.outerGap
- the blank space around the legend.Method Detail |
public static Legend createInstance(JFreeChart chart)
chart
- the chart that the legend belongs to.public JFreeChart getChart()
public double getOuterGap()
This is the amount of blank space around the outside of the legend.
public boolean getOutlineKeyBoxes()
public void setOutlineKeyBoxes(boolean flag)
flag
- The flag.public abstract java.awt.geom.Rectangle2D draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D available)
g2
- the graphics device.available
- the area within which the legend (and plot) should be drawn.public void addChangeListener(LegendChangeListener listener)
listener
- the object that is being registered.public void removeChangeListener(LegendChangeListener listener)
listener
- the object that is being deregistered.protected void notifyListeners(LegendChangeEvent event)
event
- information about the change to the legend.public int getAnchor()
The default anchor for this legend is SOUTH.
public void setAnchor(int anchor)
The anchor can be one of: NORTH, SOUTH, EAST, WEST. If a valid anchor value is provided, the current anchor is set and an update event is triggered. Otherwise, no change is made.
anchor
- thenew anchor value.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |