Package org.jfree.chart.axis
Class Tick
- java.lang.Object
-
- org.jfree.chart.axis.Tick
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
CategoryTick,ValueTick
public abstract class Tick extends java.lang.Object implements java.io.Serializable, java.lang.CloneableThe base class used to represent labeled ticks along an axis.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private doubleangleThe rotation angle.private TextAnchorrotationAnchorThe rotation anchor for the tick label.private static longserialVersionUIDFor serialization.private java.lang.StringtextA text version of the tick value.private TextAnchortextAnchorThe text anchor for the tick label.
-
Constructor Summary
Constructors Constructor Description Tick(java.lang.String text, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle)Creates a new tick.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanEqual(java.lang.Object other)Ensures symmetry between super/subclass implementations of equals.java.lang.Objectclone()Returns a clone of the tick.booleanequals(java.lang.Object obj)Tests this tick for equality with an arbitrary object.doublegetAngle()Returns the angle.TextAnchorgetRotationAnchor()Returns the text anchor that defines the point around which the label is rotated.java.lang.StringgetText()Returns the text version of the tick value.TextAnchorgetTextAnchor()Returns the text anchor.inthashCode()java.lang.StringtoString()Returns a string representation of the tick.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
text
private java.lang.String text
A text version of the tick value.
-
textAnchor
private TextAnchor textAnchor
The text anchor for the tick label.
-
rotationAnchor
private TextAnchor rotationAnchor
The rotation anchor for the tick label.
-
angle
private double angle
The rotation angle.
-
-
Constructor Detail
-
Tick
public Tick(java.lang.String text, TextAnchor textAnchor, TextAnchor rotationAnchor, double angle)Creates a new tick.- Parameters:
text- the formatted version of the tick value.textAnchor- the text anchor (nullnot permitted).rotationAnchor- the rotation anchor (nullnot permitted).angle- the angle.
-
-
Method Detail
-
getText
public java.lang.String getText()
Returns the text version of the tick value.- Returns:
- A string (possibly
null);
-
getTextAnchor
public TextAnchor getTextAnchor()
Returns the text anchor.- Returns:
- The text anchor (never
null).
-
getRotationAnchor
public TextAnchor getRotationAnchor()
Returns the text anchor that defines the point around which the label is rotated.- Returns:
- A text anchor (never
null).
-
getAngle
public double getAngle()
Returns the angle.- Returns:
- The angle.
-
equals
public boolean equals(java.lang.Object obj)
Tests this tick for equality with an arbitrary object.- Overrides:
equalsin classjava.lang.Object- Parameters:
obj- the object (nullpermitted).- Returns:
- A boolean.
-
canEqual
public boolean canEqual(java.lang.Object other)
Ensures symmetry between super/subclass implementations of equals. For more detail, see http://jqno.nl/equalsverifier/manual/inheritance.- Parameters:
other- Object- Returns:
- true ONLY if the parameter is THIS class type
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
public java.lang.Object clone() throws java.lang.CloneNotSupportedExceptionReturns a clone of the tick.- Overrides:
clonein classjava.lang.Object- Returns:
- A clone.
- Throws:
java.lang.CloneNotSupportedException- if there is a problem cloning.
-
toString
public java.lang.String toString()
Returns a string representation of the tick.- Overrides:
toStringin classjava.lang.Object- Returns:
- A string.
-
-