com.ijchart.xychart.render.noaxis
Class PieRender

java.lang.Object
  extended by com.ijchart.xychart.render.AbstractRender
      extended by com.ijchart.xychart.render.noaxis.AbstractNoAxisRender
          extended by com.ijchart.xychart.render.noaxis.PieRender
All Implemented Interfaces:
IDatasetChangeListener, INoAxisRender, IRender, java.io.Serializable, java.lang.Cloneable, java.util.EventListener

public class PieRender
extends AbstractNoAxisRender
implements INoAxisRender, java.lang.Cloneable, java.io.Serializable

Title: IJChart

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

Draw pie chart shapes.

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_DEPTH_3D
           The default depth of 3D pie.
static boolean DEFAULT_DRAW_AS_RING
           A default flag that controls whether or not the shape is ring.
static double DEFAULT_INTERIOR_GAP
           The default interior gap.
static boolean DEFAULT_IS_CIRCLE
           The default flag determining whether to draw an ellipse or a perfect circle.
static java.awt.Paint DEFAULT_LABEL_BACKGROUND_PAINT
           The default section label background paint.
static double DEFAULT_LABEL_GAP
           The default gap between the labels and the render as a percentage of the render area width.
static boolean DEFAULT_LABEL_IN_PIE
           A default flag that controls whether or not label in pie.
static double DEFAULT_LABEL_LINK_MARGIN
           The default link margin.
static java.awt.Paint DEFAULT_LABEL_LINK_PAINT
           The default paint used for the label linking lines.
static java.awt.Stroke DEFAULT_LABEL_LINK_STROKE
           The default stroke used for the label linking lines.
static boolean DEFAULT_LABEL_LINKS_VISIBLE
           A default flag that controls whether or not the label links are drawn.
static java.awt.Paint DEFAULT_LABEL_OUTLINE_PAINT
           The default section label outline paint.
static java.awt.Stroke DEFAULT_LABEL_OUTLINE_STROKE
           The default section label outline stroke.
static RectangleInsets DEFAULT_LABEL_PADDING
           The default padding between the labels and the label outlines.
static java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
           The default section label shadow paint.
static double DEFAULT_MAXIMUM_LABEL_WIDTH
           The default maximum label width as a percentage of the draw area width.
static double DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW
           The default minimum arc angle to draw.
static boolean DEFAULT_PIE_IS_3D
           A default flag that controls whether or not the pie is 3D.
static Rotation DEFAULT_PIE_ROTATION
           The default direction for the pie segments.
static java.awt.Paint DEFAULT_PIE_SHADOW_PAINT
           The default pie shadow paint.
static boolean DEFAULT_SECTION_OUTLINES_VISIBLE
           A default flag that controls whether or not an outline is drawn for each section in the render area.
static double DEFAULT_SHADOW_X_OFFSET
           The default x-offset for the shadow effect.
static double DEFAULT_SHADOW_Y_OFFSET
           The default y-offset for the shadow effect.
static boolean DEFAULT_SIMPLE_LABELS
           A default flag that controls whether simple or extended labels are used.
static double DEFAULT_START_ANGLE
           The default starting angle for the pie chart.
static double MAX_INTERIOR_GAP
           The maximum interior gap.
 
Fields inherited from class com.ijchart.xychart.render.AbstractRender
borderPaints, borderStrokes, DEFAULT_AUTO_SELECT_BORDER_PAINT, DEFAULT_AUTO_SELECT_BORDER_STROKE, DEFAULT_AUTO_SELECT_FILL_PAINT, DEFAULT_BACKGROUND_IMAGE_ALIGNMENT, DEFAULT_BACKGROUND_PAINT, DEFAULT_BASE_BORDER_PAINT, DEFAULT_BASE_BORDER_STROKE, DEFAULT_BASE_ITEM_FILL, DEFAULT_BASE_ITEM_FILL_PAINT, DEFAULT_BASE_ITEM_FILL_PAINT_TRANSFORMER, DEFAULT_BASE_ITEM_LABEL_FONT, DEFAULT_BASE_ITEM_LABEL_HORIZONTAL_ALIGNMENT, DEFAULT_BASE_ITEM_LABEL_PAINT, DEFAULT_BASE_ITEM_LABEL_VERTICAL_ALIGNMENT, DEFAULT_BASE_ITEM_LABEL_VISIBLE, DEFAULT_BORDER_PAINT, DEFAULT_BORDER_STROKE, DEFAULT_DRAW_BORDER, DEFAULT_DRAWINT_SUPPLIER, DEFAULT_GENERATOR_TOOLTIP, DEFAULT_GENERATOR_URL, DEFAULT_LABEL_GENERATOR, DEFAULT_RENDER_AREA_BORDER_VISIBLE, DEFAULT_TOOLTIP_GENERATOR, fillPaints
 
Constructor Summary
PieRender(SingleRowDataset dataset)
           constructor.
PieRender(SingleRowDataset dataset, boolean is3D)
           constructor.
 
Method Summary
 java.lang.Object clone()
           Creates and returns a copy of this object.
protected  IChartShape createItemShapeOnly(java.awt.geom.Rectangle2D rect, java.lang.String text, java.lang.Object appendParam)
           Create a shape with no attribute specified.
 void drawAllItems(java.awt.geom.Rectangle2D dataArea, RenderShapeCollection renderShapes, float alpha)
           Draws all data items.
 void drawBackground(java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, RenderShapeCollection renderShapes)
           Draws a background for the data area.
protected  void drawLabels(double totalValue, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D pieArea, java.awt.geom.Rectangle2D linkArea, RenderShapeCollection renderShapes)
           Draws the labels for the pie sections.
protected  void drawLeftLabels(java.util.Hashtable leftKeys, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D linkArea, java.awt.geom.Rectangle2D pieArea, RenderShapeCollection renderShapes)
           Draws the left labels.
protected  void drawRightLabels(java.util.Hashtable rightKeys, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D linkArea, java.awt.geom.Rectangle2D pieArea, RenderShapeCollection renderShapes)
           Draws the right labels.
 boolean equals(java.lang.Object obj)
           Tests this instance for equality with an arbitrary object.
protected  java.awt.geom.Rectangle2D getArcBounds(java.awt.geom.Rectangle2D unexploded, double startAngle, double extent, double explodePercent)
           Returns a rectangle that can be used to create a pie section.
 double getDepth3D()
           Returns the depth of 3D pie.
 double getExplodePercentages(int index)
           Returns the percentage amount to explode each pie section of the specified data.
 double getInteriorGap()
           Returns the interior gap.
 java.awt.Paint getLabelBackgroundPaint()
           Returns the color used to draw the background of the section labels.
 double getLabelGap()
           Returns the gap between the labels and the draw area as a percentage of the render area width.
 double getLabelLinkMargin()
           Returns the link margin.
 java.awt.Paint getLabelLinkPaint()
           Returns the paint used for the label linking lines.
 java.awt.Stroke getLabelLinkStroke()
           Returns the stroke used for the label linking lines.
 java.awt.Paint getLabelOutlinePaint()
           Returns the paint used to draw the outline of the section labels.
 java.awt.Stroke getLabelOutlineStroke()
           Returns the stroke used to draw the outline of the section labels.
 RectangleInsets getLabelPadding()
           Returns the padding between the labels and the label outlines.
 java.awt.Paint getLabelShadowPaint()
           Returns the paint used to draw the shadow for the section labels.
 double getMaximumExplodePercent()
           Returns the maximum explode percent.
 double getMaximumLabelWidth()
           Returns the maximum label width as a percentage of the draw area width.
 double getMinimumArcAngleToDraw()
           Returns the smallest arc angle that will get drawn.
 Rotation getPieRotation()
           Returns the direction for the pie segments.
 java.awt.Paint getPieShadowPaint()
           Returns the pie shadow paint.
 double getRingLengthFactor()
           Returns the length factor.
 double getShadowXOffset()
           Returns the x-offset for the shadow effect.
 double getShadowYOffset()
           Returns the y-offset for the shadow effect.
 double getStartAngle()
           Returns the starting angle.
 int hashCode()
           Returns a hash code value for the object.
 boolean isCircular()
           Returns the flag determining whether to draw an ellipse or a perfect circle.
 boolean isDrawAsRing()
           Returns whether or not the shape is ring.
 boolean isLabelInPie()
           Returns the flag that controls whether or not label in pie.
 boolean isLabelLinksVisible()
           A flag that controls whether or not the label links are drawn.
 boolean isPie3D()
           Returns whether or not the pie is 3D.
 boolean isSectionOutlinesVisible()
           Returns the flag that controls whether or not an outline is drawn for each section in the render area.
 boolean isSimpleLabels()
           Returns the flag that controls whether simple or extended labels are used.
 void setCircular(boolean flag)
           Sets the flag determining whether to draw an ellipse or a perfect circle and sends a RenderChangeEvent to all registered listeners.
 void setDepth3D(double depth3D)
           Sets the depth of 3D pie and sends a RenderChangeEvent to all registered listeners.
 void setDrawAsRing(boolean flag)
           Sets the flag that controls whether or not the shape is ring and sends a RenderChangeEvent to all registered listeners.
 void setExplodePercent(int index, double percent)
           Sets the percentage amount to explode each pie section and sends a RenderChangeEvent to all registered listeners.
 void setInteriorGap(double gapSize)
           Sets the interior gap and sends a RenderChangeEvent to all registered listeners.
 void setLabelBackgroundPaint(java.awt.Paint paint)
           Sets the color used to draw the background of the section labels and sends a RenderChangeEvent to all registered listeners.
 void setLabelGap(double gap)
           Sets the gap between the labels and the render area and sends a RenderChangeEvent to all registered listeners.
 void setLabelInPie(boolean flag)
           Sets the flag that controls whether or not label in pie and sends a RenderChangeEvent to all registered listeners.
 void setLabelLinkMargin(double margin)
           Sets the link margin and sends a RenderChangeEvent to all registered listeners.
 void setLabelLinkPaint(java.awt.Paint paint)
           Sets the paint used for the label linking lines and sends a RenderChangeEvent to all registered listeners.
 void setLabelLinkStroke(java.awt.Stroke stroke)
           Sets the stroke used for the label linking lines and sends a RenderChangeEvent to all registered listeners.
 void setLabelLinksVisible(boolean flag)
           Sets whether or not the label links are drawn and sends a RenderChangeEvent to all registered listeners.
 void setLabelOutlinePaint(java.awt.Paint paint)
           Sets the paint used to draw the outline of the section labels and sends a RenderChangeEvent to all registered listeners.
 void setLabelOutlineStroke(java.awt.Stroke stroke)
           Sets the stroke used to draw the outline of the section labels and sends a RenderChangeEvent to all registered listeners.
 void setLabelPadding(RectangleInsets padding)
           Sets the padding between the labels and the label outlines and sends a RenderChangeEvent to all registered listeners.
 void setLabelShadowPaint(java.awt.Paint paint)
           Sets the paint used to draw the shadow for the section labels and sends a RenderChangeEvent to all registered listeners.
 void setMaximumLabelWidth(double maximumWidth)
           Sets the maximum label width as a percentage of the draw area width and sends a RenderChangeEvent to all registered listeners.
 void setMinimumArcAngleToDraw(double angle)
           Sets the smallest arc angle that will get drawn and sends a RenderChangeEvent to all registered listeners.
 void setPie3D(boolean flag)
           Sets the flag that controls whether or not the pie is 3D and sends a RenderChangeEvent to all registered listeners.
 void setPieRotation(Rotation rotation)
           Sets the direction for the pie segments and sends a RenderChangeEvent to all registered listeners.
 void setPieShadowPaint(java.awt.Paint paint)
           Sets the pie shadow paint and sends a RenderChangeEvent to all registered listeners.
 void setRingLengthFactor(double factor)
           Sets the length factor and sends a RenderChangeEvent to all registered listeners.
 void setSectionOutlinesVisible(boolean flag)
           Sets the flag that controls whether or not an outline is drawn for each section in the render area and sends a RenderChangeEvent to all registered listeners.
 void setShadowXOffset(double offset)
           Sets the x-offset for the shadow effect and sends a RenderChangeEvent to all registered listeners.
 void setShadowYOffset(double offset)
           Sets the y-offset for the shadow effect and sends a RenderChangeEvent to all registered listeners.
 void setSimpleLabels(boolean flag)
           Sets the flag that controls whether simple or extended labels are used and sends a RenderChangeEvent to all registered listeners.
 void setStartAngle(double angle)
           Sets the starting angle and sends a RenderChangeEvent to all registered listeners.
 java.lang.String toString()
           Returns a string representation of the object.
 
Methods inherited from class com.ijchart.xychart.render.noaxis.AbstractNoAxisRender
createItemShape
 
Methods inherited from class com.ijchart.xychart.render.AbstractRender
add3DShapes, addChangeListener, calculateLegendItemShapes, datasetChanged, drawBackgroundImage, drawDrawAreaBorder, fireRenderChanged, getBackgroundImage, getBackgroundImageAlignment, getBackgroundImageAlpha, getBackgroundPaint, getBaseItemBorderPaint, getBaseItemBorderStroke, getBaseItemFillPaint, getBaseItemFillPaintTransformer, getBaseItemLabelDirection, getBaseItemLabelFont, getBaseItemLabelHorizontalAlignment, getBaseItemLabelPaint, getBaseItemLabelPosition, getBaseItemLabelVerticalAlignment, getBaseItemLabelVisible, getBorderPaints, getBorderStrokes, getChartArea, getColumnItemBorderPaint, getColumnItemBorderStroke, getColumnItemFillPaint, getColumnItemFillPaintTransformer, getColumnItemLabelDirection, getColumnItemLabelFont, getColumnItemLabelHorizontalAlignment, getColumnItemLabelPaint, getColumnItemLabelPosition, getColumnItemLabelVerticalAlignment, getDataset, getDrawingSupplier, getFillPaints, getItemBorderPaint, getItemBorderStroke, getItemFillPaint, getItemFillPaintHelper, getItemFillPaintTransformer, getItemLabelDirection, getItemLabelFont, getItemLabelHorizontalAlignment, getItemLabelPaint, getItemLabelPosition, getItemLabelVerticalAlignment, getLabelGenerator, getLegendItemCount, getLegendItemLabels, getLegendItemLabelsByColumn, getLegendItemLabelsByRow, getLegendItemShapes, getLegendPositon, getLegendType, getNegativeItemLabelHorizontalAlignment, getNegativeItemLabelVerticalAlignment, getPositiveItemLabelHorizontalAlignment, getPositiveItemLabelVerticalAlignment, getRenderAreaBorderPaint, getRenderAreaBorderStroke, getRowItemBorderPaint, getRowItemBorderStroke, getRowItemFillPaint, getRowItemFillPaintTransformer, getRowItemLabelDirection, getRowItemLabelFont, getRowItemLabelHorizontalAlignment, getRowItemLabelPaint, getRowItemLabelPosition, getRowItemLabelVerticalAlignment, getToolTipGenerator, hasListener, isAutoSelectBorderPaint, isAutoSelectBorderStroke, isAutoSelectFillPaint, isBaseItemDrawBorder, isBaseItemFill, isColumnItemDrawBorder, isColumnItemFill, isColumnItemLabelVisible, isColumnItemVisible, isGeneratorTooltip, isGeneratorUrl, isItemDrawBorder, isItemFill, isItemLabelVisible, isItemVisible, isRenderAreaBorderVisible, isRowItemDrawBorder, isRowItemFill, isRowItemLabelVisible, isRowItemVisible, notifyListeners, removeAllChangeListener, removeChangeListener, setAutoSelectBorderPaint, setAutoSelectBorderStroke, setAutoSelectFillPaint, setBackgroundImage, setBackgroundImageAlignment, setBackgroundImageAlpha, setBackgroundPaint, setBaseItemBorderPaint, setBaseItemBorderStroke, setBaseItemDrawBorder, setBaseItemFill, setBaseItemFillPaint, setBaseItemFillPaintTransformer, setBaseItemLabelDirection, setBaseItemLabelFont, setBaseItemLabelHorizontalAlignment, setBaseItemLabelPaint, setBaseItemLabelPosition, setBaseItemLabelVerticalAlignment, setBaseItemLabelVisible, setChartArea, setColumnItemBorderPaint, setColumnItemBorderStroke, setColumnItemDrawBorder, setColumnItemFill, setColumnItemFillPaint, setColumnItemFillPaintTransformer, setColumnItemLabelDirection, setColumnItemLabelFont, setColumnItemLabelHorizontalAlignment, setColumnItemLabelPaint, setColumnItemLabelPosition, setColumnItemLabelVerticalAlignment, setColumnItemLabelVisible, setColumnItemVisible, setCustomLegendType, setDataset, setDrawingSupplier, setDrawingSupplier, setGeneratorTooltip, setGeneratorUrl, setItemBorderPaint, setItemBorderStroke, setItemDrawBorder, setItemFill, setItemFillPaint, setItemFillPaintTransformer, setItemLabelDirection, setItemLabelFont, setItemLabelHorizontalAlignment, setItemLabelPaint, setItemLabelPosition, setItemLabelVerticalAlignment, setItemLabelVisible, setItemVisible, setLabelGenerator, setLegendPositon, setNegativeItemLabelHorizontalAlignment, setNegativeItemLabelVerticalAlignment, setPositiveItemLabelHorizontalAlignment, setPositiveItemLabelVerticalAlignment, setRenderAreaBorderPaint, setRenderAreaBorderStroke, setRenderAreaBorderVisible, setRowItemBorderPaint, setRowItemBorderStroke, setRowItemDrawBorder, setRowItemFill, setRowItemFillPaint, setRowItemFillPaintTransformer, setRowItemLabelDirection, setRowItemLabelFont, setRowItemLabelHorizontalAlignment, setRowItemLabelPaint, setRowItemLabelPosition, setRowItemLabelVerticalAlignment, setRowItemLabelVisible, setRowItemVisible, setToolTipGenerator
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.ijchart.xychart.render.IRender
addChangeListener, drawBackgroundImage, drawDrawAreaBorder, getBaseItemBorderPaint, getBaseItemBorderStroke, getBaseItemFillPaint, getBaseItemFillPaintTransformer, getBaseItemLabelFont, getBaseItemLabelHorizontalAlignment, getBaseItemLabelPaint, getBaseItemLabelPosition, getBaseItemLabelVerticalAlignment, getBaseItemLabelVisible, getColumnItemBorderPaint, getColumnItemBorderStroke, getColumnItemFillPaint, getColumnItemFillPaintTransformer, getColumnItemLabelFont, getColumnItemLabelHorizontalAlignment, getColumnItemLabelPaint, getColumnItemLabelPosition, getColumnItemLabelVerticalAlignment, getItemBorderPaint, getItemBorderStroke, getItemFillPaint, getItemFillPaintTransformer, getItemLabelFont, getItemLabelHorizontalAlignment, getItemLabelPaint, getItemLabelPosition, getItemLabelVerticalAlignment, getLabelGenerator, getLegendType, getNegativeItemLabelHorizontalAlignment, getNegativeItemLabelVerticalAlignment, getPositiveItemLabelHorizontalAlignment, getPositiveItemLabelVerticalAlignment, getRowItemBorderPaint, getRowItemBorderStroke, getRowItemFillPaint, getRowItemFillPaintTransformer, getRowItemLabelFont, getRowItemLabelHorizontalAlignment, getRowItemLabelPaint, getRowItemLabelPosition, getRowItemLabelVerticalAlignment, getToolTipGenerator, isBaseItemDrawBorder, isBaseItemFill, isColumnItemDrawBorder, isColumnItemFill, isColumnItemLabelVisible, isColumnItemVisible, isItemDrawBorder, isItemFill, isItemLabelVisible, isItemVisible, isRowItemDrawBorder, isRowItemFill, isRowItemLabelVisible, isRowItemVisible, removeAllChangeListener, removeChangeListener, setBaseItemBorderPaint, setBaseItemBorderStroke, setBaseItemDrawBorder, setBaseItemFill, setBaseItemFillPaint, setBaseItemFillPaintTransformer, setBaseItemLabelFont, setBaseItemLabelHorizontalAlignment, setBaseItemLabelPaint, setBaseItemLabelPosition, setBaseItemLabelVerticalAlignment, setBaseItemLabelVisible, setColumnItemBorderPaint, setColumnItemBorderStroke, setColumnItemDrawBorder, setColumnItemFill, setColumnItemFillPaint, setColumnItemFillPaintTransformer, setColumnItemLabelFont, setColumnItemLabelHorizontalAlignment, setColumnItemLabelPaint, setColumnItemLabelPosition, setColumnItemLabelVerticalAlignment, setColumnItemLabelVisible, setColumnItemVisible, setCustomLegendType, setItemBorderPaint, setItemBorderStroke, setItemDrawBorder, setItemFill, setItemFillPaint, setItemFillPaintTransformer, setItemLabelFont, setItemLabelHorizontalAlignment, setItemLabelPaint, setItemLabelPosition, setItemLabelVerticalAlignment, setItemLabelVisible, setItemVisible, setLabelGenerator, setNegativeItemLabelHorizontalAlignment, setNegativeItemLabelVerticalAlignment, setPositiveItemLabelHorizontalAlignment, setPositiveItemLabelVerticalAlignment, setRowItemBorderPaint, setRowItemBorderStroke, setRowItemDrawBorder, setRowItemFill, setRowItemFillPaint, setRowItemFillPaintTransformer, setRowItemLabelFont, setRowItemLabelHorizontalAlignment, setRowItemLabelPaint, setRowItemLabelPosition, setRowItemLabelVerticalAlignment, setRowItemLabelVisible, setRowItemVisible, setToolTipGenerator
 

Field Detail

DEFAULT_INTERIOR_GAP

public static final double DEFAULT_INTERIOR_GAP
The default interior gap.

See Also:
Constant Field Values

DEFAULT_IS_CIRCLE

public static final boolean DEFAULT_IS_CIRCLE
The default flag determining whether to draw an ellipse or a perfect circle.

See Also:
Constant Field Values

MAX_INTERIOR_GAP

public static final double MAX_INTERIOR_GAP
The maximum interior gap.

See Also:
Constant Field Values

DEFAULT_START_ANGLE

public static final double DEFAULT_START_ANGLE
The default starting angle for the pie chart.

See Also:
Constant Field Values

DEFAULT_PIE_ROTATION

public static final Rotation DEFAULT_PIE_ROTATION
The default direction for the pie segments.


DEFAULT_SECTION_OUTLINES_VISIBLE

public static final boolean DEFAULT_SECTION_OUTLINES_VISIBLE
A default flag that controls whether or not an outline is drawn for each section in the render area.

See Also:
Constant Field Values

DEFAULT_SHADOW_X_OFFSET

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

See Also:
Constant Field Values

DEFAULT_SHADOW_Y_OFFSET

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

See Also:
Constant Field Values

DEFAULT_LABEL_BACKGROUND_PAINT

public static final java.awt.Paint DEFAULT_LABEL_BACKGROUND_PAINT
The default section label background paint.


DEFAULT_LABEL_OUTLINE_PAINT

public static final java.awt.Paint DEFAULT_LABEL_OUTLINE_PAINT
The default section label outline paint.


DEFAULT_LABEL_OUTLINE_STROKE

public static final java.awt.Stroke DEFAULT_LABEL_OUTLINE_STROKE
The default section label outline stroke.


DEFAULT_LABEL_SHADOW_PAINT

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


DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW

public static final double DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW
The default minimum arc angle to draw.

See Also:
Constant Field Values

DEFAULT_PIE_SHADOW_PAINT

public static final java.awt.Paint DEFAULT_PIE_SHADOW_PAINT
The default pie shadow paint.


DEFAULT_LABEL_IN_PIE

public static final boolean DEFAULT_LABEL_IN_PIE
A default flag that controls whether or not label in pie.

See Also:
Constant Field Values

DEFAULT_LABEL_PADDING

public static final RectangleInsets DEFAULT_LABEL_PADDING
The default padding between the labels and the label outlines.


DEFAULT_MAXIMUM_LABEL_WIDTH

public static final double DEFAULT_MAXIMUM_LABEL_WIDTH
The default maximum label width as a percentage of the draw area width.

See Also:
Constant Field Values

DEFAULT_LABEL_GAP

public static final double DEFAULT_LABEL_GAP
The default gap between the labels and the render as a percentage of the render area width.

See Also:
Constant Field Values

DEFAULT_LABEL_LINKS_VISIBLE

public static final boolean DEFAULT_LABEL_LINKS_VISIBLE
A default flag that controls whether or not the label links are drawn.

See Also:
Constant Field Values

DEFAULT_LABEL_LINK_MARGIN

public static final double DEFAULT_LABEL_LINK_MARGIN
The default link margin.

See Also:
Constant Field Values

DEFAULT_LABEL_LINK_PAINT

public static final java.awt.Paint DEFAULT_LABEL_LINK_PAINT
The default paint used for the label linking lines.


DEFAULT_LABEL_LINK_STROKE

public static final java.awt.Stroke DEFAULT_LABEL_LINK_STROKE
The default stroke used for the label linking lines.


DEFAULT_SIMPLE_LABELS

public static final boolean DEFAULT_SIMPLE_LABELS
A default flag that controls whether simple or extended labels are used.

See Also:
Constant Field Values

DEFAULT_PIE_IS_3D

public static final boolean DEFAULT_PIE_IS_3D
A default flag that controls whether or not the pie is 3D.

See Also:
Constant Field Values

DEFAULT_DEPTH_3D

public static final double DEFAULT_DEPTH_3D
The default depth of 3D pie.

See Also:
Constant Field Values

DEFAULT_DRAW_AS_RING

public static final boolean DEFAULT_DRAW_AS_RING
A default flag that controls whether or not the shape is ring.

See Also:
Constant Field Values
Constructor Detail

PieRender

public PieRender(SingleRowDataset dataset)
constructor.

Parameters:
dataset - SingleRowDataset The dataset (null not permitted).

PieRender

public PieRender(SingleRowDataset dataset,
                 boolean is3D)
constructor.

Parameters:
dataset - SingleRowDataset The dataset (null not permitted).
is3D - boolean A flag that controls whether or not the pie is 3D.
Method Detail

getInteriorGap

public double getInteriorGap()
Returns the interior gap.

Returns:
double The gap.

setInteriorGap

public void setInteriorGap(double gapSize)
Sets the interior gap and sends a RenderChangeEvent to all registered listeners.

Parameters:
gapSize - double The gap,in interval [0.0,1.0).

isCircular

public boolean isCircular()
Returns the flag determining whether to draw an ellipse or a perfect circle.

Returns:
boolean A boolean.

setCircular

public void setCircular(boolean flag)
Sets the flag determining whether to draw an ellipse or a perfect circle and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getStartAngle

public double getStartAngle()
Returns the starting angle.

Returns:
double The angle.

setStartAngle

public void setStartAngle(double angle)
Sets the starting angle and sends a RenderChangeEvent to all registered listeners.

Parameters:
angle - double The angle.

getPieRotation

public Rotation getPieRotation()
Returns the direction for the pie segments.

Returns:
Rotation The direction.

setPieRotation

public void setPieRotation(Rotation rotation)
Sets the direction for the pie segments and sends a RenderChangeEvent to all registered listeners.

Parameters:
rotation - Rotation The direction (null not permitted).

isSectionOutlinesVisible

public boolean isSectionOutlinesVisible()
Returns the flag that controls whether or not an outline is drawn for each section in the render area.

Returns:
boolean A boolean.

setSectionOutlinesVisible

public void setSectionOutlinesVisible(boolean flag)
Sets the flag that controls whether or not an outline is drawn for each section in the render area and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean

getPieShadowPaint

public java.awt.Paint getPieShadowPaint()
Returns the pie shadow paint.

Returns:
Paint The paint (maybe null).

setPieShadowPaint

public void setPieShadowPaint(java.awt.Paint paint)
Sets the pie shadow paint and sends a RenderChangeEvent to all registered listeners.

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

getShadowXOffset

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

Returns:
double The x-offset.

setShadowXOffset

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

Parameters:
offset - double The x-offset.

getShadowYOffset

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

Returns:
double The y-offset.

setShadowYOffset

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

Parameters:
offset - double The y-offset.

getExplodePercentages

public double getExplodePercentages(int index)
Returns the percentage amount to explode each pie section of the specified data.

Parameters:
index - int The data index in dataset.
Returns:
double The offset.

setExplodePercent

public void setExplodePercent(int index,
                              double percent)
Sets the percentage amount to explode each pie section and sends a RenderChangeEvent to all registered listeners.

Parameters:
index - int The data index in dataset.
percent - double The percent.

getLabelBackgroundPaint

public java.awt.Paint getLabelBackgroundPaint()
Returns the color used to draw the background of the section labels.

Returns:
Paint The paint.

setLabelBackgroundPaint

public void setLabelBackgroundPaint(java.awt.Paint paint)
Sets the color used to draw the background of the section labels and sends a RenderChangeEvent to all registered listeners.

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

getLabelOutlinePaint

public java.awt.Paint getLabelOutlinePaint()
Returns the paint used to draw the outline of the section labels.

Returns:
Paint The paint.

setLabelOutlinePaint

public void setLabelOutlinePaint(java.awt.Paint paint)
Sets the paint used to draw the outline of the section labels and sends a RenderChangeEvent to all registered listeners.

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

getLabelOutlineStroke

public java.awt.Stroke getLabelOutlineStroke()
Returns the stroke used to draw the outline of the section labels.

Returns:
Stroke The stroke.

setLabelOutlineStroke

public void setLabelOutlineStroke(java.awt.Stroke stroke)
Sets the stroke used to draw the outline of the section labels and sends a RenderChangeEvent to all registered listeners.

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

getLabelShadowPaint

public java.awt.Paint getLabelShadowPaint()
Returns the paint used to draw the shadow for the section labels.

Returns:
Paint The paint.

setLabelShadowPaint

public void setLabelShadowPaint(java.awt.Paint paint)
Sets the paint used to draw the shadow for the section labels and sends a RenderChangeEvent to all registered listeners.

Parameters:
paint - Paint

isLabelInPie

public boolean isLabelInPie()
Returns the flag that controls whether or not label in pie.

Returns:
boolean A boolean.

setLabelInPie

public void setLabelInPie(boolean flag)
Sets the flag that controls whether or not label in pie and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getLabelPadding

public RectangleInsets getLabelPadding()
Returns the padding between the labels and the label outlines.

Returns:
RectangleInsets The padding (never null).

setLabelPadding

public void setLabelPadding(RectangleInsets padding)
Sets the padding between the labels and the label outlines and sends a RenderChangeEvent to all registered listeners.

Parameters:
padding - RectangleInsets The padding (null not permitted).

getMaximumLabelWidth

public double getMaximumLabelWidth()
Returns the maximum label width as a percentage of the draw area width.

Returns:
double The width.

setMaximumLabelWidth

public void setMaximumLabelWidth(double maximumWidth)
Sets the maximum label width as a percentage of the draw area width and sends a RenderChangeEvent to all registered listeners.

Parameters:
maximumWidth - double The width and must be >0.

getLabelGap

public double getLabelGap()
Returns the gap between the labels and the draw area as a percentage of the render area width.

Returns:
double The gap.

setLabelGap

public void setLabelGap(double gap)
Sets the gap between the labels and the render area and sends a RenderChangeEvent to all registered listeners.

Parameters:
gap - double double The gap and must be >0.

isLabelLinksVisible

public boolean isLabelLinksVisible()
A flag that controls whether or not the label links are drawn.

Returns:
boolean A boolean.

setLabelLinksVisible

public void setLabelLinksVisible(boolean flag)
Sets whether or not the label links are drawn and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getLabelLinkMargin

public double getLabelLinkMargin()
Returns the link margin.

Returns:
double The margin.

setLabelLinkMargin

public void setLabelLinkMargin(double margin)
Sets the link margin and sends a RenderChangeEvent to all registered listeners.

Parameters:
margin - double The margin and must be >=0.

getLabelLinkPaint

public java.awt.Paint getLabelLinkPaint()
Returns the paint used for the label linking lines.

Returns:
Paint The paint.

setLabelLinkPaint

public void setLabelLinkPaint(java.awt.Paint paint)
Sets the paint used for the label linking lines and sends a RenderChangeEvent to all registered listeners.

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

getLabelLinkStroke

public java.awt.Stroke getLabelLinkStroke()
Returns the stroke used for the label linking lines.

Returns:
Stroke The stroke.

setLabelLinkStroke

public void setLabelLinkStroke(java.awt.Stroke stroke)
Sets the stroke used for the label linking lines and sends a RenderChangeEvent to all registered listeners.

Parameters:
stroke - Stroke The stroke.

isSimpleLabels

public boolean isSimpleLabels()
Returns the flag that controls whether simple or extended labels are used.

Returns:
boolean A boolean.

setSimpleLabels

public void setSimpleLabels(boolean flag)
Sets the flag that controls whether simple or extended labels are used and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getMinimumArcAngleToDraw

public double getMinimumArcAngleToDraw()
Returns the smallest arc angle that will get drawn.

Returns:
double The angle.

setMinimumArcAngleToDraw

public void setMinimumArcAngleToDraw(double angle)
Sets the smallest arc angle that will get drawn and sends a RenderChangeEvent to all registered listeners.

Parameters:
angle - double The angle and must be >=0.

isPie3D

public boolean isPie3D()
Returns whether or not the pie is 3D.

Returns:
boolean A boolean.

setPie3D

public void setPie3D(boolean flag)
Sets the flag that controls whether or not the pie is 3D and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getDepth3D

public double getDepth3D()
Returns the depth of 3D pie.

Returns:
double The depth.

setDepth3D

public void setDepth3D(double depth3D)
Sets the depth of 3D pie and sends a RenderChangeEvent to all registered listeners.

Parameters:
depth3D - double The depth.

isDrawAsRing

public boolean isDrawAsRing()
Returns whether or not the shape is ring.

Returns:
boolean A boolean.

setDrawAsRing

public void setDrawAsRing(boolean flag)
Sets the flag that controls whether or not the shape is ring and sends a RenderChangeEvent to all registered listeners.

Parameters:
flag - boolean A boolean.

getRingLengthFactor

public double getRingLengthFactor()
Returns the length factor.

Returns:
double The length factor.

setRingLengthFactor

public void setRingLengthFactor(double factor)
Sets the length factor and sends a RenderChangeEvent to all registered listeners.

Parameters:
factor - double The length factor,in interval (0,1].

drawAllItems

public void drawAllItems(java.awt.geom.Rectangle2D dataArea,
                         RenderShapeCollection renderShapes,
                         float alpha)
Draws all data items.

Specified by:
drawAllItems in class AbstractNoAxisRender
Parameters:
dataArea - Rectangle2D The chart data area (null not permitted).
renderShapes - RenderShapeCollection Collects information about the render (null not permitted).
alpha - float The alpha transparency (in the range 0.0f to 1.0f, where 0.0f is fully transparent, and 1.0f is fully opaque).

getArcBounds

protected java.awt.geom.Rectangle2D getArcBounds(java.awt.geom.Rectangle2D unexploded,
                                                 double startAngle,
                                                 double extent,
                                                 double explodePercent)
Returns a rectangle that can be used to create a pie section.

Parameters:
unexploded - The area inside which the unexploded pie sections are drawn.
startAngle - The start angle.
extent - The extent of the arc.
explodePercent - The amount by which the pie section is exploded.
Returns:
The rectangle.

createItemShapeOnly

protected IChartShape createItemShapeOnly(java.awt.geom.Rectangle2D rect,
                                          java.lang.String text,
                                          java.lang.Object appendParam)
Create a shape with no attribute specified.

Overrides:
createItemShapeOnly in class AbstractRender
Parameters:
rect - Rectangle2D The bar rectangle (null not permitted).
text - String The text (null permitted).
appendParam - Object The append parameter,used for special propose (null permitted).
Returns:
IChartShape The shape.

drawBackground

public void drawBackground(java.awt.geom.Rectangle2D dataArea,
                           ChartOrientation orientation,
                           RenderShapeCollection renderShapes)
Draws a background for the data area.

Specified by:
drawBackground in interface IRender
Overrides:
drawBackground in class AbstractRender
Parameters:
dataArea - Rectangle2D The chart data area (null not permitted).
orientation - ChartOrientation The chart draw orientation (null not permitted).
renderShapes - RenderShapeCollection Collects information about the render (null not permitted).

getMaximumExplodePercent

public double getMaximumExplodePercent()
Returns the maximum explode percent.

Returns:
double The maximum percent..

drawLabels

protected void drawLabels(double totalValue,
                          java.awt.geom.Rectangle2D dataArea,
                          java.awt.geom.Rectangle2D pieArea,
                          java.awt.geom.Rectangle2D linkArea,
                          RenderShapeCollection renderShapes)
Draws the labels for the pie sections.

Parameters:
totalValue - double The total value of pie dataset.
dataArea - Rectangle2D The data area.
pieArea - Rectangle2D The pie area.
linkArea - Rectangle2D The link area.
renderShapes - RenderShapeCollection Collects information about the render.

drawLeftLabels

protected void drawLeftLabels(java.util.Hashtable leftKeys,
                              java.awt.geom.Rectangle2D dataArea,
                              java.awt.geom.Rectangle2D linkArea,
                              java.awt.geom.Rectangle2D pieArea,
                              RenderShapeCollection renderShapes)
Draws the left labels.

Parameters:
leftKeys - Hashtable A collection of left keys.
dataArea - Rectangle2D The data area.
linkArea - Rectangle2D The link area.
pieArea - Rectangle2D The pie area.
renderShapes - RenderShapeCollection Collects information about the render.

drawRightLabels

protected void drawRightLabels(java.util.Hashtable rightKeys,
                               java.awt.geom.Rectangle2D dataArea,
                               java.awt.geom.Rectangle2D linkArea,
                               java.awt.geom.Rectangle2D pieArea,
                               RenderShapeCollection renderShapes)
Draws the right labels.

Parameters:
rightKeys - Hashtable A collection of left keys.
dataArea - Rectangle2D The data area.
linkArea - Rectangle2D The link area.
pieArea - Rectangle2D The pie area.
renderShapes - RenderShapeCollection Collects information about the render.

equals

public boolean equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.

Overrides:
equals in class AbstractNoAxisRender
Parameters:
obj - the object (null permitted).
Returns:
A boolean.

hashCode

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

Overrides:
hashCode in class AbstractNoAxisRender
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 AbstractNoAxisRender
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 AbstractNoAxisRender
Returns:
a string representation of the object.