|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ijchart.xychart.plot.AbstractPlot
com.ijchart.xychart.plot.AbstractAxisPlot
com.ijchart.xychart.plot.XYPlot
public class XYPlot
Title: IJChart
Description: a chart library for the Java(tm) platform.
Used to display the two coordinate axis are (@Link com.ijchart.xychart.axis.value.AbstractValueAxis) of the plot.Copyright: Copyright (c) 2013
Company:
| Field Summary | |
|---|---|
static XYNumberChartData |
DEFAULT_QUADRANT_ORIGIN
The default origin point for the quadrants (if drawn). |
static java.awt.Paint[] |
DEFAULT_QUADRANT_PAINT
The default paint used for each quadrant. |
static boolean |
DEFAULT_VALUE_ZERO_BASELINE_VISIBLE
A default flag that controls whether or not the zero baseline against the value axis is visible. |
| Constructor Summary | |
|---|---|
XYPlot()
Creates a new XYPlot instance with no dataset, no axes and no render. |
|
XYPlot(AbstractValueAxis domainAxis,
AbstractValueAxis valueAxis,
AbstractXYRender render)
Creates a new plot with the specified dataset, axes and render. |
|
| Method Summary | |
|---|---|
java.lang.Object |
clone()
Returns a clone of the plot. |
void |
draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartShapeCollection chartShapes)
Draws the plot within the specified area.Subclasses need to provide an implementation of this method, obviously. |
protected java.awt.geom.Rectangle2D |
drawAxes(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
PlotShapeCollection shapeCollection)
A utility method for drawing the plot's axes. |
protected void |
drawQuadrantBackground(java.awt.geom.Rectangle2D dataArea,
ChartOrientation orientation,
AbstractValueAxis domainAxis,
AbstractValueAxis valueAxis,
RenderShapeCollection renderShapes)
Fills the four quadrant area with the quadrant paint. |
protected void |
drawZeroDomainBaseline(java.awt.geom.Rectangle2D dataArea,
PlotShapeCollection plotShapes)
Draw zero line of domain axis. |
protected void |
drawZeroValueBaseline(java.awt.geom.Rectangle2D dataArea,
PlotShapeCollection plotShapes)
Draw zero line of value axis. |
boolean |
equals(java.lang.Object obj)
Tests this plot for equality with another object. |
AbstractValueAxis |
getDomainAxis()
Returns the domain axis for the plot. |
AbstractValueAxis |
getDomainAxis(int index)
Returns a domain axis. |
AbstractValueAxis |
getDomainAxisByRenderIndex(int renderIndex)
Returns a domain axis. |
int |
getDomainAxisCount()
Returns the number of category axes. |
RectangleEdge |
getDomainAxisEdge()
Returns the domain axis edge. |
RectangleEdge |
getDomainAxisEdge(int index)
Returns the edge for a domain axis. |
int |
getDomainAxisIndex(AbstractValueAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot. |
AxisLocation |
getDomainAxisLocation()
Returns the domain axis location for the primary domain axis. |
AxisLocation |
getDomainAxisLocation(int index)
Returns the location for a domain axis. |
java.awt.Paint |
getDomainZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the domain axis. |
java.awt.Stroke |
getDomainZeroBaselineStroke()
Returns the stroke used for the zero baseline against the domain axis. |
PlotType |
getPlotType()
Returns a short string describing the plot type. |
XYNumberChartData |
getQuadrantOrigin()
Returns the origin point for the quadrants (if drawn). |
java.awt.Paint |
getQuadrantPaint(int index)
Returns the paint used for the specified quadrant. |
AbstractXYRender |
getRender()
Returns a reference to the render for the plot. |
AbstractXYRender |
getRender(int index)
Returns the render at the given index. |
int |
getRenderIndex(AbstractXYRender render)
Returns the index of the specified render, or -1 if the render is not assigned to this plot. |
java.util.Collection |
getRenders()
Returns the collection of renders,and this collection is unmodifiable. |
java.awt.Paint |
getValueZeroBaselinePaint()
Returns the paint for the zero baseline (if any) plotted against the value axis. |
java.awt.Stroke |
getValueZeroBaselineStroke()
Returns the stroke used for the zero baseline against the value axis. |
int |
hashCode()
Returns a hash code for this object. |
boolean |
isDomainZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is displayed for the domain axis. |
boolean |
isValueZeroBaselineVisible()
Returns a flag that controls whether or not a zero baseline is displayed for the value axis. |
void |
setDomainAxes(AbstractValueAxis[] axes)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainAxes(AbstractValueAxis[] axes,
int startIndex)
Sets the domain axes for this plot and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainAxis(AbstractValueAxis axis)
Sets the domain axis for the plot and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainAxis(int index,
AbstractValueAxis axis)
Sets a domain axis and sends a PlotChangeEvent
to all registered listeners. |
void |
setDomainAxis(int index,
AbstractValueAxis axis,
boolean notify)
Sets a domain axis and sends a PlotChangeEvent
to all registered listeners. |
void |
setDomainAxisLocation(AxisLocation location)
Sets the location of the domain axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
void |
setDomainAxisLocation(int index,
AxisLocation location)
Sets the location for a domain axis and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainZeroBaselinePaint(java.awt.Paint paint)
Sets the paint for the zero baseline plotted against the domain axis and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainZeroBaselineStroke(java.awt.Stroke stroke)
Sets the stroke for the zero baseline for the domain axis, and sends a PlotChangeEvent to all registered listeners. |
void |
setDomainZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is displayed for the domain axis, and sends a PlotChangeEvent
to all registered listeners. |
void |
setQuadrantOrigin(XYNumberChartData origin)
Sets the quadrant origin and sends a PlotChangeEvent
to all registered listeners. |
void |
setQuadrantPaint(int index,
java.awt.Paint paint)
Sets the paint used for the specified quadrant and sends a PlotChangeEvent to all registered listeners. |
void |
setRender(AbstractXYRender render)
Sets the render at index 0 (sometimes referred to as the "primary" render) and sends a PlotChangeEvent to all registered listeners. |
void |
setRender(AbstractXYRender render,
boolean notify)
Sets the render at index 0 (sometimes referred to as the "primary" render) and, if requested, sends a PlotChangeEvent
to all registered listeners. |
void |
setRender(int index,
AbstractXYRender render)
Sets the render at the specified index and sends a PlotChangeEvent to all registered listeners. |
void |
setRender(int index,
AbstractXYRender render,
boolean notify)
Sets a render. |
void |
setRenders(AbstractXYRender[] renders,
int startIndex)
Sets the renders for this plot and sends a PlotChangeEvent
to all registered listeners. |
void |
setValueZeroBaselinePaint(java.awt.Paint paint)
Sets the paint for the zero baseline plotted against the value axis and sends a PlotChangeEvent to all registered listeners. |
void |
setValueZeroBaselineStroke(java.awt.Stroke stroke)
Sets the stroke for the zero baseline for the value axis, and sends a PlotChangeEvent to all registered listeners. |
void |
setValueZeroBaselineVisible(boolean visible)
Sets the flag that controls whether or not the zero baseline is displayed for the value axis, and sends a PlotChangeEvent
to all registered listeners. |
java.lang.String |
toString()
Override toString method. |
void |
zoomDomainAxes(java.awt.geom.Rectangle2D selectArea,
java.awt.geom.Rectangle2D dataArea,
java.awt.geom.Point2D source)
Zoom domain axes. |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.ijchart.xychart.listener.IRenderChangeListener |
|---|
renderChanged |
| Field Detail |
|---|
public static final boolean DEFAULT_VALUE_ZERO_BASELINE_VISIBLE
public static final XYNumberChartData DEFAULT_QUADRANT_ORIGIN
public static final java.awt.Paint[] DEFAULT_QUADRANT_PAINT
| Constructor Detail |
|---|
public XYPlot()
public XYPlot(AbstractValueAxis domainAxis,
AbstractValueAxis valueAxis,
AbstractXYRender render)
domainAxis - AbstractValueAxis
The domain axis (null permitted).valueAxis - AbstractValueAxis
The value axis (null permitted).render - AbstractXYRender
The item render (null permitted).| Method Detail |
|---|
public AxisLocation getDomainAxisLocation()
public AxisLocation getDomainAxisLocation(int index)
index -
The axis index,must be greater than or equal to 0.
public void setDomainAxisLocation(AxisLocation location)
PlotChangeEvent to all registered listeners.
location -
The axis location (null not permitted).
public void setDomainAxisLocation(int index,
AxisLocation location)
PlotChangeEvent to all registered listeners.
index -
The axis index,must be greater than or equal to 0.location -
The location (null not permitted).public RectangleEdge getDomainAxisEdge()
public RectangleEdge getDomainAxisEdge(int index)
index -
The axis index,must be greater than or equal to 0.
public AbstractValueAxis getDomainAxis()
public AbstractValueAxis getDomainAxis(int index)
index -
The axis index.
public AbstractValueAxis getDomainAxisByRenderIndex(int renderIndex)
renderIndex -
The index of render.
public void setDomainAxis(AbstractValueAxis axis)
PlotChangeEvent to all registered listeners.
axis - AbstractValueAxis
The axis (null not permitted).
public void setDomainAxis(int index,
AbstractValueAxis axis)
PlotChangeEvent
to all registered listeners.
index - int
The axis index,must be greater than or equal to 0.axis - AbstractValueAxis
The axis (null not permitted).
public void setDomainAxis(int index,
AbstractValueAxis axis,
boolean notify)
PlotChangeEvent
to all registered listeners.
index - int
The axis index,must be greater than or equal to 0.axis - AbstractValueAxis
The axis (null not permitted).notify - boolean
Whether or not notify listener.public void setDomainAxes(AbstractValueAxis[] axes)
PlotChangeEvent to all registered listeners.
axes - AbstractValueAxis[]
The axes (null not permitted).
public void setDomainAxes(AbstractValueAxis[] axes,
int startIndex)
PlotChangeEvent to all registered listeners.
axes - AbstractValueAxis[]
The axes (null not permitted).startIndex - int
The beginning of the index value, startIndex before the target will not be covered.
must be greater than or equal to 0.public int getDomainAxisCount()
public int getDomainAxisIndex(AbstractValueAxis axis)
axis -
The axis (null not permitted).
public boolean isDomainZeroBaselineVisible()
public void setDomainZeroBaselineVisible(boolean visible)
PlotChangeEvent
to all registered listeners.
visible - boolean
The flag.public java.awt.Stroke getDomainZeroBaselineStroke()
public void setDomainZeroBaselineStroke(java.awt.Stroke stroke)
PlotChangeEvent to all registered listeners.
stroke - Stroke
The stroke (null not permitted).public java.awt.Paint getDomainZeroBaselinePaint()
public void setDomainZeroBaselinePaint(java.awt.Paint paint)
PlotChangeEvent to all registered listeners.
paint - Paint
The paint (null not permitted).public boolean isValueZeroBaselineVisible()
public void setValueZeroBaselineVisible(boolean visible)
PlotChangeEvent
to all registered listeners.
visible - boolean
The flag.public java.awt.Stroke getValueZeroBaselineStroke()
public void setValueZeroBaselineStroke(java.awt.Stroke stroke)
PlotChangeEvent to all registered listeners.
stroke - Stroke
The stroke (null not permitted).public java.awt.Paint getValueZeroBaselinePaint()
public void setValueZeroBaselinePaint(java.awt.Paint paint)
PlotChangeEvent to all registered listeners.
paint - Paint
The paint (null not permitted).public XYNumberChartData getQuadrantOrigin()
public void setQuadrantOrigin(XYNumberChartData origin)
PlotChangeEvent
to all registered listeners.
origin - XYNumberChartData
The origin point (null not permitted).public java.awt.Paint getQuadrantPaint(int index)
index - int
The quadrant index (0-3).
public void setQuadrantPaint(int index,
java.awt.Paint paint)
PlotChangeEvent to all registered listeners.
index - int
The quadrant index (0-3).paint - Paint
The paint (null permitted).
public void zoomDomainAxes(java.awt.geom.Rectangle2D selectArea,
java.awt.geom.Rectangle2D dataArea,
java.awt.geom.Point2D source)
zoomDomainAxes in interface IZoomablezoomDomainAxes in class AbstractPlotselectArea - Rectangle2D
The selected area,null to restore chart.dataArea - Rectangle2D
The data area,null to restore chart.source - Point2D
The source mouse point (null not permitted).
public void draw(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
ChartShapeCollection chartShapes)
draw in class AbstractPlotg2 - Graphics2D
The graphics device (null not permitted).plotArea - Rectangle2D
The plot area (null not permitted).chartShapes - ChartShapeCollection
Collects information about the chart (null not permitted).
protected java.awt.geom.Rectangle2D drawAxes(java.awt.Graphics2D g2,
java.awt.geom.Rectangle2D plotArea,
PlotShapeCollection shapeCollection)
g2 - Graphics2D
The graphics device (null not permitted).plotArea - Rectangle2D
The plot draw area (null not permitted).shapeCollection - PlotShapeCollection
Collects information about the plot (null not permitted).
protected void drawQuadrantBackground(java.awt.geom.Rectangle2D dataArea,
ChartOrientation orientation,
AbstractValueAxis domainAxis,
AbstractValueAxis valueAxis,
RenderShapeCollection renderShapes)
dataArea - Rectangle2D
The chart data area (null not permitted).orientation - ChartOrientation
The chart draw orientation.domainAxis - AbstractValueAxis
Returns the domain axis for the plot.valueAxis - AbstractValueAxis
Returns the domain axis for the plot.renderShapes - RenderShapeCollection
Collects information about the render (null not permitted).
protected void drawZeroDomainBaseline(java.awt.geom.Rectangle2D dataArea,
PlotShapeCollection plotShapes)
dataArea - Rectangle2D
The data area (null not permitted).plotShapes - PlotShapeCollection
Collects information about the plot (null not permitted).
protected void drawZeroValueBaseline(java.awt.geom.Rectangle2D dataArea,
PlotShapeCollection plotShapes)
dataArea - Rectangle2D
The data area (null not permitted).plotShapes - PlotShapeCollection
Collects information about the plot (null not permitted).public AbstractXYRender getRender()
public AbstractXYRender getRender(int index)
index -
The render index (zero-based).
public java.util.Collection getRenders()
getRenders in class AbstractPlotpublic void setRender(AbstractXYRender render)
PlotChangeEvent to all registered listeners.
render - AbstractXYRender
The render (null not permitted.
public void setRender(AbstractXYRender render,
boolean notify)
PlotChangeEvent
to all registered listeners.
render - AbstractXYRender
The render (null not permitted).notify - boolean
Whether or not notify listeners.
public void setRender(int index,
AbstractXYRender render)
PlotChangeEvent to all registered listeners.
index - int
The index (zero-based).render - AbstractXYRender
The render (null not permitted).
public void setRender(int index,
AbstractXYRender render,
boolean notify)
PlotChangeEvent
is sent to all registered listeners.
index - int
The dataset index (zero-based).render - AbstractXYRender
The render (null not permitted).notify - boolean
Whether or not notify listeners.
public void setRenders(AbstractXYRender[] renders,
int startIndex)
PlotChangeEvent
to all registered listeners.
renders - AbstractXYRender[]
The renders (null not permitted).startIndex - int
The beginning of the index value, startIndex before the target will not be covered.
must be greater than or equal to 0.public int getRenderIndex(AbstractXYRender render)
render - AbstractXYRender
The render (null permitted).
public PlotType getPlotType()
getPlotType in class AbstractPlotpublic int hashCode()
hashCode in class AbstractAxisPlotpublic boolean equals(java.lang.Object obj)
equals in class AbstractAxisPlotobj - the object (null permitted).
public java.lang.Object clone()
throws java.lang.CloneNotSupportedException
clone in class AbstractAxisPlotjava.lang.CloneNotSupportedException - this can occur if some component of
the plot cannot be cloned.public java.lang.String toString()
toString in class AbstractAxisPlot
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||