com.ijchart.xychart.shape
Class PieOutsideLabelChartShape

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.PieOutsideLabelChartShape
All Implemented Interfaces:
IChartShapeChangeListener, IChartShape, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

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

Title: IJChart

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

The outside label shape of pie,composite by a label and a polygon.

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 java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
           The default section label shadow paint.
static double DEFAULT_LABEL_SHADOW_X_OFFSET
           The default x-offset for the label shadow effect.
static double DEFAULT_LABEL_SHADOW_Y_OFFSET
           The default y-offset for the label shadow effect.
static java.awt.Paint DEFAULT_LINK_PAINT
           The default link paint.
static java.awt.Stroke DEFAULT_LINK_STROKE
           The default link stroke.
static java.awt.Paint DEFAULT_SECTOR_SHADOW_PAINT
           The default paint used to draw sector shadow.
 
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
PieOutsideLabelChartShape(java.awt.geom.Rectangle2D labelArea, java.lang.String text, java.awt.Font font, java.awt.Polygon link)
           Draw text in area drawArea.
PieOutsideLabelChartShape(java.awt.geom.Rectangle2D labelArea, java.lang.String text, java.awt.Polygon link)
           Draw text in area drawArea.
 
Method Summary
protected  void calculateTransformedShape()
           Calculate the transformed shape.
 java.lang.Object clone()
           Creates and returns a copy of this object.
 void draw(java.awt.Graphics2D g2)
           Draw the ChartShape on a Java 2d graphics device(such as the screen or the printer).
protected  void drawSelect(java.awt.Graphics2D g2)
           Draw the selected ChartShape on a Java 2d graphics device(such as the screen or the printer).
 boolean equals(java.lang.Object obj)
           Indicates whether some other object is "equal to" this one.
protected  java.awt.Shape getHotspotShape()
           Returns the hotspot shape.
 java.awt.Paint getLabelShadowPaint()
           Returns the paint used to draw sector shadow.
 double getLabelShadowXOffset()
           Returns the x-offset for the label shadow effect.
 double getLabelShadowYOffset()
           Returns the y-offset for the label shadow effect.
 java.awt.Polygon getLink()
           Returns the polygon.
 java.awt.Paint getLinkPaint()
           Returns the link paint.
 java.awt.Stroke getLinkStroke()
           Returns the link stroke.
 ShapeType getShapeType()
           The type for describe this shape.
 int hashCode()
           Returns a hash code value for the object.
 void setLabelShadowPaint(java.awt.Paint paint)
           Sets the paint used to draw sector shadow and sends a ChartShapeChangeEvent to all registered listeners.
 void setLabelShadowXOffset(double offset)
           Sets the x-offset for the label shadow effect and sends a ChartShapeChangeEvent to all registered listeners.
 void setLabelShadowYOffset(double offset)
           Sets the y-offset for the label shadow effect and sends a ChartShapeChangeEvent to all registered listeners.
 void setLink(java.awt.Polygon link)
           Sets the polygon and sends a ChartShapeChangeEvent to all registered listeners.
 void setLinkPaint(java.awt.Paint paint)
           Sets the link paint and sends a ChartShapeChangeEvent to all registered listeners.
 void setLinkStroke(java.awt.Stroke stroke)
           Sets the link stroke and sends a ChartShapeChangeEvent to all registered listeners.
 java.lang.String toString()
           Returns a string representation of the object.
 
Methods inherited from class com.ijchart.xychart.shape.AbstractRectangleTextChartShape
drawText, drawTextWithTrimMarginRect, getDrawArea, getLockPoint, getTextMaxShowLine, getTooltipShapeTranslatePoint, getTopLeftPoint, isAutoWrap, isForceInsideTextNoWrap, isForceShowAll, setAutoWrap, setDrawArea, setForceInsideTextNoWrap, setForceShowAllText, setTextMaxShowLine, splitString, translate
 
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_LABEL_SHADOW_PAINT

public static final java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
The default section label shadow paint.


DEFAULT_LABEL_SHADOW_X_OFFSET

public static final double DEFAULT_LABEL_SHADOW_X_OFFSET
The default x-offset for the label shadow effect.

See Also:
Constant Field Values

DEFAULT_LABEL_SHADOW_Y_OFFSET

public static final double DEFAULT_LABEL_SHADOW_Y_OFFSET
The default y-offset for the label shadow effect.

See Also:
Constant Field Values

DEFAULT_SECTOR_SHADOW_PAINT

public static final java.awt.Paint DEFAULT_SECTOR_SHADOW_PAINT
The default paint used to draw sector shadow.


DEFAULT_LINK_PAINT

public static final java.awt.Paint DEFAULT_LINK_PAINT
The default link paint.


DEFAULT_LINK_STROKE

public static final java.awt.Stroke DEFAULT_LINK_STROKE
The default link stroke.

Constructor Detail

PieOutsideLabelChartShape

public PieOutsideLabelChartShape(java.awt.geom.Rectangle2D labelArea,
                                 java.lang.String text,
                                 java.awt.Polygon link)
Draw text in area drawArea.

Parameters:
labelArea - Rectangle2D The label area (null not permitted).
text - String The text (null permitted).
link - Polygon the polygon (null permitted).

PieOutsideLabelChartShape

public PieOutsideLabelChartShape(java.awt.geom.Rectangle2D labelArea,
                                 java.lang.String text,
                                 java.awt.Font font,
                                 java.awt.Polygon link)
Draw text in area drawArea.

Parameters:
labelArea - Rectangle2D The label area (null not permitted).
text - String The text (null permitted).
font - The specified font (null permitted).If font is null, IChartShape.DEFAULT_TEXT_FONT is used.
link - Polygon the polygon (null permitted).
Method Detail

getLabelShadowPaint

public java.awt.Paint getLabelShadowPaint()
Returns the paint used to draw sector shadow.

Returns:
Paint The paint (maybe null).

setLabelShadowPaint

public void setLabelShadowPaint(java.awt.Paint paint)
Sets the paint used to draw sector shadow and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (null permitted).

getLabelShadowXOffset

public double getLabelShadowXOffset()
Returns the x-offset for the label shadow effect.

Returns:
double The x-offset.

setLabelShadowXOffset

public void setLabelShadowXOffset(double offset)
Sets the x-offset for the label shadow effect and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
offset - double The x-offset.

getLabelShadowYOffset

public double getLabelShadowYOffset()
Returns the y-offset for the label shadow effect.

Returns:
double The y-offset.

setLabelShadowYOffset

public void setLabelShadowYOffset(double offset)
Sets the y-offset for the label shadow effect and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
offset - double The y-offset.

getLink

public java.awt.Polygon getLink()
Returns the polygon.

Returns:
Polygon The polygon.

setLink

public void setLink(java.awt.Polygon link)
Sets the polygon and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
link - Polygon The polygon (null permitted).

getLinkPaint

public java.awt.Paint getLinkPaint()
Returns the link paint.

Returns:
Paint The paint.

setLinkPaint

public void setLinkPaint(java.awt.Paint paint)
Sets the link paint and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
paint - Paint The paint (null not permitted).

getLinkStroke

public java.awt.Stroke getLinkStroke()
Returns the link stroke.

Returns:
Stroke The stroke.

setLinkStroke

public void setLinkStroke(java.awt.Stroke stroke)
Sets the link stroke and sends a ChartShapeChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke (null not permitted).

draw

public void draw(java.awt.Graphics2D g2)
Draw the ChartShape on a Java 2d graphics device(such as the screen or the printer).

Specified by:
draw in interface IChartShape
Parameters:
g2 - Graphics2D The graphics device (such as the screen or the printer) (null not permitted).

drawSelect

protected void drawSelect(java.awt.Graphics2D g2)
Draw the selected ChartShape on a Java 2d graphics device(such as the screen or the printer).

Specified by:
drawSelect in class AbstractChartShape
Parameters:
g2 - Graphics2D the graphics device (such as the screen or the printer) (null not permitted).

calculateTransformedShape

protected void calculateTransformedShape()
Calculate the transformed shape.

Specified by:
calculateTransformedShape in class AbstractChartShape

getHotspotShape

protected java.awt.Shape getHotspotShape()
Returns the hotspot shape.

Specified by:
getHotspotShape in class AbstractChartShape
Returns:
Shape The hotspot shape (maybe null).

getShapeType

public ShapeType getShapeType()
The type for describe this shape.

Specified by:
getShapeType in interface IChartShape
Returns:
ShapeType The constant value in class ShapeType.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

Overrides:
equals in class AbstractRectangleTextChartShape
Parameters:
obj - the reference object with which to compare.
Returns:
true if this object is the same as the obj argument; false otherwise.

hashCode

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

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

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Creates and returns a copy of this object.

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()
Returns a string representation of the object.

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