|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--org.jfree.chart.plot.Plot
|
+--org.jfree.chart.plot.XYPlot
|
+--org.jfree.chart.plot.CombinedXYPlot
An extension of XYPlot that can contain multiple subplots, laid out horizontally or vertically.
This class was originally written by Bill Kelemen, and has since been modified extensively by David Gilbert.
| Field Summary | |
static int |
HORIZONTAL
Constant used to indicate horizontal layout. |
static int |
VERTICAL
Constant used to indicate vertical layout. |
| Fields inherited from class org.jfree.chart.plot.XYPlot |
DEFAULT_CROSSHAIR_PAINT, DEFAULT_CROSSHAIR_STROKE, DEFAULT_CROSSHAIR_VISIBLE, DEFAULT_GRIDLINE_PAINT, DEFAULT_GRIDLINE_STROKE |
| Fields inherited from class org.jfree.chart.plot.Plot |
DEFAULT_BACKGROUND_ALPHA, DEFAULT_BACKGROUND_PAINT, DEFAULT_FOREGROUND_ALPHA, DEFAULT_INSETS, DEFAULT_OUTLINE_PAINT, DEFAULT_OUTLINE_STROKE, MINIMUM_HEIGHT_TO_DRAW, MINIMUM_WIDTH_TO_DRAW, ZERO |
| Constructor Summary | |
CombinedXYPlot(ValueAxis axis,
int type)
Creates a new MultiXYPlot. |
|
| Method Summary | |
void |
add(XYPlot subplot)
Adds a subplot, with a default 'weight' of 1. |
void |
add(XYPlot subplot,
int weight)
Adds a subplot with a particular weight (greater than or equal to one). |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartRenderingInfo info)
Draws the plot on a Java 2D graphics device (such as the screen or a printer). |
boolean |
equals(java.lang.Object obj)
Tests this plot for equality with another object. |
double |
getGap()
Returns the space between subplots. |
Range |
getHorizontalDataRange(ValueAxis axis)
Returns the range for the horizontal axis. |
LegendItemCollection |
getLegendItems()
Returns a collection of legend items for the plot. |
java.lang.String |
getPlotType()
Returns a string describing the type of plot. |
java.util.List |
getSubPlots()
Returns the list of subplots. |
Range |
getVerticalDataRange(ValueAxis axis)
Returns the range for the vertical axis. |
boolean |
isValidSubHorizontalAxis(Axis axis)
Checks that the horizontal axis for the subplot is valid. |
boolean |
isValidSubVerticalAxis(Axis axis)
Checks that the vertical axis for the subplot is valid. |
void |
setGap(double gap)
Sets the amount of space between subplots. |
protected void |
setHorizontalAxisHeight(double height)
Sets the height for the horizontal axis of each subplot. |
void |
setRenderer(XYItemRenderer renderer)
Sets the item renderer FOR ALL SUBPLOTS. |
protected void |
setVerticalAxisWidth(double width)
Sets the width for the vertical axis of each subplot. |
void |
setXYItemRenderer(XYItemRenderer renderer)
Deprecated. use setRenderer(...) method. |
void |
zoom(double percent)
A zoom method that (currently) does nothing. |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int HORIZONTAL
public static final int VERTICAL
| Constructor Detail |
public CombinedXYPlot(ValueAxis axis,
int type)
If the layout type is HORIZONTAL, you need to supply a vertical axis to be shared by the subplots. If the layout type is VERTICAL, you need to supply a horizontal axis to be shared by the subplots.
axis - the shared axis.type - the layout type (HORIZONTAL or VERTICAL).| Method Detail |
public java.util.List getSubPlots()
public double getGap()
public void setGap(double gap)
gap - the gap between subplotspublic void add(XYPlot subplot)
The subplot should have a null horizontal axis (for VERTICAL layout) or a null vertical axis (for HORIZONTAL layout).
subplot - the subplot.
public void add(XYPlot subplot,
int weight)
throws AxisNotCompatibleException,
java.lang.IllegalArgumentException
The subplot should have a null horizontal axis (for VERTICAL layout) or a null vertical axis (for HORIZONTAL layout).
subplot - the subplot.weight - the weight.
AxisNotCompatibleException - if axis are not compatible.
java.lang.IllegalArgumentException - if weight < 1public boolean isValidSubHorizontalAxis(Axis axis)
Note that for a VERTICAL layout, the horizontal axis must be null (since each subplot shares the horizontal axis maintained by this class).
axis - the horizontal axis.
true if the horizontal axis for the subplot is valid.public boolean isValidSubVerticalAxis(Axis axis)
Note that for a HORIZONTAL layout, the vertical axis must be null (since each subplot shares the vertical axis maintained by this class).
axis - the vertical axis.
true if the vertical axis for the subplot is valid.
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartRenderingInfo info)
draw in class XYPlotg2 - the graphics device.plotArea - the area within which the plot (including axis labels) should be drawn.info - collects information about the drawing (null permitted).protected void setHorizontalAxisHeight(double height)
height - the height.protected void setVerticalAxisWidth(double width)
width - the width.public LegendItemCollection getLegendItems()
getLegendItems in class XYPlotpublic java.lang.String getPlotType()
getPlotType in class XYPlotpublic void zoom(double percent)
zoom in class XYPlotpercent - the zoom percentage.public void setRenderer(XYItemRenderer renderer)
Note: usually you will want to set the renderer independently for each subplot, which is NOT what this method does.
setRenderer in class XYPlotrenderer - the new renderer.public Range getHorizontalDataRange(ValueAxis axis)
getHorizontalDataRange in interface HorizontalValuePlotgetHorizontalDataRange in class XYPlotaxis - the axis.
public Range getVerticalDataRange(ValueAxis axis)
getVerticalDataRange in interface VerticalValuePlotgetVerticalDataRange in class XYPlotaxis - the axis.
public void setXYItemRenderer(XYItemRenderer renderer)
renderer - the renderer.public boolean equals(java.lang.Object obj)
equals in class XYPlotobj - the other object.
true or false.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||