com.ijchart.xychart.shape
Class RingChartShape

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.SectorChartShape
                  extended by com.ijchart.xychart.shape.RingChartShape
All Implemented Interfaces:
IChartShapeChangeListener, IChartShape, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class RingChartShape
extends SectorChartShape
implements java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

绘制扇形图.

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_LENGTH_FACTOR
          缺省的环的长度与扇区半径的占比.
 
Fields inherited from class com.ijchart.xychart.shape.SectorChartShape
DEFAULT_ARC_BORDER_PAINT, DEFAULT_DEPTH_3D, DEFAULT_DRAW_RADIUS, DEFAULT_LABEL_BACKGROUND_PAINT, DEFAULT_LABEL_OUTLINE_PAINT, DEFAULT_LABEL_OUTLINE_STROKE, DEFAULT_LABEL_PADDING, DEFAULT_LABEL_SHADOW_PAINT, DEFAULT_LABEL_SHADOW_X_OFFSET, DEFAULT_LABEL_SHADOW_Y_OFFSET, DEFAULT_SECTOR_IS_3D, DEFAULT_SECTOR_SHADOW_PAINT, DEFAULT_SECTOR_SHADOW_X_OFFSET, DEFAULT_SECTOR_SHADOW_Y_OFFSET
 
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
RingChartShape(java.awt.geom.Arc2D arc, java.awt.geom.Rectangle2D drawArea, java.lang.String text)
          构造器.
 
Method Summary
protected  void calculateTransformedShape()
          计算变换后的图形.
 java.lang.Object clone()
          返回克隆的对象.
 void draw(java.awt.Graphics2D g2)
          在图形设备(如屏幕或打印机)上绘制此图形.绘制时不考虑shape的位置坐标.
protected  java.awt.Shape getHotspotShape()
          返回热点图形.
 double getLengthFactor()
          返回环的长度与扇区半径的占比.
 java.awt.geom.Point2D getLockPoint()
          返回鼠标点击时锁定图形的点.
 ShapeType getShapeType()
          描述本图形的类型.
 int hashCode()
          计算对象的hashcode值.
 void setLengthFactor(double factor)
          设置环的长度与扇区半径的占比,并向所有监听器发送 ChartShapeChangeEvent事件.
 
Methods inherited from class com.ijchart.xychart.shape.SectorChartShape
drawSelect, getArc, getDepth3D, getLabelBackgroundPaint, getLabelOutlinePaint, getLabelOutlineStroke, getLabelPadding, getLabelShadowPaint, getLabelShadowXOffset, getLabelShadowYOffset, getPointsOfArc, getSectorShadowPaint, getSectorShadowXOffset, getSectorShadowYOffset, getTopLeftPoint, isDrawRadius, isSector3D, setArc, setDepth3D, setDrawRadius, setLabelBackgroundPaint, setLabelOutlinePaint, setLabelOutlineStroke, setLabelPadding, setLabelShadowPaint, setLabelShadowXOffset, setLabelShadowYOffset, setSector3D, setSectorShadowPaint, setSectorShadowXOffset, setSectorShadowYOffset, translate
 
Methods inherited from class com.ijchart.xychart.shape.AbstractRectangleTextChartShape
drawText, drawTextWithTrimMarginRect, getDrawArea, getTextMaxShowLine, getTooltipShapeTranslatePoint, isAutoWrap, isForceInsideTextNoWrap, isForceShowAll, setAutoWrap, setDrawArea, setForceInsideTextNoWrap, setForceShowAllText, setTextMaxShowLine, splitString, toString
 
Methods inherited from class com.ijchart.xychart.shape.AbstractTextChartShape
getText, getTextDirection, getTextFont, getTextHorizontalAlign, getTextPaint, getTextPosition, getTextVerticalAlign, isDrawText, setDrawText, setText, setTextDirection, setTextFont, setTextHorizontalAlign, setTextPaint, setTextPosition, setTextVerticalAlign
 
Methods inherited from class com.ijchart.xychart.shape.AbstractChartShape
addChangeListener, afterDraw, beforeDraw, chartShapeChanged, contains, contains, drawAnchorByPoints, drawBackground, drawBorder, drawShapeBorder, fillShape, fireChartShapeChanged, forceChartShapeChanged, getBorderPaint, getBorderStroke, getBound, getData, getFillAlpha, getFillPaint, getGradientPaintTransformType, getHotspotPolyCoords, getHotspotType, getHotspotType, getId, getMargin, getOriginTooltipShape, getRotate, getSelectAnchorPaint, getSelectRectAlpha, getSelectRectWidth, getShapeChange, getShapeDrawType, getTooltipShape, getTooltipShapeRotate, getTooltipText, getURL, hasListener, isDrawBorder, isFillShape, isSelected, isVisible, notifyListeners, removeAllChangeListener, removeChangeListener, setBorderPaint, setBorderStroke, setData, setDrawBorder, setFillAlpha, setFillPaint, setFillShape, setGradientPaintTransformType, setId, setMargin, setOriginTooltipShape, setRotate, setSelectAnchorPaint, setSelected, setSelectRectAlpha, setSelectRectWidth, setShapeChange, setShapeDrawType, setTooltipText, setURL, setVisible
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_LENGTH_FACTOR

public static final double DEFAULT_LENGTH_FACTOR
缺省的环的长度与扇区半径的占比.

See Also:
Constant Field Values
Constructor Detail

RingChartShape

public RingChartShape(java.awt.geom.Arc2D arc,
                      java.awt.geom.Rectangle2D drawArea,
                      java.lang.String text)
构造器.

Parameters:
arc - Arc2D 扇形图形 (不可为null).
drawArea - Rectangle2D 绘制区域 (不可为null).
text - String 要显示的文字 (可为null).
Method Detail

getLengthFactor

public double getLengthFactor()
返回环的长度与扇区半径的占比.

Returns:
double 长度因子.

setLengthFactor

public void setLengthFactor(double factor)
设置环的长度与扇区半径的占比,并向所有监听器发送 ChartShapeChangeEvent事件.

Parameters:
factor - double 长度因子,属于区间(0,1].

draw

public void draw(java.awt.Graphics2D g2)
在图形设备(如屏幕或打印机)上绘制此图形.绘制时不考虑shape的位置坐标.

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

getLockPoint

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

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

calculateTransformedShape

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

Overrides:
calculateTransformedShape in class SectorChartShape

getHotspotShape

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

Overrides:
getHotspotShape in class SectorChartShape
Returns:
Shape 热点图形 (可为null).

getShapeType

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

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

hashCode

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

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

equals

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

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

clone

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

Overrides:
clone in class SectorChartShape
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.