Package org.jfree.chart.plot
Class PieLabelRecord
java.lang.Object
org.jfree.chart.plot.PieLabelRecord
- All Implemented Interfaces:
Serializable,Comparable
A structure that retains information about the label for a section in a pie
chart.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPieLabelRecord(Comparable key, double angle, double baseY, TextBox label, double labelHeight, double gap, double linkPercent) Creates a new record. -
Method Summary
Modifier and TypeMethodDescriptionintCompares this object to an arbitrary object.booleanTests this record for equality with an arbitrary object.doubleReturns the allocated y-coordinate.doublegetAngle()Returns the angle of the middle of the section, in radians.doublegetBaseY()Returns the base y-coordinate.doublegetGap()Returns the gap.getKey()Returns the key for the section that the label applies to.getLabel()Returns the label.doubleReturns the label height (you could derive this from the label itself, but we cache the value so it can be retrieved quickly).doubleReturns the link percent.doubleReturns the lower bound of the label.doubleReturns the upper bound of the label.voidsetAllocatedY(double y) Sets the allocated y-coordinate.voidsetBaseY(double base) Sets the base y-coordinate.toString()Returns a string describing the object.
-
Constructor Details
-
PieLabelRecord
public PieLabelRecord(Comparable key, double angle, double baseY, TextBox label, double labelHeight, double gap, double linkPercent) Creates a new record.- Parameters:
key- the section key.angle- the angle to the middle of the section (in radians).baseY- the base y-coordinate.label- the section label.labelHeight- the label height (in Java2D units).gap- the offset to the left.linkPercent- the link percent.
-
-
Method Details
-
getBaseY
Returns the base y-coordinate. This is where the label will appear if there is no overlapping of labels.- Returns:
- The base y-coordinate.
-
setBaseY
Sets the base y-coordinate.- Parameters:
base- the base y-coordinate.
-
getLowerY
Returns the lower bound of the label.- Returns:
- The lower bound.
-
getUpperY
Returns the upper bound of the label.- Returns:
- The upper bound.
-
getAngle
Returns the angle of the middle of the section, in radians.- Returns:
- The angle, in radians.
-
getKey
Returns the key for the section that the label applies to.- Returns:
- The key.
-
getLabel
Returns the label.- Returns:
- The label.
-
getLabelHeight
Returns the label height (you could derive this from the label itself, but we cache the value so it can be retrieved quickly).- Returns:
- The label height (in Java2D units).
-
getAllocatedY
Returns the allocated y-coordinate.- Returns:
- The allocated y-coordinate.
-
setAllocatedY
Sets the allocated y-coordinate.- Parameters:
y- the y-coordinate.
-
getGap
Returns the gap.- Returns:
- The gap.
-
getLinkPercent
Returns the link percent.- Returns:
- The link percent.
-
compareTo
Compares this object to an arbitrary object.- Specified by:
compareToin interfaceComparable- Parameters:
obj- the object to compare against.- Returns:
- An integer that specifies the relative order of the two objects.
-
equals
Tests this record for equality with an arbitrary object. -
toString
Returns a string describing the object. This is used for debugging only.
-