org.das2.graph
Class GrannyTickLabeller
java.lang.Object
org.das2.graph.GrannyTickLabeller
- All Implemented Interfaces:
- TickLabeller
public class GrannyTickLabeller
- extends java.lang.Object
- implements TickLabeller
TickLabeller based on the formatting and bounding-box capabilities of the
GrannyTextRenderer. This class by default creates a DatumFormatter for
the tickDescriptor it receives, and then uses the grannyFormat method to
get the label. This object is useful as-is, but provides an easy way to
get complex labels (e.g. TCAs) by overriding init and getLabel.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
GrannyTickLabeller
public GrannyTickLabeller(java.awt.Component parent)
init
public void init(TickVDescriptor ticks)
- sets the ticks and DatumFormatter before drawing.
- Specified by:
init
in interface TickLabeller
setFormatter
public void setFormatter(DatumFormatter df)
- override the formatter in the TickVDescriptor.
labelMajorTick
public java.awt.Rectangle labelMajorTick(java.awt.Graphics g,
int tickNumber,
java.awt.geom.Line2D tickLine)
- Specified by:
labelMajorTick
in interface TickLabeller
getLabel
protected java.lang.String getLabel(int tickNumber,
Datum value)
finished
public void finished()
- Specified by:
finished
in interface TickLabeller