com.ijchart.xychart.chartinfo
Class PlotShapeCollection

java.lang.Object
  extended by com.ijchart.xychart.chartinfo.AbstractShapeCollection
      extended by com.ijchart.xychart.chartinfo.PlotShapeCollection
All Implemented Interfaces:
IShapeCollection, IChartShapeChangeListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class PlotShapeCollection
extends AbstractShapeCollection
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

Description: a chart library for the Java(tm) platform.

Collection to be used to store the shapes in render class.

Copyright: Copyright (c) 2013

Company:

Version:
1.0
Author:
zhang feng min,shanghai china. Contract me by email.
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.ijchart.xychart.chartinfo.AbstractShapeCollection
shapeIdSequence
 
Constructor Summary
PlotShapeCollection()
           No argument constructor.
 
Method Summary
 void addAnnotationShape(AnnotationShapeCollection annotationShapes)
           Add an annotation shape collection.
 void addRenderShape(RenderShapeCollection renderShapes)
           Add a render shape.
 void addXAxisShape(AxisShapeCollection xAxisShape)
           Add X-axis shapes collection.
 void addYAxisShape(AxisShapeCollection yAxisShape)
           Add Y-axis shapes collection.
 void clearAnnotationShapes()
           Remove all annotation shapes.
 void clearRenderShapes()
           Remove all render shapes.
 void clearSelectedShapes()
           Sets all shapes to unselected.
 void clearShapesListener()
           Remove all the shapes of the listener.
 void clearXAxisShape()
           Remove all X-axis shape collection.
 void clearYAxisShape()
           Remove all shape in Y-axis shape collection.
 java.lang.Object clone()
           Returns a clone of the axis.
 void draw(java.awt.Graphics2D g2)
           Drawing all ChartShape in this collection.
 boolean equals(java.lang.Object obj)
           Tests this axis for equality with another object.
 IChartShape findChartShape(java.awt.geom.Point2D point, ChartShapeDrawType drawType)
           Returns the IChartShape whose area contains the specified point.
 java.util.List getAllRenderShapes()
           Returns the list of render shapes and is unmodifiable.
 java.util.List getAnnotationShapes()
           Returns the list of annotation shapes and is unmodifiable.
 IChartShape getBackgroundImageShape()
           Returns the background image shape.
 IChartShape getBackgroundShape()
           Returns the background shape.
 IChartShape getBorderShape()
           The border shape.
 java.util.List getHotspotAreas(java.util.List drawTypes, IAreaFragment fragment)
           Returns the hotspot areas.
 IChartShape getNoDataMessageShape()
           Returns the no data message shape.
 RenderShapeCollection getRenderShapes()
           Returns the first render shapes collection.
 RenderShapeCollection getRenderShapes(int index)
           Returns the render shapes collection of the specified index.
 AxisShapeCollection getXAxisShape()
           Returns the first X-axis shapes collection.
 AxisShapeCollection getXAxisShape(int index)
           Returns the X-axis shapes collection for the specified index.
 java.util.List getXAxisShapeList()
           Get the X-axis shape list,The returned list should be unmodifiable.
 IChartShape getXCrossShape()
           Returns the x-cross shape.
 AxisShapeCollection getYAxisShape()
           Returns the first Y-axis shapes collection.
 AxisShapeCollection getYAxisShape(int index)
           Returns the Y-axis shapes collection for the specified index.
 java.util.List getYAxisShapeList()
           Get the Y-axis shape list,The returned list should be unmodifiable.
 IChartShape getYCrossShape()
           Returns the y-cross shape.
 IChartShape getZeroDomainBaseline()
           Returns the zero line of domain axis.
 IChartShape getZeroValueBaseline()
           Returns the zero line of value axis.
 int hashCode()
           Returns a hash code value for the object.
 void setBackgroundImageShape(IChartShape shape)
           Sets the background image shape.
 void setBackgroundShape(IChartShape shape)
           Sets the background shape.
 void setBorderShape(IChartShape borderShape)
           Sets the border shape.
 void setNoDataMessageShape(IChartShape shape)
           Sets the no data message shape.
 void setXCrossShape(IChartShape shape)
           Sets the x-cross shape.
 void setYCrossShape(IChartShape shape)
           Sets the y-cross shape.
 void setZeroDomainBaseline(IChartShape shape)
           Sets the zero line of domain axis.
 void setZeroValueBaseline(IChartShape shape)
           Sets the zero line of value axis.
 java.lang.String toString()
           Returns a string representation of the object.
 void translate(double x, double y)
           Translates the origin of the all shape in this chart to the point (x, y) in the current coordinate system.
 
Methods inherited from class com.ijchart.xychart.chartinfo.AbstractShapeCollection
addChangeListener, addHotspotArea, addHotspotArea, chartShapeChanged, clearSelectedShape, clearSelectedShape, clearShapesListener, clip, draw, findShape, fireChartShapeChanged, getDrawArea, hasListener, isDrawAreaContains, notifyListeners, removeAllChangeListener, removeChangeListener, removeShapesListener, resetShapeIdSequence, restoreClip, setDrawArea, translate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PlotShapeCollection

public PlotShapeCollection()
No argument constructor.

Method Detail

getBackgroundShape

public IChartShape getBackgroundShape()
Returns the background shape.

Returns:
IChartShape The background shape (maybe null).

setBackgroundShape

public void setBackgroundShape(IChartShape shape)
Sets the background shape.

Parameters:
shape - IChartShape The background shape (null permitted).

getBackgroundImageShape

public IChartShape getBackgroundImageShape()
Returns the background image shape.

Returns:
IChartShape The background image shape (maybe null).

setBackgroundImageShape

public void setBackgroundImageShape(IChartShape shape)
Sets the background image shape.

Parameters:
shape - IChartShape The background image shape (null permitted).

getNoDataMessageShape

public IChartShape getNoDataMessageShape()
Returns the no data message shape.

Returns:
IChartShape The no data message shape (maybe null).

setNoDataMessageShape

public void setNoDataMessageShape(IChartShape shape)
Sets the no data message shape.

Parameters:
shape - IChartShape The no data message shape (null permitted).

setBorderShape

public void setBorderShape(IChartShape borderShape)
Sets the border shape.

Parameters:
borderShape - IChartShape The border shape (null permitted).

getBorderShape

public IChartShape getBorderShape()
The border shape.

Returns:
IChartShape The border shape (maybe null).

addXAxisShape

public void addXAxisShape(AxisShapeCollection xAxisShape)
Add X-axis shapes collection.

Parameters:
xAxisShape - AxisShapeCollection The X-axis shapes collection.

clearXAxisShape

public void clearXAxisShape()
Remove all X-axis shape collection.


getXAxisShape

public AxisShapeCollection getXAxisShape()
Returns the first X-axis shapes collection.

Returns:
AxisShapeCollection The axis shapes collection.

getXAxisShape

public AxisShapeCollection getXAxisShape(int index)
Returns the X-axis shapes collection for the specified index.

Parameters:
index - int The specified index.
Returns:
AxisShapeCollection

getXAxisShapeList

public java.util.List getXAxisShapeList()
Get the X-axis shape list,The returned list should be unmodifiable.

Returns:
List The X-axis shapes collection.

addYAxisShape

public void addYAxisShape(AxisShapeCollection yAxisShape)
Add Y-axis shapes collection.

Parameters:
yAxisShape - AxisShapeCollection The Y-axis shapes collection.

clearYAxisShape

public void clearYAxisShape()
Remove all shape in Y-axis shape collection.


getYAxisShape

public AxisShapeCollection getYAxisShape()
Returns the first Y-axis shapes collection.

Returns:
AxisShapeCollection The axis shapes collection.

getYAxisShape

public AxisShapeCollection getYAxisShape(int index)
Returns the Y-axis shapes collection for the specified index.

Parameters:
index - int The specified index.
Returns:
AxisShapeCollection

getYAxisShapeList

public java.util.List getYAxisShapeList()
Get the Y-axis shape list,The returned list should be unmodifiable.

Returns:
List The Y-axis shapes collection.

addRenderShape

public void addRenderShape(RenderShapeCollection renderShapes)
Add a render shape.

Parameters:
renderShapes - RenderShapeCollection A render shapes collection.

getRenderShapes

public RenderShapeCollection getRenderShapes()
Returns the first render shapes collection.

Returns:
RenderShapeCollection The render shapes collection.

getRenderShapes

public RenderShapeCollection getRenderShapes(int index)
Returns the render shapes collection of the specified index.

Parameters:
index - int The index.
Returns:
RenderShapeCollection The render shapes collection.

getAllRenderShapes

public java.util.List getAllRenderShapes()
Returns the list of render shapes and is unmodifiable.

Returns:
List The list of render shapes and is unmodifiable.

clearRenderShapes

public void clearRenderShapes()
Remove all render shapes.


addAnnotationShape

public void addAnnotationShape(AnnotationShapeCollection annotationShapes)
Add an annotation shape collection.

Parameters:
annotationShapes - AnnotationShapeCollection A annotation shapes collection.

getAnnotationShapes

public java.util.List getAnnotationShapes()
Returns the list of annotation shapes and is unmodifiable.

Returns:
List The list of annotation shapes and is unmodifiable.

clearAnnotationShapes

public void clearAnnotationShapes()
Remove all annotation shapes.


getXCrossShape

public IChartShape getXCrossShape()
Returns the x-cross shape.

Returns:
IChartShape The x-cross shape (maybe null).

setXCrossShape

public void setXCrossShape(IChartShape shape)
Sets the x-cross shape.

Parameters:
shape - IChartShape The x-cross shape (null permitted).

getYCrossShape

public IChartShape getYCrossShape()
Returns the y-cross shape.

Returns:
IChartShape The y-cross shape (maybe null).

setYCrossShape

public void setYCrossShape(IChartShape shape)
Sets the y-cross shape.

Parameters:
shape - IChartShape The y-cross shape (null permitted).

getZeroDomainBaseline

public IChartShape getZeroDomainBaseline()
Returns the zero line of domain axis.

Returns:
IChartShape The zero line of domain axis (maybe null).

setZeroDomainBaseline

public void setZeroDomainBaseline(IChartShape shape)
Sets the zero line of domain axis.

Parameters:
shape - IChartShape The zero line of domain axis (null permitted).

getZeroValueBaseline

public IChartShape getZeroValueBaseline()
Returns the zero line of value axis.

Returns:
IChartShape The zero line of value axis (maybe null).

setZeroValueBaseline

public void setZeroValueBaseline(IChartShape shape)
Sets the zero line of value axis.

Parameters:
shape - IChartShape The zero line of value axis (null permitted).

draw

public void draw(java.awt.Graphics2D g2)
Drawing all ChartShape in this collection.

Specified by:
draw in interface IShapeCollection
Parameters:
g2 - Graphics2D The graphics device (null not permitted).

translate

public void translate(double x,
                      double y)
Translates the origin of the all shape in this chart to the point (x, y) in the current coordinate system.

Specified by:
translate in interface IShapeCollection
Overrides:
translate in class AbstractShapeCollection
Parameters:
x - double The x coordinate.
y - double The y coordinate.

clearShapesListener

public void clearShapesListener()
Remove all the shapes of the listener.

Specified by:
clearShapesListener in interface IShapeCollection

clearSelectedShapes

public void clearSelectedShapes()
Sets all shapes to unselected.

Specified by:
clearSelectedShapes in interface IShapeCollection

findChartShape

public IChartShape findChartShape(java.awt.geom.Point2D point,
                                  ChartShapeDrawType drawType)
Returns the IChartShape whose area contains the specified point.

Specified by:
findChartShape in interface IShapeCollection
Parameters:
point - Point2D The point (null not permitted).
drawType - ChartShapeDrawType The shape draw shape (null permitted).
Returns:
IChartShape The chart shape (maybe null).

getHotspotAreas

public java.util.List getHotspotAreas(java.util.List drawTypes,
                                      IAreaFragment fragment)
Returns the hotspot areas.

Specified by:
getHotspotAreas in interface IShapeCollection
Overrides:
getHotspotAreas in class AbstractShapeCollection
Parameters:
drawTypes - List The types of hotspot shape.
fragment - IAreaFragment The IAreaFragment object (maybe null).
Returns:
List The hotspot areas (never null).

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Returns a clone of the axis.

Overrides:
clone in class AbstractShapeCollection
Returns:
A clone.
Throws:
java.lang.CloneNotSupportedException - if some component of the axis does not support cloning.

hashCode

public int hashCode()
Returns a hash code value for the object.

Overrides:
hashCode in class AbstractShapeCollection
Returns:
A hash code value for this object.

equals

public boolean equals(java.lang.Object obj)
Tests this axis for equality with another object.

Overrides:
equals in class AbstractShapeCollection
Parameters:
obj - The object (null permitted).
Returns:
true or false.

toString

public java.lang.String toString()
Returns a string representation of the object.

Overrides:
toString in class AbstractShapeCollection
Returns:
A string representation of the object.