lt.monarch.chart.chart2D.series
Class AbstractPieLabelsLayouter

java.lang.Object
  extended by lt.monarch.chart.chart2D.series.AbstractPieLabelsLayouter
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
PieLabelsInsideLayouter, PieLabelsOutsideLayouter

public abstract class AbstractPieLabelsLayouter
extends java.lang.Object
implements java.io.Serializable

Abstract pie labels layouter class. It defines what methods the pie labels layouter should implement and implements common methods for all layouter in it.

See Also:
Serialized Form

Field Summary
Modifier and Type Field and Description
protected  PieLabelAlignment labelAlignment
           
protected  java.util.List<PieSliceLabelEntry> pieLabelList
           
 
Constructor Summary
Constructor and Description
AbstractPieLabelsLayouter()
           
 
Method Summary
Modifier and Type Method and Description
protected  Point2D calculateLabelPosition(double radius, double angle, Point2D center)
          Calculate label position in pie charts
 PieLabelAlignment getPieLabelAlignment()
          Gets alignment type of pie labels
protected  boolean isPieDifficult()
          If labels angle is smaller minAngle, than pie is difficult
abstract  void layout(java.util.List<PieSliceLabelEntry> labelList, Projector projector)
           
 void setPieLabelAlignment(PieLabelAlignment alignment)
          Sets alignment type of pie labels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pieLabelList

protected java.util.List<PieSliceLabelEntry> pieLabelList

labelAlignment

protected PieLabelAlignment labelAlignment
Constructor Detail

AbstractPieLabelsLayouter

public AbstractPieLabelsLayouter()
Method Detail

setPieLabelAlignment

public void setPieLabelAlignment(PieLabelAlignment alignment)
Sets alignment type of pie labels

Parameters:
alignment - alignment type

getPieLabelAlignment

public PieLabelAlignment getPieLabelAlignment()
Gets alignment type of pie labels

Returns:
alignment type

calculateLabelPosition

protected Point2D calculateLabelPosition(double radius,
                                         double angle,
                                         Point2D center)
Calculate label position in pie charts

Parameters:
radius - radius of pie
angle - angle of slice
center - point of the pie
Returns:
calculated point

isPieDifficult

protected boolean isPieDifficult()
If labels angle is smaller minAngle, than pie is difficult

Returns:
true, if pie is difficult

layout

public abstract void layout(java.util.List<PieSliceLabelEntry> labelList,
                            Projector projector)
Parameters:
labelList - list of labels
projector - projector of charts