com.ijchart.xychart.chartinfo
Class ChartShapeCollection

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

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

Title: IJChart

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

图表中的每个元素都是一个图形对象IChartShape , 分如下几种类型:标题、图例、plot区域.

Copyright: Copyright (c) 2013

Company:

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

Field Summary
static double DEFAULT_SCALE_X_AXIS
          缺省的x轴方向的坐标.
static double DEFAULT_SCALE_Y_AXIS
          缺省的y轴方向的坐标.
 
Fields inherited from class com.ijchart.xychart.chartinfo.AbstractShapeCollection
shapeIdSequence
 
Constructor Summary
ChartShapeCollection()
          缺省构造器.
 
Method Summary
 void addPlotShapes(PlotShapeCollection plotShapes)
          增加plot图形集合.
 void addTitleShapes(TitleShapeCollection titleShape)
          增加一个标题图形.
 void chartShapeChanged(ChartShapeChangeEvent event)
          接收到图形对象变化的通知.
 void clearPlotShapes()
          删除所有的plot图形集合.
 void clearSelectedShapes()
          把所有的图形置为非选中状态.
 void clearShapesListener()
          清除所有的图形的监听器.
 java.lang.Object clone()
          克隆本对象.
 void draw(java.awt.Graphics2D g2)
          依次绘制集合中每一个图形.
 boolean equals(java.lang.Object obj)
          覆盖equals方法.
 IChartShape findChartShape(java.awt.geom.Point2D point, ChartShapeDrawType drawType)
          返回包含此point点的图形.
 void forceChartChanged()
          强制设置图形是否有改变,此设置会导致图形重新绘制.
 java.util.Collection getAllPlotShapes()
          返回所有的plot图形集合.
 IChartShape getBackgroundImageShape()
          返回背景图片图形.
 IChartShape getBackgroundShape()
          返回背景图片图形.
 IChartShape getBorderShape()
          设置边框图形.
 IChangeChartShape getChangeChartShape()
          返回图形改变类对象.
 java.util.List getHotspotAreas(java.util.List drawTypes, IAreaFragment fragment)
          返回图形的热点Area.
 IJChart getIJChart()
          返回产生图形的IJChart对象.
 LegendShapeCollection getLegendShapes()
          返回图例图形集合.
 PlotShapeCollection getPlotShapes()
          返回第0个plot图形集合.
 PlotShapeCollection getPlotShapes(int index)
          返回指定索引的plot图形集合.
 double getScaleX()
          返回x轴方向的坐标.
 double getScaleY()
          返回y轴方向的坐标.
 TitleShapeCollection getTitleShapes()
          返回第0个title图形集合.
 TitleShapeCollection getTitleShapes(int index)
          返回指定索引的title图形集合.
 java.util.List getTitleShapesList()
          返回标题图形集合,此集合不可修改.
 int hashCode()
          覆盖hashCode方法.
 boolean isShapeChanged()
          返回图形是否有改变.
 void setBackgroundImageShape(IChartShape shape)
          设置背景图片图形.
 void setBackgroundShape(IChartShape shape)
          设置背景图片图形.
 void setBorderShape(IChartShape borderShape)
          设置边框图形.
 void setChangeChartShape(IChangeChartShape change)
          设置图形改变类对象.
 void setIJChart(IJChart chart)
          设置产生图形的IJChart对象.
 void setLegendShapes(LegendShapeCollection legendShapes)
          设置图例图形集合.
 void setScaleX(double scale)
          设置x轴方向的坐标.
 void setScaleY(double scale)
          设置y轴方向的坐标.
 void setShapeChanged(boolean flag)
          设置图形是否有改变,如果改变了则图形会重新绘制.
 java.lang.String toString()
          覆盖toString方法.
 void translate(double x, double y)
          移动所有图形的原点到点(x,y).

See Also:
Constant Field Values

DEFAULT_SCALE_Y_AXIS

public static final double DEFAULT_SCALE_Y_AXIS
缺省的y轴方向的坐标.

See Also:
Constant Field Values
Constructor Detail

ChartShapeCollection

public ChartShapeCollection()
缺省构造器.

Method Detail

getBackgroundShape

public IChartShape getBackgroundShape()
返回背景图片图形.

Returns:
IChartShape 背景图片图形(可能为null).

setBackgroundShape

public void setBackgroundShape(IChartShape shape)
设置背景图片图形.

Parameters:
shape - IChartShape 背景图片图形(可为null).

getBackgroundImageShape

public IChartShape getBackgroundImageShape()
返回背景图片图形.

Returns:
IChartShape 背景图片图形(可能为null).

setBackgroundImageShape

public void setBackgroundImageShape(IChartShape shape)
设置背景图片图形.

Parameters:
shape - IChartShape 背景图片图形(可为null).

setBorderShape

public void setBorderShape(IChartShape borderShape)
设置边框图形.

Parameters:
borderShape - IChartShape 边框图形 (可为null).

getBorderShape

public IChartShape getBorderShape()
设置边框图形.

Returns:
IChartShape 边框图形 (可能为null).

getTitleShapesList

public java.util.List getTitleShapesList()
返回标题图形集合,此集合不可修改.

Returns:
List 标题图形集合,此集合不可修改.

addTitleShapes

public void addTitleShapes(TitleShapeCollection titleShape)
增加一个标题图形.

Parameters:
titleShape - TitleShapeCollection 标题图形 (可为null).

getTitleShapes

public TitleShapeCollection getTitleShapes()
返回第0个title图形集合.

Returns:
TitleShapeCollection title图形集合.

getTitleShapes

public TitleShapeCollection getTitleShapes(int index)
返回指定索引的title图形集合.

Parameters:
index - int 索引值.
Returns:
TitleShapeCollection title图形集合.

getLegendShapes

public LegendShapeCollection getLegendShapes()
返回图例图形集合.

Returns:
LegendShapeCollection 图例图形集合.

setLegendShapes

public void setLegendShapes(LegendShapeCollection legendShapes)
设置图例图形集合.

Parameters:
legendShapes - LegendShapeCollection 图例图形集合 (可为null).

addPlotShapes

public void addPlotShapes(PlotShapeCollection plotShapes)
增加plot图形集合.

Parameters:
plotShapes - PlotShapeCollection plot图形集合 (可为null).

getPlotShapes

public PlotShapeCollection getPlotShapes()
返回第0个plot图形集合.

Returns:
PlotShapeCollection plot图形集合.

getPlotShapes

public PlotShapeCollection getPlotShapes(int index)
返回指定索引的plot图形集合.

Parameters:
index - int 索引值.
Returns:
PlotShapeCollection plot图形集合.

getAllPlotShapes

public java.util.Collection getAllPlotShapes()
返回所有的plot图形集合.

Returns:
Collection 此集合不可修改.

clearPlotShapes

public void clearPlotShapes()
删除所有的plot图形集合.


getIJChart

public IJChart getIJChart()
返回产生图形的IJChart对象.

Returns:
IJChart 产生图形的IJChart对象 (不为null).

setIJChart

public void setIJChart(IJChart chart)
设置产生图形的IJChart对象.

Parameters:
chart - IJChart 产生图形的IJChart对象 (不可为null).

isShapeChanged

public boolean isShapeChanged()
返回图形是否有改变.

Returns:
boolean 布尔值.

setShapeChanged

public void setShapeChanged(boolean flag)
设置图形是否有改变,如果改变了则图形会重新绘制.

Parameters:
flag - boolean 布尔值.

forceChartChanged

public void forceChartChanged()
强制设置图形是否有改变,此设置会导致图形重新绘制.


getScaleX

public double getScaleX()
返回x轴方向的坐标.

Returns:
double 缩放因子.

setScaleX

public void setScaleX(double scale)
设置x轴方向的坐标.

Parameters:
scale - double 缩放因子.

getScaleY

public double getScaleY()
返回y轴方向的坐标.

Returns:
double 缩放因子.

setScaleY

public void setScaleY(double scale)
设置y轴方向的坐标.

Parameters:
scale - double 缩放因子.

getChangeChartShape

public IChangeChartShape getChangeChartShape()
返回图形改变类对象.

Returns:
IChangeChartShape 图形改变类对象 (可为null).

setChangeChartShape

public void setChangeChartShape(IChangeChartShape change)
设置图形改变类对象.

Parameters:
change - IChangeChartShape 图形改变类对象.

draw

public void draw(java.awt.Graphics2D g2)
依次绘制集合中每一个图形.

Specified by:
draw in interface IShapeCollection
Parameters:
g2 - Graphics2D 图形设备(打印机或屏幕) (不可为null).

chartShapeChanged

public void chartShapeChanged(ChartShapeChangeEvent event)
接收到图形对象变化的通知.

Specified by:
chartShapeChanged in interface IChartShapeChangeListener
Overrides:
chartShapeChanged in class AbstractShapeCollection
Parameters:
event - ChartShapeChangeEvent 描述图形对象变化的对象

translate

public void translate(double x,
                      double y)
移动所有图形的原点到点(x,y).

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

clearShapesListener

public void clearShapesListener()
清除所有的图形的监听器.

Specified by:
clearShapesListener in interface IShapeCollection

findChartShape

public IChartShape findChartShape(java.awt.geom.Point2D point,
                                  ChartShapeDrawType drawType)
返回包含此point点的图形.

Specified by:
findChartShape in interface IShapeCollection
Parameters:
point - Point2D 要测试的点 (不可为null).
drawType - ChartShapeDrawType 图形的绘制类型 (可为null).
Returns:
IChartShape 图形 (可为null).

getHotspotAreas

public java.util.List getHotspotAreas(java.util.List drawTypes,
                                      IAreaFragment fragment)
返回图形的热点Area.

Specified by:
getHotspotAreas in interface IShapeCollection
Overrides:
getHotspotAreas in class AbstractShapeCollection
Parameters:
drawTypes - List 显示热点的图形类型.
fragment - IAreaFragment 实现接口IAreaFragment的对象,(可为null)
Returns:
List 图形的热点Area (不为null).

clearSelectedShapes

public void clearSelectedShapes()
把所有的图形置为非选中状态.

Specified by:
clearSelectedShapes in interface IShapeCollection

hashCode

public int hashCode()
覆盖hashCode方法.

Overrides:
hashCode in class AbstractShapeCollection
Returns:
int

equals

public boolean equals(java.lang.Object obj)
覆盖equals方法.

Overrides:
equals in class AbstractShapeCollection
Parameters:
obj - Object
Returns:
boolean

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
克隆本对象.

Overrides:
clone in class AbstractShapeCollection
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException

toString

public java.lang.String toString()
覆盖toString方法.

Overrides:
toString in class AbstractShapeCollection
Returns:
String