Package org.jfree.chart.plot
Class AbstractPieLabelDistributor
java.lang.Object
org.jfree.chart.plot.AbstractPieLabelDistributor
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
PieLabelDistributor
A base class for handling the distribution of pie section labels. Create
your own subclass and set it using the
PiePlot.setLabelDistributor(AbstractPieLabelDistributor) method
if you want to customise the label distribution.- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPieLabelRecord(PieLabelRecord record) Adds a label record.voidclear()Clears the list of labels.abstract voiddistributeLabels(double minY, double height) Called by thePiePlotclass.intReturns the number of items in the list.getPieLabelRecord(int index) Returns a label record from the list.
-
Field Details
-
labels
The label records.
-
-
Constructor Details
-
AbstractPieLabelDistributor
public AbstractPieLabelDistributor()Creates a new instance.
-
-
Method Details
-
getPieLabelRecord
Returns a label record from the list.- Parameters:
index- the index.- Returns:
- The label record.
-
addPieLabelRecord
Adds a label record.- Parameters:
record- the label record (nullnot permitted).
-
getItemCount
Returns the number of items in the list.- Returns:
- The item count.
-
clear
Clears the list of labels. -
distributeLabels
Called by thePiePlotclass. Implementations should distribute the labels in this.labels then return.- Parameters:
minY- the y-coordinate for the top of the label area.height- the height of the label area.
-