|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ijchart.xychart.render.AbstractRender
com.ijchart.xychart.render.noaxis.AbstractNoAxisRender
com.ijchart.xychart.render.noaxis.PieRender
public class PieRender
Title: IJChart
Description: a chart library for the Java(tm) platform.
Draw pie chart shapes.Copyright: Copyright (c) 2013
Company:
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. |
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 java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final double DEFAULT_INTERIOR_GAP
public static final boolean DEFAULT_IS_CIRCLE
public static final double MAX_INTERIOR_GAP
public static final double DEFAULT_START_ANGLE
public static final Rotation DEFAULT_PIE_ROTATION
public static final boolean DEFAULT_SECTION_OUTLINES_VISIBLE
public static final double DEFAULT_SHADOW_X_OFFSET
public static final double DEFAULT_SHADOW_Y_OFFSET
public static final java.awt.Paint DEFAULT_LABEL_BACKGROUND_PAINT
public static final java.awt.Paint DEFAULT_LABEL_OUTLINE_PAINT
public static final java.awt.Stroke DEFAULT_LABEL_OUTLINE_STROKE
public static final java.awt.Paint DEFAULT_LABEL_SHADOW_PAINT
public static final double DEFAULT_MINIMUM_ARC_ANGLE_TO_DRAW
public static final java.awt.Paint DEFAULT_PIE_SHADOW_PAINT
public static final boolean DEFAULT_LABEL_IN_PIE
public static final RectangleInsets DEFAULT_LABEL_PADDING
public static final double DEFAULT_MAXIMUM_LABEL_WIDTH
public static final double DEFAULT_LABEL_GAP
public static final boolean DEFAULT_LABEL_LINKS_VISIBLE
public static final double DEFAULT_LABEL_LINK_MARGIN
public static final java.awt.Paint DEFAULT_LABEL_LINK_PAINT
public static final java.awt.Stroke DEFAULT_LABEL_LINK_STROKE
public static final boolean DEFAULT_SIMPLE_LABELS
public static final boolean DEFAULT_PIE_IS_3D
public static final double DEFAULT_DEPTH_3D
public static final boolean DEFAULT_DRAW_AS_RING
Constructor Detail |
---|
public PieRender(SingleRowDataset dataset)
dataset
- SingleRowDataset
The dataset (null not permitted).public PieRender(SingleRowDataset dataset, boolean is3D)
dataset
- SingleRowDataset
The dataset (null not permitted).is3D
- boolean
A flag that controls whether or not the pie is 3D.Method Detail |
---|
public double getInteriorGap()
public void setInteriorGap(double gapSize)
RenderChangeEvent
to all registered listeners.
gapSize
- double
The gap,in interval [0.0,1.0).public boolean isCircular()
public void setCircular(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public double getStartAngle()
public void setStartAngle(double angle)
RenderChangeEvent
to all registered listeners.
angle
- double
The angle.public Rotation getPieRotation()
public void setPieRotation(Rotation rotation)
RenderChangeEvent
to all registered listeners.
rotation
- Rotation
The direction (null not permitted).public boolean isSectionOutlinesVisible()
public void setSectionOutlinesVisible(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- booleanpublic java.awt.Paint getPieShadowPaint()
public void setPieShadowPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null permitted).public double getShadowXOffset()
public void setShadowXOffset(double offset)
RenderChangeEvent
to all registered listeners.
offset
- double
The x-offset.public double getShadowYOffset()
public void setShadowYOffset(double offset)
RenderChangeEvent
to all registered listeners.
offset
- double
The y-offset.public double getExplodePercentages(int index)
index
- int
The data index in dataset.
public void setExplodePercent(int index, double percent)
RenderChangeEvent
to all registered listeners.
index
- int
The data index in dataset.percent
- double
The percent.public java.awt.Paint getLabelBackgroundPaint()
public void setLabelBackgroundPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null permitted).public java.awt.Paint getLabelOutlinePaint()
public void setLabelOutlinePaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null permitted).public java.awt.Stroke getLabelOutlineStroke()
public void setLabelOutlineStroke(java.awt.Stroke stroke)
RenderChangeEvent
to all registered listeners.
stroke
- Stroke
The stroke (null permitted).public java.awt.Paint getLabelShadowPaint()
public void setLabelShadowPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paintpublic boolean isLabelInPie()
public void setLabelInPie(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public RectangleInsets getLabelPadding()
public void setLabelPadding(RectangleInsets padding)
RenderChangeEvent
to all registered listeners.
padding
- RectangleInsets
The padding (null not permitted).public double getMaximumLabelWidth()
public void setMaximumLabelWidth(double maximumWidth)
RenderChangeEvent
to all registered listeners.
maximumWidth
- double
The width and must be >0.public double getLabelGap()
public void setLabelGap(double gap)
RenderChangeEvent
to all registered listeners.
gap
- double double
The gap and must be >0.public boolean isLabelLinksVisible()
public void setLabelLinksVisible(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public double getLabelLinkMargin()
public void setLabelLinkMargin(double margin)
RenderChangeEvent
to all registered listeners.
margin
- double
The margin and must be >=0.public java.awt.Paint getLabelLinkPaint()
public void setLabelLinkPaint(java.awt.Paint paint)
RenderChangeEvent
to all registered listeners.
paint
- Paint
The paint (null not permitted).public java.awt.Stroke getLabelLinkStroke()
public void setLabelLinkStroke(java.awt.Stroke stroke)
RenderChangeEvent
to all registered listeners.
stroke
- Stroke
The stroke.public boolean isSimpleLabels()
public void setSimpleLabels(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public double getMinimumArcAngleToDraw()
public void setMinimumArcAngleToDraw(double angle)
RenderChangeEvent
to all registered listeners.
angle
- double
The angle and must be >=0.public boolean isPie3D()
public void setPie3D(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public double getDepth3D()
public void setDepth3D(double depth3D)
RenderChangeEvent
to all registered listeners.
depth3D
- double
The depth.public boolean isDrawAsRing()
public void setDrawAsRing(boolean flag)
RenderChangeEvent
to all registered listeners.
flag
- boolean
A boolean.public double getRingLengthFactor()
public void setRingLengthFactor(double factor)
RenderChangeEvent
to all registered listeners.
factor
- double
The length factor,in interval (0,1].public void drawAllItems(java.awt.geom.Rectangle2D dataArea, RenderShapeCollection renderShapes, float alpha)
drawAllItems
in class AbstractNoAxisRender
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).protected java.awt.geom.Rectangle2D getArcBounds(java.awt.geom.Rectangle2D unexploded, double startAngle, double extent, double explodePercent)
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.
protected IChartShape createItemShapeOnly(java.awt.geom.Rectangle2D rect, java.lang.String text, java.lang.Object appendParam)
createItemShapeOnly
in class AbstractRender
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).
public void drawBackground(java.awt.geom.Rectangle2D dataArea, ChartOrientation orientation, RenderShapeCollection renderShapes)
drawBackground
in interface IRender
drawBackground
in class AbstractRender
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).public double getMaximumExplodePercent()
protected void drawLabels(double totalValue, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D pieArea, java.awt.geom.Rectangle2D linkArea, RenderShapeCollection renderShapes)
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.protected void drawLeftLabels(java.util.Hashtable leftKeys, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D linkArea, java.awt.geom.Rectangle2D pieArea, RenderShapeCollection renderShapes)
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.protected void drawRightLabels(java.util.Hashtable rightKeys, java.awt.geom.Rectangle2D dataArea, java.awt.geom.Rectangle2D linkArea, java.awt.geom.Rectangle2D pieArea, RenderShapeCollection renderShapes)
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.public boolean equals(java.lang.Object obj)
equals
in class AbstractNoAxisRender
obj
- the object (null permitted).
public int hashCode()
hashCode
in class AbstractNoAxisRender
public java.lang.Object clone() throws java.lang.CloneNotSupportedException
clone
in class AbstractNoAxisRender
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.public java.lang.String toString()
toString
in class AbstractNoAxisRender
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |