|
|||||||||
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.CategoryPlot
public class CategoryPlot
Title: IJChart
Description: a chart library for the Java(tm) platform.
Used to display the two coordinate axis are (@Link com.ijchart.xychart.axis.category.CategoryAxis), (@Link com.ijchart.xychart.axis.value.AbstractValueAxis) of the plot.Copyright: Copyright (c) 2013
Company:
Field Summary | |
---|---|
static boolean |
DEFAULT_CATEGORY_CROSSHAIR_LOCKED_ON_DATA
A default flag that controls whether or not the crosshair locks onto actual data points. |
static boolean |
DEFAULT_CATEGORY_CROSSHAIR_VISIBLE
A default flag that controls whether or not a category crosshair is drawn. |
Constructor Summary | |
---|---|
CategoryPlot()
Default constructor. |
|
CategoryPlot(CategoryAxis categoryAxis,
AbstractValueAxis valueAxis,
AbstractCategoryRender render)
Creates a new plot. |
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. |
boolean |
equals(java.lang.Object obj)
Tests the plot for equality with an arbitrary object. |
CategoryAxis |
getCategoryAxis()
Returns the category axis for the plot. |
CategoryAxis |
getCategoryAxis(int index)
Returns a category axis. |
CategoryAxis |
getCategoryAxisByRenderIndex(int renderIndex)
Returns a category axis. |
int |
getCategoryAxisCount()
Returns the number of category axes. |
RectangleEdge |
getCategoryAxisEdge()
Returns the category axis edge. |
RectangleEdge |
getCategoryAxisEdge(int index)
Returns the edge for a category axis. |
int |
getCategoryAxisIndex(CategoryAxis axis)
Returns the index of the specified axis, or -1 if the axis is not assigned to the plot. |
AxisLocation |
getCategoryAxisLocation()
Returns the category axis location for the primary category axis. |
AxisLocation |
getCategoryAxisLocation(int index)
Returns the location for a category axis. |
protected CategoryAxis |
getNotNullCategoryAxis(int index)
Search the category axis at the specified position,first search previous,if not found search next. |
protected AbstractValueAxis |
getNotNullValueAxis(int index)
Search the value axis at the specified position,first search previous,if not found search next. |
protected RectangleEdge |
getNotNullValueAxisEdge(int index)
Search the value axis edge at the specified position,first search previous,if not found search next. |
PlotType |
getPlotType()
Returns a short string describing the plot type. |
AbstractCategoryRender |
getRender()
Returns a reference to the render for the plot. |
AbstractCategoryRender |
getRender(int index)
Returns the render at the given index. |
int |
getRenderIndex(AbstractCategoryRender 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. |
int |
hashCode()
Returns a hash code for this object. |
boolean |
isDomainZoomable()
Returns true if the plot's domain axis is zoomable, and false otherwise. |
void |
setCategoryAxes(CategoryAxis[] axes)
Sets the category axes for this plot and sends a PlotChangeEvent
to all registered listeners. |
void |
setCategoryAxes(CategoryAxis[] axes,
int startIndex)
Sets the category axes for this plot and sends a PlotChangeEvent
to all registered listeners. |
void |
setCategoryAxis(CategoryAxis axis)
Sets the category axis for the plot and sends a PlotChangeEvent to
all registered listeners. |
void |
setCategoryAxis(int index,
CategoryAxis axis)
Sets a category axis and sends a PlotChangeEvent to all registered listeners. |
void |
setCategoryAxis(int index,
CategoryAxis axis,
boolean notify)
Sets a category axis and sends a PlotChangeEvent to all registered listeners. |
void |
setCategoryAxisLocation(AxisLocation location)
Sets the location of the category axis and, if requested, sends a PlotChangeEvent to all registered listeners. |
void |
setCategoryAxisLocation(int index,
AxisLocation location)
Sets the location for a category axis and sends a PlotChangeEvent
to all registered listeners. |
void |
setRender(AbstractCategoryRender render)
Sets the render at index 0 (sometimes referred to as the "primary" render) and sends a PlotChangeEvent to all registered listeners. |
void |
setRender(AbstractCategoryRender 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,
AbstractCategoryRender render)
Sets the render at the specified index and sends a PlotChangeEvent to all registered listeners. |
void |
setRender(int index,
AbstractCategoryRender render,
boolean notify)
Sets a render. |
void |
setRenders(AbstractCategoryRender[] renders,
int startIndex)
Sets the renders for this plot and sends a PlotChangeEvent
to all registered listeners. |
java.lang.String |
toString()
Override toString method. |
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_CATEGORY_CROSSHAIR_VISIBLE
public static final boolean DEFAULT_CATEGORY_CROSSHAIR_LOCKED_ON_DATA
Constructor Detail |
---|
public CategoryPlot()
public CategoryPlot(CategoryAxis categoryAxis, AbstractValueAxis valueAxis, AbstractCategoryRender render)
categoryAxis
- CategoryAxis
The category axis (null permitted).valueAxis
- AbstractValueAxis
The value axis (null permitted).render
- AbstractCategoryRender
The item render (null permitted).Method Detail |
---|
public int getCategoryAxisCount()
public CategoryAxis getCategoryAxis()
public CategoryAxis getCategoryAxis(int index)
index
-
The axis index.
public void setCategoryAxis(CategoryAxis axis)
PlotChangeEvent
to
all registered listeners.
axis
- CategoryAxis
The axis (null not permitted).public CategoryAxis getCategoryAxisByRenderIndex(int renderIndex)
renderIndex
-
The index of render.
public void setCategoryAxis(int index, CategoryAxis axis)
PlotChangeEvent
to all registered listeners.
index
- int
The axis index,must be greater than or equal to 0.axis
- CategoryAxis
The axis (null not permitted).public void setCategoryAxis(int index, CategoryAxis axis, boolean notify)
PlotChangeEvent
to all registered listeners.
index
- int
The axis index,must be greater than or equal to 0.axis
- CategoryAxis
The axis (null not permitted).notify
- boolean
Whether or not notify listener.public void setCategoryAxes(CategoryAxis[] axes)
PlotChangeEvent
to all registered listeners.
axes
- CategoryAxis[]
The axes (null not permitted).public void setCategoryAxes(CategoryAxis[] axes, int startIndex)
PlotChangeEvent
to all registered listeners.
axes
- CategoryAxis[]
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 getCategoryAxisIndex(CategoryAxis axis)
axis
-
The axis (null not permitted).
public AbstractCategoryRender getRender()
public AbstractCategoryRender getRender(int index)
index
-
The render index (zero-based).
public java.util.Collection getRenders()
getRenders
in class AbstractPlot
public void setRender(AbstractCategoryRender render)
PlotChangeEvent
to all registered listeners.
render
- AbstractCategoryRender
The render (null not permitted.public void setRender(AbstractCategoryRender render, boolean notify)
PlotChangeEvent
to all registered listeners.
render
- AbstractCategoryRender
The render (null not permitted).notify
- boolean
Whether or not notify listeners.public void setRender(int index, AbstractCategoryRender render)
PlotChangeEvent
to all registered listeners.
index
- int
The index (zero-based).render
- AbstractCategoryRender
The render (null not permitted).public void setRender(int index, AbstractCategoryRender render, boolean notify)
PlotChangeEvent
is sent to all registered listeners.
index
- int
The dataset index (zero-based).render
- AbstractCategoryRender
The render (null not permitted).notify
- boolean
Whether or not notify listeners.public void setRenders(AbstractCategoryRender[] renders, int startIndex)
PlotChangeEvent
to all registered listeners.
renders
- AbstractCategoryRender[]
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(AbstractCategoryRender render)
render
- AbstractCategoryRender
The render (null permitted).
public AxisLocation getCategoryAxisLocation()
public AxisLocation getCategoryAxisLocation(int index)
index
-
The axis index,must be greater than or equal to 0.
public void setCategoryAxisLocation(AxisLocation location)
PlotChangeEvent
to all registered listeners.
location
-
The axis location (null not permitted).public void setCategoryAxisLocation(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 getCategoryAxisEdge()
public RectangleEdge getCategoryAxisEdge(int index)
index
-
The axis index,must be greater than or equal to 0.
public boolean isDomainZoomable()
isDomainZoomable
in interface IZoomable
isDomainZoomable
in class AbstractPlot
public void draw(java.awt.Graphics2D g2, java.awt.geom.Rectangle2D plotArea, ChartShapeCollection chartShapes)
draw
in class AbstractPlot
g2
- Graphics2D
The graphics device (null not permitted).plotArea
- Rectangle2D
The plot draw 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
-
The graphics device (null not permitted).plotArea
-
The plot draw area (null not permitted).shapeCollection
- PlotShapeCollection
Collects information about the plot (null not permitted).
protected CategoryAxis getNotNullCategoryAxis(int index)
index
- int
The index.
protected AbstractValueAxis getNotNullValueAxis(int index)
index
- int
The index.
protected RectangleEdge getNotNullValueAxisEdge(int index)
index
- int
The index.
public PlotType getPlotType()
getPlotType
in class AbstractPlot
public boolean equals(java.lang.Object obj)
equals
in class AbstractAxisPlot
obj
-
The object to test against (null permitted).
public int hashCode()
hashCode
in class AbstractAxisPlot
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractAxisPlot
java.lang.CloneNotSupportedException
- if the cloning is not supported.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 |