Package org.jfree.chart.labels
Class ItemLabelPosition
- java.lang.Object
-
- org.jfree.chart.labels.ItemLabelPosition
-
- All Implemented Interfaces:
java.io.Serializable
public class ItemLabelPosition extends java.lang.Object implements java.io.SerializableThe attributes that control the position of the label for each data item on a chart. Instances of this class are immutable.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private doubleangleThe rotation angle.private ItemLabelAnchoritemLabelAnchorThe item label anchor point.private ItemLabelClipitemLabelClipThe item label clip type.private TextAnchorrotationAnchorThe rotation anchor.private static longserialVersionUIDFor serialization.private TextAnchortextAnchorThe text anchor.
-
Constructor Summary
Constructors Constructor Description ItemLabelPosition()Creates a new position record with default settings.ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor)Creates a new position record (with zero rotation).ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, ItemLabelClip itemLabelClip)Creates a new position record.ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle)Creates a new position record.ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle, ItemLabelClip itemLabelClip)Creates a new position record.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Tests this object for equality with an arbitrary object.doublegetAngle()Returns the angle of rotation for the label.ItemLabelAnchorgetItemLabelAnchor()Returns the item label anchor.ItemLabelClipgetItemLabelClip()Returns the clip type for the label.TextAnchorgetRotationAnchor()Returns the rotation anchor point.TextAnchorgetTextAnchor()Returns the text anchor.inthashCode()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
itemLabelAnchor
private ItemLabelAnchor itemLabelAnchor
The item label anchor point.
-
textAnchor
private TextAnchor textAnchor
The text anchor.
-
rotationAnchor
private TextAnchor rotationAnchor
The rotation anchor.
-
angle
private double angle
The rotation angle.
-
itemLabelClip
private ItemLabelClip itemLabelClip
The item label clip type.
-
-
Constructor Detail
-
ItemLabelPosition
public ItemLabelPosition()
Creates a new position record with default settings.
-
ItemLabelPosition
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor)
Creates a new position record (with zero rotation).- Parameters:
itemLabelAnchor- the item label anchor (nullnot permitted).textAnchor- the text anchor (nullnot permitted).
-
ItemLabelPosition
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, ItemLabelClip itemLabelClip)
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 (nullnot permitted).textAnchor- the text anchor (nullnot permitted).itemLabelClip- The clip type for the label (nullnot permitted. Only used whenItemLabelAnchor.isInternal()returnstrue, iffalselabelClipis always considered to beItemLabelClip.NONE)
-
ItemLabelPosition
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, 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 (nullnot permitted).textAnchor- the text anchor (nullnot permitted).rotationAnchor- the rotation anchor (nullnot permitted).angle- the rotation angle (in radians).
-
ItemLabelPosition
public ItemLabelPosition(ItemLabelAnchor itemLabelAnchor, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle, ItemLabelClip itemLabelClip)
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 (nullnot permitted).textAnchor- the text anchor (nullnot permitted).rotationAnchor- the rotation anchor (nullnot permitted).angle- the rotation angle (in radians).itemLabelClip- The clip type for the label (nullnot permitted. Only used whenItemLabelAnchor.isInternal()returnstrue, iffalselabelClipis always considered to beItemLabelClip.NONE)
-
-
Method Detail
-
getItemLabelAnchor
public ItemLabelAnchor getItemLabelAnchor()
Returns the item label anchor.- Returns:
- The item label anchor (never
null).
-
getTextAnchor
public TextAnchor getTextAnchor()
Returns the text anchor.- Returns:
- The text anchor (never
null).
-
getRotationAnchor
public 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).
-
getItemLabelClip
public ItemLabelClip getItemLabelClip()
Returns the clip type for the label.- Returns:
- The clip type for the label.
-
equals
public boolean equals(java.lang.Object obj)
Tests this object for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-