DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class DefaultTickParameters

java.lang.Object
  extended by com.cosylab.gui.components.range2.DefaultTickParameters
All Implemented Interfaces:
TickParameters

public class DefaultTickParameters
extends java.lang.Object
implements TickParameters

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

Constructor Summary
DefaultTickParameters()
          Default constructor for DefaultTickCallback (tick width is 50, format is %3.2f).
DefaultTickParameters(int tickWidth, java.lang.String format)
          Constructs a new DefaultTickParameters object with the given tickWidth and string format used to format values.
 
Method Summary
 java.lang.String formatNumber(double value)
          Formats the input value to a specific print format.
 int measureTick(double position, java.lang.String text)
          Returns size of tick label in pixels.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultTickParameters

public DefaultTickParameters()
Default constructor for DefaultTickCallback (tick width is 50, format is %3.2f).


DefaultTickParameters

public DefaultTickParameters(int tickWidth,
                             java.lang.String format)
Constructs a new DefaultTickParameters object with the given tickWidth and string format used to format values.

Parameters:
tickWidth -
format -
Method Detail

measureTick

public int measureTick(double position,
                       java.lang.String text)
Description copied from interface: TickParameters
Returns size of tick label in pixels. Size is determined as distance between maximum extent of the label along the tick axis.

Specified by:
measureTick in interface TickParameters
Parameters:
position - relative position of the tick on 0..1.
text - label to display, may be empty string or null.
Returns:
size of tick in pixels.

formatNumber

public java.lang.String formatNumber(double value)
Description copied from interface: TickParameters
Formats the input value to a specific print format. If return value is null use internal format specified by the caller of this method.

Specified by:
formatNumber in interface TickParameters
Parameters:
value - double to be formatted
Returns:
formatted value


Copyright © 2010. All Rights Reserved.