Package org.jfree.chart.labels
Class ItemLabelPosition
java.lang.Object
org.jfree.chart.labels.ItemLabelPosition
- All Implemented Interfaces:
Serializable
The attributes that control the position of the label for each data item on
a chart. Instances of this class are immutable.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate double
The rotation angle.private ItemLabelAnchor
The item label anchor point.private org.jfree.ui.TextAnchor
The rotation anchor.private static final long
For serialization.private org.jfree.ui.TextAnchor
The text anchor. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a new position record with default settings.ItemLabelPosition
(ItemLabelAnchor itemLabelAnchor, org.jfree.ui.TextAnchor textAnchor) Creates a new position record (with zero rotation).ItemLabelPosition
(ItemLabelAnchor itemLabelAnchor, org.jfree.ui.TextAnchor textAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle) Creates a new position record. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this object for equality with an arbitrary object.double
getAngle()
Returns the angle of rotation for the label.Returns the item label anchor.org.jfree.ui.TextAnchor
Returns the rotation anchor point.org.jfree.ui.TextAnchor
Returns the text anchor.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
itemLabelAnchor
The item label anchor point. -
textAnchor
private org.jfree.ui.TextAnchor textAnchorThe text anchor. -
rotationAnchor
private org.jfree.ui.TextAnchor rotationAnchorThe rotation anchor. -
angle
private double angleThe rotation angle.
-
-
Constructor Details
-
ItemLabelPosition
public ItemLabelPosition()Creates a new position record with default settings. -
ItemLabelPosition
Creates a new position record (with zero rotation).- Parameters:
itemLabelAnchor
- the item label anchor (null
not permitted).textAnchor
- the text anchor (null
not permitted).
-
ItemLabelPosition
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, org.jfree.ui.TextAnchor textAnchor, org.jfree.ui.TextAnchor rotationAnchor, double angle) Creates a new position record. The item label anchor is a point relative to the data item (dot, bar or other visual item) on a chart. The item label is aligned by aligning the text anchor with the item label anchor.- Parameters:
itemLabelAnchor
- the item label anchor (null
not permitted).textAnchor
- the text anchor (null
not permitted).rotationAnchor
- the rotation anchor (null
not permitted).angle
- the rotation angle (in radians).
-
-
Method Details
-
getItemLabelAnchor
Returns the item label anchor.- Returns:
- The item label anchor (never
null
).
-
getTextAnchor
public org.jfree.ui.TextAnchor getTextAnchor()Returns the text anchor.- Returns:
- The text anchor (never
null
).
-
getRotationAnchor
public org.jfree.ui.TextAnchor getRotationAnchor()Returns the rotation anchor point.- Returns:
- The rotation anchor point (never
null
).
-
getAngle
public double getAngle()Returns the angle of rotation for the label.- Returns:
- The angle (in radians).
-
equals
Tests this object for equality with an arbitrary object.
-