uk.ac.starlink.ttools.plot2
Class TickCalc.BasicTickCalc

java.lang.Object
  extended by uk.ac.starlink.ttools.plot2.TickCalc
      extended by uk.ac.starlink.ttools.plot2.TickCalc.BasicTickCalc
Enclosing class:
TickCalc

public abstract static class TickCalc.BasicTickCalc
extends TickCalc

Abstract TickCalc implementation that deals with fixed-length tick labels. Concrete subclasses must implement a method to create a Ticker suitable for a given range, and this is used to provide suitable ticks for particular circumstances, including avoiding label overlap.


Nested Class Summary
 
Nested classes/interfaces inherited from class uk.ac.starlink.ttools.plot2.TickCalc
TickCalc.BasicTickCalc
 
Field Summary
 
Fields inherited from class uk.ac.starlink.ttools.plot2.TickCalc
LINEAR, LOG
 
Constructor Summary
TickCalc.BasicTickCalc(boolean logFlag)
          Constructor.
 
Method Summary
abstract  Ticker createTicker(double dlo, double dhi, double approxMajorCount, int adjust)
          Returns a new ticker for labelling an axis in a given range.
 Tick[] getTicks(double dlo, double dhi, boolean withMinor, Captioner captioner, Orientation orient, int npix, double crowding)
          Generates tick marks for labelling a plot axis.
 
Methods inherited from class uk.ac.starlink.ttools.plot2.TickCalc
getMajorTicks, getMinorTicks
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TickCalc.BasicTickCalc

public TickCalc.BasicTickCalc(boolean logFlag)
Constructor.

Parameters:
logFlag - true for logarithmic axis, false for linear
Method Detail

createTicker

public abstract Ticker createTicker(double dlo,
                                    double dhi,
                                    double approxMajorCount,
                                    int adjust)
Returns a new ticker for labelling an axis in a given range. The tick density is determined by two parameters, 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.

Parameters:
dlo - minimum axis data value
dhi - maximum axis data value
approxMajorCount - guide value for number of major ticks in range
adjust - adjusts density of major ticks, zero is normal

getTicks

public Tick[] getTicks(double dlo,
                       double dhi,
                       boolean withMinor,
                       Captioner captioner,
                       Orientation orient,
                       int npix,
                       double crowding)
Generates tick marks for labelling a plot axis. This starts off by generating ticks at roughly a standard separation, guided by the crowding parameter. However, if the resulting ticks are so close as to overlap, it backs off until it finds a set of ticks that can be displayed in a tidy fashion.

Specified by:
getTicks in class TickCalc
Parameters:
dlo - minimum axis data value
dhi - maximum axis data value
withMinor - if true minor axes are included, if false only major (labelled) ones are
captioner - caption painter
orient - label orientation
npix - number of pixels along the axis
crowding - 1 for normal tick density on the axis, lower for fewer labels, higher for more
Returns:
tick array


Copyright © 2013 Central Laboratory of the Research Councils. All Rights Reserved.