|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.BasicTicker
public abstract class BasicTicker
Partial Ticker implementation based on a rule defining a sequence of ticks. Concrete subclasses must implement a method to create a Rule suitable for a given range, and this is used to provide suitable ticks for particular circumstances, including avoiding label overlap.
Nested Class Summary | |
---|---|
static interface |
BasicTicker.Rule
Defines a specific rule for generating major and minor axis tick marks. |
Field Summary | |
---|---|
static BasicTicker |
LINEAR
Ticker for linear axes. |
static BasicTicker |
LOG
Ticker for logarithmic axes. |
Constructor Summary | |
---|---|
protected |
BasicTicker(boolean logFlag)
Constructor. |
Method Summary | |
---|---|
abstract BasicTicker.Rule |
createRule(double dlo,
double dhi,
double approxMajorCount,
int adjust)
Returns a new rule for labelling an axis in a given range. |
static Tick[] |
getMajorTicks(BasicTicker.Rule rule,
double dlo,
double dhi)
Use a given rule to generate major ticks in a given range of coordinates. |
static Tick[] |
getMinorTicks(BasicTicker.Rule rule,
double dlo,
double dhi)
Use a given rule to generate minor ticks in a given range of coordinates. |
BasicTicker.Rule |
getRule(double dlo,
double dhi,
Captioner captioner,
Orientation orient,
int npix,
double crowding)
Returns a Rule suitable for a given axis labelling job. |
Tick[] |
getTicks(double dlo,
double dhi,
boolean withMinor,
Captioner captioner,
Orientation orient,
int npix,
double crowding)
Generates tick marks for labelling a plot axis. |
static boolean |
overlaps(Tick[] ticks,
Axis axis,
Captioner captioner,
Orientation orient)
Determines whether the labels for a set of tick marks would overlap when painted on a given axis. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final BasicTicker LINEAR
public static final BasicTicker LOG
Constructor Detail |
---|
protected BasicTicker(boolean logFlag)
logFlag
- true for logarithmic axis, false for linearMethod Detail |
---|
public abstract BasicTicker.Rule createRule(double dlo, double dhi, double approxMajorCount, int adjust)
approxMajorCount
, which gives a baseline value for
the number of ticks required over the given range, and
adjust
.
Increasing adjust
will give more major ticks, and
decreasing it will give fewer ticks.
Each value of adjust should result in a different tick count.
dlo
- minimum axis data valuedhi
- maximum axis data valueapproxMajorCount
- guide value for number of major ticks
in rangeadjust
- adjusts density of major ticks, zero is normalpublic Tick[] getTicks(double dlo, double dhi, boolean withMinor, Captioner captioner, Orientation orient, int npix, double crowding)
Ticker
getTicks
in interface Ticker
dlo
- minimum axis data valuedhi
- maximum axis data valuewithMinor
- if true minor axes are included,
if false only major (labelled) ones arecaptioner
- caption painterorient
- label orientationnpix
- number of pixels along the axiscrowding
- 1 for normal tick density on the axis,
lower for fewer labels, higher for more
public BasicTicker.Rule getRule(double dlo, double dhi, Captioner captioner, Orientation orient, int npix, double crowding)
dlo
- minimum axis data valuedhi
- maximum axis data valuecaptioner
- caption painterorient
- label orientationnpix
- number of pixels along the axiscrowding
- 1 for normal tick density on the axis,
lower for fewer labels, higher for more
public static Tick[] getMajorTicks(BasicTicker.Rule rule, double dlo, double dhi)
rule
- tick generation ruledlo
- minimum axis data valuedhi
- maximum axis data value
public static Tick[] getMinorTicks(BasicTicker.Rule rule, double dlo, double dhi)
rule
- tick generation ruledlo
- minimum axis data valuedhi
- maximum axis data value
public static boolean overlaps(Tick[] ticks, Axis axis, Captioner captioner, Orientation orient)
ticks
- major tick marksaxis
- axis on which the ticks will be drawncaptioner
- caption painterorient
- label orientation
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |