DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class ManualTickCalculator

java.lang.Object
  extended by com.cosylab.gui.components.range2.ManualTickCalculator
All Implemented Interfaces:
TickCalculator

public class ManualTickCalculator
extends java.lang.Object
implements TickCalculator

ManualTickCalculator calculates ticks explicitely. Ticks are calculated according to the supplied parameters which define at which values major and minor ticks should be.

Version:
$Id: ManualTickCalculator.java,v 1.4 2008-04-22 12:28:40 jbobnar Exp $
Author:
Jaka Bobnar

Constructor Summary
ManualTickCalculator()
          Constructs a new ManualTickProvider with null value.
ManualTickCalculator(double[] majorTicks, double[] labels, double minor)
          Constructs a new ManualTickProvider with the given parameters.
 
Method Summary
 Tick[] calculateTicks(int length, Range range, RangedValue rangedValue)
          Calculates ticks using some default TickParameters.
 Tick[] calculateTicks(int spaceLength, TickParameters measurer, Range range, RangedValue rangedValue)
          Calculates ticks using the given TickParameters.
 double[] getLabels()
          Returns the values which have labels printed next to the ticks.
 double[] getMajorTicks()
          Returns the values which have major ticks.
 double getMinor()
          Returns the number of minor ticks between two major ticks.
static void main(java.lang.String[] args)
           
 void setLabels(double[] labels)
          Sets the values that will have labels printed next to ticks.
 void setMajorTicks(double[] majorTicks)
          Sets the values which will have major ticks.
 void setMinor(double minor)
          Sets the number of minor ticks between two major ticks.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManualTickCalculator

public ManualTickCalculator()
Constructs a new ManualTickProvider with null value.


ManualTickCalculator

public ManualTickCalculator(double[] majorTicks,
                            double[] labels,
                            double minor)
Constructs a new ManualTickProvider with the given parameters.

Parameters:
majorTicks - values that major ticks will be created for
labels - values that will have labels (only major ticks can have labels).
minor - number of minor ticks between two major ticks
Method Detail

setLabels

public void setLabels(double[] labels)
Sets the values that will have labels printed next to ticks. Only major ticks can have labels.

Parameters:
labels -

setMajorTicks

public void setMajorTicks(double[] majorTicks)
Sets the values which will have major ticks.

Parameters:
majorTicks -

setMinor

public void setMinor(double minor)
Sets the number of minor ticks between two major ticks.

Parameters:
minor -

getLabels

public double[] getLabels()
Returns the values which have labels printed next to the ticks.

Returns:

getMajorTicks

public double[] getMajorTicks()
Returns the values which have major ticks.

Returns:

getMinor

public double getMinor()
Returns the number of minor ticks between two major ticks.

Returns:

calculateTicks

public Tick[] calculateTicks(int length,
                             Range range,
                             RangedValue rangedValue)
Description copied from interface: TickCalculator
Calculates ticks using some default TickParameters.

Specified by:
calculateTicks in interface TickCalculator
Parameters:
length - the available space for ticks in the displayer
range - range which provides transformation to absolute/relative values
rangedValue - the value bounds
Returns:

calculateTicks

public Tick[] calculateTicks(int spaceLength,
                             TickParameters measurer,
                             Range range,
                             RangedValue rangedValue)
Description copied from interface: TickCalculator
Calculates ticks using the given TickParameters.

Specified by:
calculateTicks in interface TickCalculator
Parameters:
spaceLength - the available space for ticks in the displayer
measurer - TickParameters used to measure ticks
range - range which provides transformation to absolute/relative values
rangedValue - the value bounds
Returns:

main

public static void main(java.lang.String[] args)


Copyright © 2010. All Rights Reserved.