lt.monarch.chart.chart2D.series
Class PieSliceLabelEntry

java.lang.Object
  extended by lt.monarch.chart.text.TextPainter
      extended by lt.monarch.chart.text.RotatedLabelPainter
          extended by lt.monarch.chart.text.LabelTextPainter
              extended by lt.monarch.chart.chart2D.series.PieSliceLabelEntry
All Implemented Interfaces:
java.io.Serializable, AbstractTextPainter
Direct Known Subclasses:
Pie3DSliceLabelEntry

public class PieSliceLabelEntry
extends LabelTextPainter

Defines label of pie chart slices

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  double explode
           
protected  java.awt.FontMetrics fmetrics
           
protected  double halfAngle
           
protected  java.awt.Image image
           
protected  double imageMargin
           
protected  double inner
           
protected  Rectangle2D labelPosition
           
protected  double lmargin
           
protected  double radius
           
protected  double rotate
           
protected  double sliceAngle
           
protected  double startAngle
           
 
Fields inherited from class lt.monarch.chart.text.TextPainter
boundingBox, hAlignment, text, vAlignment, xMargin, yMargin
 
Constructor Summary
Constructor and Description
PieSliceLabelEntry()
          Constructor the PieSliceLabelEntry
PieSliceLabelEntry(java.lang.String s, double radius, double explode, double inner, double startAngle, double sliceAngle, Point2D center, java.awt.FontMetrics fm, double margin)
          Constructor the PieSliceLabelEntry
 
Method Summary
Modifier and Type Method and Description
 double getAngle()
          Returns outer angle of pie chart segment
 Point2D getCenter()
          Return pie center point
 double getExplodeRadius()
          Returns pie slice explode radius.
 java.awt.FontMetrics getFontMetrics()
          Return font metrics of label
 Area getFullArea()
           
 java.awt.Dimension getFullSize()
          Get full size of label (calculates with setted font metrics)
 double getHalfAngle()
          Return pie slices half angles
 int getIndex()
           
 double getInner()
          Returns inner radius
 Rectangle2D getLabelPosition()
          Return position of label
 Polygon2D getLine()
          Get straight or elbow lines of slices
 double getPieMargin()
          Return pie margin
 Rectangle2D getPreferredBounds(java.awt.FontMetrics fm)
          Preferred bounds are enough to paint full label.
 double getRadius()
          Returns section radius
 double getRotate()
          Get rotate angle of label
 ChartElementEntity getSliceLabelConnectorEntity(AbstractChartSeries<?,?> series, Rectangle2D bounds, PaintStyle<?> paintStyle)
           
 ChartElementEntity getSliceLabelEntity(AbstractChartSeries<?,?> series, Rectangle2D bounds, PaintStyle<?> paintStyle, TextStyle<?> textStyle)
           
 double getStartAngle()
          Returns slice start angle of pie chart segment
 boolean isOutsideLabel()
          Returns is outside label or not.
 void paint(AbstractGraphics g, Rectangle2D r)
          Paints text (possibly rotated) into specified rectangle using provided graphics context.
 void refreshSliceLabelEntry(java.lang.String s, double radius, double explode, double inner, double startAngle, double sliceAngle, Point2D center, java.awt.FontMetrics fm, double margin, java.awt.Image image)
          Refreshes the PieSliceLabelEntry values
 void setIndex(int index)
           
 void setLabelPosition(Rectangle2D position)
          Set label position
 void setLine(Polygon2D line)
          Set straight or elbow lines of slices
 void setOutsideLabel(boolean outsideLabel)
          Sets is outside label or not.
 void setRotate(double rotate)
          Set rotate angle of label
 
Methods inherited from class lt.monarch.chart.text.LabelTextPainter
findBounds, getFullArea, getFullSize, getRelativePosition, getRotationAngle, getRotationPoint, setRelativePosition, setRotationAngle, setRotationPoint, setText
 
Methods inherited from class lt.monarch.chart.text.TextPainter
dispose, getBounds, getHorizontalAlignment, getHorizontalMargin, getMarginInPixels, getMinimumHeight, getMinimumSize, getMinimumSize, getText, getVerticalAlignment, getVerticalMargin, getWrappingEnabled, setHorizontalAlignment, setHorizontalMargin, setMargin, setText, setVerticalAlignment, setVerticalMargin, setWrappingEnabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

radius

protected double radius

explode

protected double explode

inner

protected double inner

startAngle

protected double startAngle

halfAngle

protected double halfAngle

sliceAngle

protected double sliceAngle

rotate

protected double rotate

labelPosition

protected Rectangle2D labelPosition

fmetrics

protected java.awt.FontMetrics fmetrics

lmargin

protected double lmargin

image

protected java.awt.Image image

imageMargin

protected double imageMargin
Constructor Detail

PieSliceLabelEntry

public PieSliceLabelEntry(java.lang.String s,
                          double radius,
                          double explode,
                          double inner,
                          double startAngle,
                          double sliceAngle,
                          Point2D center,
                          java.awt.FontMetrics fm,
                          double margin)
Constructor the PieSliceLabelEntry

Parameters:
s - text of label
radius - radius of slices
explode - explode of slice
inner - inner radius of slice
startAngle - start angle of slice
sliceAngle - angle of slice
center - center of pie
fm - font metrics of label
margin - margin of label

PieSliceLabelEntry

public PieSliceLabelEntry()
Constructor the PieSliceLabelEntry

Method Detail

refreshSliceLabelEntry

public void refreshSliceLabelEntry(java.lang.String s,
                                   double radius,
                                   double explode,
                                   double inner,
                                   double startAngle,
                                   double sliceAngle,
                                   Point2D center,
                                   java.awt.FontMetrics fm,
                                   double margin,
                                   java.awt.Image image)
Refreshes the PieSliceLabelEntry values

Parameters:
s - text of label
radius - radius of slices
explode - explode of slice
inner - inner radius of slice
startAngle - start angle of slice
sliceAngle - angle of slice
center - center of pie
fm - font metrics of label
margin - margin of label
image - image of label

getHalfAngle

public double getHalfAngle()
Return pie slices half angles

Returns:
half angle of slice

getExplodeRadius

public double getExplodeRadius()
Returns pie slice explode radius.

Returns:
pie explode radius.

getStartAngle

public double getStartAngle()
Returns slice start angle of pie chart segment

Returns:
startAngle

getRadius

public double getRadius()
Returns section radius

Returns:
slice radius.

getAngle

public double getAngle()
Returns outer angle of pie chart segment

Returns:
outer angle

getCenter

public Point2D getCenter()
Return pie center point

Returns:
center of pie

getInner

public double getInner()
Returns inner radius

Returns:
slice inner radius.

getFontMetrics

public java.awt.FontMetrics getFontMetrics()
Return font metrics of label

Returns:
label font metrics

getPieMargin

public double getPieMargin()
Return pie margin

Returns:
pie margin

getLine

public Polygon2D getLine()
Get straight or elbow lines of slices

Returns:
straight or elbow polygons of slices

setLine

public void setLine(Polygon2D line)
Set straight or elbow lines of slices

Parameters:
straight - or elbow polygons of slices

getRotate

public double getRotate()
Get rotate angle of label

Returns:
the rotate

setRotate

public void setRotate(double rotate)
Set rotate angle of label

Parameters:
rotate - the rotate to set

setLabelPosition

public void setLabelPosition(Rectangle2D position)
Set label position

Parameters:
position - label position

getLabelPosition

public Rectangle2D getLabelPosition()
Return position of label

Returns:
position of label

getIndex

public int getIndex()

setIndex

public void setIndex(int index)

getSliceLabelEntity

public ChartElementEntity getSliceLabelEntity(AbstractChartSeries<?,?> series,
                                              Rectangle2D bounds,
                                              PaintStyle<?> paintStyle,
                                              TextStyle<?> textStyle)

getSliceLabelConnectorEntity

public ChartElementEntity getSliceLabelConnectorEntity(AbstractChartSeries<?,?> series,
                                                       Rectangle2D bounds,
                                                       PaintStyle<?> paintStyle)

getFullSize

public java.awt.Dimension getFullSize()
Get full size of label (calculates with setted font metrics)

Returns:
full size dimensions

getPreferredBounds

public Rectangle2D getPreferredBounds(java.awt.FontMetrics fm)
Description copied from class: LabelTextPainter
Preferred bounds are enough to paint full label. Matters only if rotation point is set. Otherwise use the getFullSize method to get size of label.

Overrides:
getPreferredBounds in class LabelTextPainter
Parameters:
fm - FontMetrics
Returns:
preferred bounds or null if rotation point is not set

paint

public void paint(AbstractGraphics g,
                  Rectangle2D r)
Description copied from class: LabelTextPainter
Paints text (possibly rotated) into specified rectangle using provided graphics context.

Specified by:
paint in interface AbstractTextPainter
Overrides:
paint in class LabelTextPainter
Parameters:
g - current graphics context
r - rectangle where text is painted.

setOutsideLabel

public void setOutsideLabel(boolean outsideLabel)
Sets is outside label or not.

Parameters:
outsideLabel - the outsideLabel to set

isOutsideLabel

public boolean isOutsideLabel()
Returns is outside label or not.

Returns:
the outsideLabel

getFullArea

public Area getFullArea()