JIDE 3.5.15

com.jidesoft.chart.render
Class Pie3DRenderer

java.lang.Object
  extended by com.jidesoft.chart.render.AbstractRenderer
      extended by com.jidesoft.chart.render.AbstractPieSegmentRenderer
          extended by com.jidesoft.chart.render.Pie3DRenderer
All Implemented Interfaces:
PieSegmentRenderer, PieSegmentRenderer2D

public class Pie3DRenderer
extends AbstractPieSegmentRenderer
implements PieSegmentRenderer2D

A 3D Pie chart renderer

Author:
Simon White (swhite@catalysoft.com)

Field Summary
 
Fields inherited from class com.jidesoft.chart.render.AbstractPieSegmentRenderer
maxExplode, PROPERTY_ALWAYS_SHOW_OUTLINES, PROPERTY_PIE_LABEL_RENDERER, PROPERTY_POINT_LABELER, PROPERTY_TICK_LENGTH
 
Fields inherited from class com.jidesoft.chart.render.AbstractRenderer
alwaysShowOutlines, PROPERTY_OUTLINE_WIDTH, ROLLOVER_INTENSITY, support
 
Constructor Summary
Pie3DRenderer()
           
 
Method Summary
 float[] getSpotlightRatios()
          Get the three spotlight ratio values
 float getThicknessRatio()
          Returns the thickness of the pie chart as a ratio of the pie diameter
protected  void renderOutlines(boolean isForSelection, Graphics2D g2d, Chart chart, ChartModel model, Point center, int w, int h, int[] angles, ChartStyle style)
          Renders the outlines for a 3d pie chart, only when rollover is activated
protected  void renderOutlines2D(boolean isForSelection, Graphics2D g2d, Chart chart, ChartModel model, Point2D center, int w, int h, float[] angles, ChartStyle style)
           
 void renderSegments(Graphics2D g2d, Chart chart, ChartModel m, Point2D center, float radius, float[] angles)
          The method for rendering segments onto the supplied graphics context
 void renderSegments(Graphics g, Chart chart, ChartModel m, Point center, int radius, int[] angles)
          The method for rendering segments onto the supplied graphics context
 void setSpotlightRatios(float[] ratios)
          Set four brightness ratios used to apply to colours on the main surface of the pie chart to give a spotlight effect.
 void setThicknessRatio(float thicknessRatio)
          Specify the thickness of the pie chart as a ratio of the pie diameter.
 
Methods inherited from class com.jidesoft.chart.render.AbstractPieSegmentRenderer
clearShapes, containingSegment, createSegmentPaint, getLabelGraphics, getPieLabelRenderer, getPointLabeler, getTickLength, modify, recordSegment, rendered, renderLabels, renderOutlines, renderOutlines2D, setLabelGraphics, setPieLabelRenderer, setPointLabeler, setTickLength
 
Methods inherited from class com.jidesoft.chart.render.AbstractRenderer
addPropertyChangeListener, getOutlineColor, getOutlineWidth, getSelectionColor, isAlwaysShowOutlines, removePropertyChangeListener, setAlwaysShowOutlines, setOutlineColor, setOutlineWidth, setSelectionColor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.jidesoft.chart.render.PieSegmentRenderer
clearShapes, containingSegment, getPieLabelRenderer, getPointLabeler, getTickLength, setLabelGraphics, setPointLabeler, setTickLength
 

Constructor Detail

Pie3DRenderer

public Pie3DRenderer()
Method Detail

getThicknessRatio

public float getThicknessRatio()
Returns the thickness of the pie chart as a ratio of the pie diameter

Returns:
the thickness of the pie chart as a ratio of the pie diameter

setThicknessRatio

public void setThicknessRatio(float thicknessRatio)
Specify the thickness of the pie chart as a ratio of the pie diameter. By default, this has a value of 0.2

Parameters:
thicknessRatio - the thickness of the pie chart as a ratio of the pie diameter

getSpotlightRatios

public float[] getSpotlightRatios()
Get the three spotlight ratio values

Returns:
an array of 4 floats used for the spotlight colour ratio values

setSpotlightRatios

public void setSpotlightRatios(float[] ratios)
Set four brightness ratios used to apply to colours on the main surface of the pie chart to give a spotlight effect. A ratio of 0.5 leaves the input color unchanged, larger values make the color brighter and smaller values make the color dimmer. The default value is {0.48f, 0.49f, 0.5f, 0.53f}

Parameters:
ratios - the new brightness ratios

renderSegments

public void renderSegments(Graphics2D g2d,
                           Chart chart,
                           ChartModel m,
                           Point2D center,
                           float radius,
                           float[] angles)
Description copied from interface: PieSegmentRenderer2D
The method for rendering segments onto the supplied graphics context

Specified by:
renderSegments in interface PieSegmentRenderer2D
Parameters:
g2d - the Graphics2D context
chart - the chart
m - the model of interest
center - the center point (in pixel coordinates) of the rendered area
radius - the radius of the pie chart (in pixels)
angles - the angles (in degrees) of the respective segments of the model

renderSegments

public void renderSegments(Graphics g,
                           Chart chart,
                           ChartModel m,
                           Point center,
                           int radius,
                           int[] angles)
The method for rendering segments onto the supplied graphics context

Specified by:
renderSegments in interface PieSegmentRenderer
Parameters:
g - the Graphics context
chart - the chart
m - the model of interest
center - the center point (in pixel coordinates) of the rendered area
radius - the radius of the pie chart (in pixels)
angles - the angles (in degrees) of the respective segments of the model

renderOutlines

protected void renderOutlines(boolean isForSelection,
                              Graphics2D g2d,
                              Chart chart,
                              ChartModel model,
                              Point center,
                              int w,
                              int h,
                              int[] angles,
                              ChartStyle style)
Renders the outlines for a 3d pie chart, only when rollover is activated

Parameters:
isForSelection - there are two reasons or modes in which this method is invoked: one is for rendering outlines because it has been specified that outlines should always be displayed; and the other is for rendering an outline because it has been selected. If we call this method for the latter reason, this parameter is true.
g2d - the graphics context
chart - the chart component
model - the chart model for which we are rendering outlines
center - the center of the ellipse for which this is a segment
w - the width of the ellipse
h - the height of the ellipse
angles - an array of angles
style - style hints for the display (currently unused)

renderOutlines2D

protected void renderOutlines2D(boolean isForSelection,
                                Graphics2D g2d,
                                Chart chart,
                                ChartModel model,
                                Point2D center,
                                int w,
                                int h,
                                float[] angles,
                                ChartStyle style)

JIDE 3.5.15