com.ijchart.xychart.shape
Class GeneralPathChartShape

java.lang.Object
  extended by com.ijchart.xychart.shape.AbstractChartShape
      extended by com.ijchart.xychart.shape.AbstractTextChartShape
          extended by com.ijchart.xychart.shape.AbstractRectangleTextChartShape
              extended by com.ijchart.xychart.shape.GeneralPathChartShape
All Implemented Interfaces:
IChartShapeChangeListener, IChartShape, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class GeneralPathChartShape
extends AbstractRectangleTextChartShape
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

绘制一个GeneralPath图形.

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.shape.AbstractRectangleTextChartShape
DEFAULT_DRAW_AUTO_WRAP, DEFAULT_FORCE_INSIDE_TEXT_NO_WRAP, DEFAULT_FORCE_SHOW_ALL, DEFAULT_TEXT_MAX_SHOW_LINE
 
Fields inherited from class com.ijchart.xychart.shape.AbstractTextChartShape
DEFAULT_TEXT_DIRECTION, DEFAULT_TEXT_HORIZONTAL_ALIGNMENT, DEFAULT_TEXT_POSITION, DEFAULT_TEXT_VERTICAL_ALIGNMENT
 
Fields inherited from class com.ijchart.xychart.shape.AbstractChartShape
DEFAULT_DRAW_TYPE, DEFAULT_SHAPE_ID, DEFAULT_VISIBLE, transformedShape
 
Fields inherited from interface com.ijchart.xychart.shape.IChartShape
DEFAULT_BORDER_PAINT, DEFAULT_BORDER_STROKE, DEFAULT_CONTENT_PAINT, DEFAULT_DRAW_BORDER, DEFAULT_FILL_ALPHA, DEFAULT_FILL_PAINT, DEFAULT_FILL_SHAPE, DEFAULT_GRADIENT_PAINT_TRANSFORM_TYPE, DEFAULT_MARGIN, DEFAULT_SELECT_FILL_PAINT, DEFAULT_SELECT_RECT_ALPHA, DEFAULT_SELECT_RECT_WIDTH, DEFAULT_SELECTED, DEFAULT_TEXT_FONT, DEFAULT_TOOLTIP_SHAPE_WIDTH, HOTSPOT_TYPE_CIRCLE, HOTSPOT_TYPE_POLYGON, HOTSPOT_TYPE_RECTANGLE
 
Constructor Summary
GeneralPathChartShape(java.awt.geom.GeneralPath shape)
          由一个GeneralPath图形构造本对象.
GeneralPathChartShape(java.awt.geom.GeneralPath shape, java.awt.geom.GeneralPath hotspot)
          由一个GeneralPath图形构造本对象.
GeneralPathChartShape(java.awt.geom.GeneralPath shape, java.awt.geom.GeneralPath hotspot, java.awt.geom.Rectangle2D drawArea, java.lang.String text)
          在区域drawArea中显示文字text.
GeneralPathChartShape(java.awt.geom.GeneralPath shape, java.awt.geom.Rectangle2D drawArea, java.lang.String text)
          在区域drawArea中显示文字text.
 
Method Summary
protected  void calculateTransformedShape()
          计算变换后的图形.
 java.lang.Object clone()
          返回克隆的对象.
 void draw(java.awt.Graphics2D g2)
          在图形设备(如屏幕或打印机)上绘制图形的选中部分,因为图形可能会有重叠,所以绘制图形时要先绘制完所有的图形后, 再调用此方法绘制选中部分.
protected  void drawSelect(java.awt.Graphics2D g2)
          在图形设备(如屏幕或打印机)上绘制图形的选中部分,因为图形可能会有重叠,所以绘制图形时要先绘制完所有的图形后, 再调用此方法绘制选中部分.
 boolean equals(java.lang.Object obj)
          测试两个对象是否相等.
 java.awt.geom.GeneralPath getHotspot()
          返回生成热点的图形.
protected  java.awt.Shape getHotspotShape()
          返回热点图形.
 java.awt.geom.Point2D getLockPoint()
          返回鼠标点击时锁定图形的点.
 java.awt.geom.GeneralPath getShape()
          返回要绘制的图形.
 ShapeType getShapeType()
          描述本图形的类型.
 java.awt.geom.Point2D getTopLeftPoint()
          返回图形左上角的坐标(不考虑图形的旋转).
 int hashCode()
          计算对象的hashcode值.
 void setHotspot(java.awt.geom.GeneralPath hotspot)
          设置生成热点的图形,并向所有监听器发送 ChartShapeChangeEvent事件.
 void setShape(java.awt.geom.GeneralPath shape)
          设置要绘制的图形,并向所有监听器发送 ChartShapeChangeEvent事件.
 java.lang.String toString()
          覆盖toString方法.

Parameters:
shape - GeneralPath GeneralPath图形 (不可为null).

GeneralPathChartShape

public GeneralPathChartShape(java.awt.geom.GeneralPath shape,
                             java.awt.geom.GeneralPath hotspot)
由一个GeneralPath图形构造本对象.

Parameters:
shape - GeneralPath GeneralPath图形 (不可为null).
hotspot - GeneralPath 生成热点的图形 (可为null).

GeneralPathChartShape

public GeneralPathChartShape(java.awt.geom.GeneralPath shape,
                             java.awt.geom.Rectangle2D drawArea,
                             java.lang.String text)
在区域drawArea中显示文字text.

Parameters:
shape - GeneralPath GeneralPath图形 (不可为null).
drawArea - Rectangle2D 绘制区域 (不可为null).
text - String 要显示的文字 (可为null).

GeneralPathChartShape

public GeneralPathChartShape(java.awt.geom.GeneralPath shape,
                             java.awt.geom.GeneralPath hotspot,
                             java.awt.geom.Rectangle2D drawArea,
                             java.lang.String text)
在区域drawArea中显示文字text.

Parameters:
shape - GeneralPath GeneralPath图形 (不可为null).
hotspot - GeneralPath 生成热点的图形 (可为null).
drawArea - Rectangle2D 绘制区域 (不可为null).
text - String 要显示的文字 (可为null).
Method Detail

getShape

public java.awt.geom.GeneralPath getShape()
返回要绘制的图形.

Returns:
GeneralPath 要绘制的图形 (不可为null).

setShape

public void setShape(java.awt.geom.GeneralPath shape)
设置要绘制的图形,并向所有监听器发送 ChartShapeChangeEvent事件.

Parameters:
shape - GeneralPath 要绘制的图形.

getHotspot

public java.awt.geom.GeneralPath getHotspot()
返回生成热点的图形.

Returns:
GeneralPath 生成热点的图形 (可为null).

setHotspot

public void setHotspot(java.awt.geom.GeneralPath hotspot)
设置生成热点的图形,并向所有监听器发送 ChartShapeChangeEvent事件.

Parameters:
hotspot - GeneralPath 生成热点的图形.

draw

public void draw(java.awt.Graphics2D g2)
在图形设备(如屏幕或打印机)上绘制图形的选中部分,因为图形可能会有重叠,所以绘制图形时要先绘制完所有的图形后, 再调用此方法绘制选中部分.

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

drawSelect

protected void drawSelect(java.awt.Graphics2D g2)
在图形设备(如屏幕或打印机)上绘制图形的选中部分,因为图形可能会有重叠,所以绘制图形时要先绘制完所有的图形后, 再调用此方法绘制选中部分.

Specified by:
drawSelect in class AbstractChartShape
Parameters:
g2 - Graphics2D 图形设备(如屏幕或打印机) (不可为null)

calculateTransformedShape

protected void calculateTransformedShape()
计算变换后的图形.

Specified by:
calculateTransformedShape in class AbstractChartShape

getHotspotShape

protected java.awt.Shape getHotspotShape()
返回热点图形.

Specified by:
getHotspotShape in class AbstractChartShape
Returns:
Shape 热点图形 (可为null).

getShapeType

public ShapeType getShapeType()
描述本图形的类型.

Specified by:
getShapeType in interface IChartShape
Returns:
ShapeType ShapeType类定义的常量 (不可为null).

getTopLeftPoint

public java.awt.geom.Point2D getTopLeftPoint()
返回图形左上角的坐标(不考虑图形的旋转).

Specified by:
getTopLeftPoint in interface IChartShape
Overrides:
getTopLeftPoint in class AbstractRectangleTextChartShape
Returns:
Point2D 坐标值.

getLockPoint

public java.awt.geom.Point2D getLockPoint()
返回鼠标点击时锁定图形的点.

Specified by:
getLockPoint in interface IChartShape
Overrides:
getLockPoint in class AbstractRectangleTextChartShape
Returns:
Point2D 坐标值.

translate

public void translate(double tx,
                      double ty)
相对移动本图形,其中X轴方向偏移tx,Y轴方向偏移ty,并向所有监听器发送 ChartShapeChangeEvent事件.

Specified by:
translate in interface IChartShape
Overrides:
translate in class AbstractRectangleTextChartShape
Parameters:
tx - double 沿X轴方向的距离.
ty - double 沿Y轴方向的距离.

equals

public boolean equals(java.lang.Object obj)
测试两个对象是否相等.

Overrides:
equals in class AbstractRectangleTextChartShape
Parameters:
obj - 要比较的对象
Returns:
相等返回true,否则返回false.

hashCode

public int hashCode()
计算对象的hashcode值.

Overrides:
hashCode in class AbstractRectangleTextChartShape
Returns:
int 对象的hashcode值.

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
返回克隆的对象.

Overrides:
clone in class AbstractRectangleTextChartShape
Returns:
object a clone of this instance.
Throws:
java.lang.CloneNotSupportedException - if the object's class does not support the Cloneable interface. Subclasses that override the clone method can also throw this exception to indicate that an instance cannot be cloned.

toString

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

Overrides:
toString in class AbstractRectangleTextChartShape
Returns:
a string representation of the object.