Class Tick
- java.lang.Object
-
- adams.gui.visualization.core.axis.Tick
-
- All Implemented Interfaces:
Serializable
public class Tick extends Object implements Serializable
Represents a single tick of an axis.- Version:
- $Revision$
- Author:
- fracpete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Rectangle
m_Bounds
the computed rectangle for the text.protected String
m_Label
the label, if any.protected int
m_Position
the position.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Rectangle
getBounds()
Returns the bounds.String
getLabel()
Returns the label of this tick, can be null.int
getPosition()
Returns the tick's position.boolean
hasBounds()
Returns whether bounds are stored with this tick.boolean
hasLabel()
Returns whether this tick has a label or not.void
setBounds(int x, int y, int width, int height)
Sets the bounds for the text.String
toString()
Returns a string representation of the tick.
-
-
-
Constructor Detail
-
Tick
public Tick(int pos, String label)
Initializes the tick.- Parameters:
pos
- the position of this ticklabel
- the label for this tick, null to suppress
-
-
Method Detail
-
getPosition
public int getPosition()
Returns the tick's position.- Returns:
- the position
-
hasLabel
public boolean hasLabel()
Returns whether this tick has a label or not.- Returns:
- true if the tick has a label
-
getLabel
public String getLabel()
Returns the label of this tick, can be null.- Returns:
- the label
-
setBounds
public void setBounds(int x, int y, int width, int height)
Sets the bounds for the text.- Parameters:
x
- the x positiony
- the y positionwidth
- the widthheight
- the height
-
hasBounds
public boolean hasBounds()
Returns whether bounds are stored with this tick.- Returns:
- true if bounds are available
-
getBounds
public Rectangle getBounds()
Returns the bounds.- Returns:
- the bounds, can be null if not available
-
-