|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jidesoft.chart.render.AbstractRenderer com.jidesoft.chart.render.AbstractPieSegmentRenderer
public abstract class AbstractPieSegmentRenderer
The abstract pie segment renderer provides a method that renders labels that can be reused across different segment renderers.
Field Summary | |
---|---|
static double |
maxExplode
|
static String |
PROPERTY_ALWAYS_SHOW_OUTLINES
|
static String |
PROPERTY_PIE_LABEL_RENDERER
|
static String |
PROPERTY_POINT_LABELER
|
static String |
PROPERTY_TICK_LENGTH
|
Fields inherited from class com.jidesoft.chart.render.AbstractRenderer |
---|
alwaysShowOutlines, PROPERTY_OUTLINE_WIDTH, ROLLOVER_INTENSITY, support |
Constructor Summary | |
---|---|
AbstractPieSegmentRenderer()
Constructor. |
Method Summary | |
---|---|
void |
clearShapes()
Clear the cache of rendered shapes |
PointDescriptor |
containingSegment(Point p)
Finds the segment of the pie chart that contains the point (x, y) if any. |
protected Paint |
createSegmentPaint(Chart chart,
Chartable p,
ChartStyle style,
boolean isSelected,
boolean hasRollover,
Shape shape)
You can override this method to create a custom Paint that uses the dimensions of the pie segment |
Graphics |
getLabelGraphics()
|
PieLabelRenderer |
getPieLabelRenderer()
Determines how to render the labels |
PointLabeler |
getPointLabeler()
|
int |
getTickLength()
|
protected TexturePaint |
modify(TexturePaint p)
|
protected void |
recordSegment(Shape shape,
PointDescriptor source)
|
PointDescriptor |
rendered(Chartable c)
The PointDescriptor is a representation of the point in the model |
void |
renderLabels(Graphics g,
Chart chart,
ChartModel model,
Point center,
int width,
int height,
int[] angles,
ChartStyle style)
Render the labels of the specified ChartModel on to the Chart using the given Graphics context |
protected void |
renderOutlines(boolean isForSelection,
Graphics2D g2d,
Chart chart,
ChartModel model,
Point center,
int radius,
int[] angles,
ChartStyle style)
Render the outlines of segments for a circular renderer |
protected void |
renderOutlines2D(boolean isForSelection,
Graphics2D g2d,
Chart chart,
ChartModel model,
Point2D center,
float radius,
float[] angles,
ChartStyle style)
|
void |
setLabelGraphics(Graphics g)
Allow the users of the renderer to specify a different graphics context for the pie segment labels |
void |
setPieLabelRenderer(PieLabelRenderer newLabelRenderer)
|
void |
setPointLabeler(PointLabeler pointLabeler)
Set the point labeler, which is used to customize the strings displayed as labels |
void |
setTickLength(int tickLength)
Set the length of the ticks used for each segment |
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 |
---|
renderSegments |
Field Detail |
---|
public static final String PROPERTY_ALWAYS_SHOW_OUTLINES
public static final String PROPERTY_PIE_LABEL_RENDERER
public static final String PROPERTY_POINT_LABELER
public static final String PROPERTY_TICK_LENGTH
public static final double maxExplode
Constructor Detail |
---|
public AbstractPieSegmentRenderer()
Method Detail |
---|
public void clearShapes()
clearShapes
in interface PieSegmentRenderer
protected void recordSegment(Shape shape, PointDescriptor source)
public Graphics getLabelGraphics()
public void setLabelGraphics(Graphics g)
setLabelGraphics
in interface PieSegmentRenderer
g
- the graphics context for the pie segment labelspublic int getTickLength()
getTickLength
in interface PieSegmentRenderer
public void setTickLength(int tickLength)
setTickLength
in interface PieSegmentRenderer
tickLength
- the length of ticks in pixelspublic PointLabeler getPointLabeler()
getPointLabeler
in interface PieSegmentRenderer
public void setPointLabeler(PointLabeler pointLabeler)
setPointLabeler
in interface PieSegmentRenderer
pointLabeler
- the labeler objectpublic PieLabelRenderer getPieLabelRenderer()
PieSegmentRenderer
getPieLabelRenderer
in interface PieSegmentRenderer
public void setPieLabelRenderer(PieLabelRenderer newLabelRenderer)
protected Paint createSegmentPaint(Chart chart, Chartable p, ChartStyle style, boolean isSelected, boolean hasRollover, Shape shape)
public void renderLabels(Graphics g, Chart chart, ChartModel model, Point center, int width, int height, int[] angles, ChartStyle style)
public PointDescriptor containingSegment(Point p)
containingSegment
in interface PieSegmentRenderer
p
- the point in pixel coordinates
public PointDescriptor rendered(Chartable c)
c
- the point in the model
protected void renderOutlines(boolean isForSelection, Graphics2D g2d, Chart chart, ChartModel model, Point center, int radius, int[] angles, ChartStyle style)
g2d
- the graphics contextchart
- the chart componentmodel
- the model for which the angles have been calculatedcenter
- the centre of the chartradius
- the radius of the chartangles
- the consecutive (extent) angles of the segmentsstyle
- the suggested style to use for rendering the segmentsprotected void renderOutlines2D(boolean isForSelection, Graphics2D g2d, Chart chart, ChartModel model, Point2D center, float radius, float[] angles, ChartStyle style)
protected TexturePaint modify(TexturePaint p)
|
JIDE 3.5.15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |