clickDetector
Class ClickBTDisplay.VScaleManager

java.lang.Object
  extended by clickDetector.ClickBTDisplay.VScaleManager
All Implemented Interfaces:
java.awt.event.AdjustmentListener, java.util.EventListener
Direct Known Subclasses:
ClickBTDisplay.AmplitudeScaleManager, ClickBTDisplay.BearingScaleManager, ClickBTDisplay.ICIScaleManager
Enclosing class:
ClickBTDisplay

abstract class ClickBTDisplay.VScaleManager
extends java.lang.Object
implements java.awt.event.AdjustmentListener

Class for managing vertical scales and scrolls which will either be bearing, ICI or Amplitude.

Jobs this beast has to do are:

set up the scroll bar at start and after a zoom

set the yStart and yScale values whatever the zoom state

write the correct values and titles on the y axis.

Author:
Doug Gillespie

Field Summary
(package private)  double currentRange
           
(package private)  double currentStart
           
protected  ZoomShape lastZoomShape
           
 
Constructor Summary
ClickBTDisplay.VScaleManager()
           
 
Method Summary
 void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
           
 void calculateScales()
           
 boolean checkNoZoom()
          Check for there being no zooms in this coordinate frame
abstract  int getCoordinateType()
           
 double getCurrentEnd()
          Value at the top of the display
 double getCurrentRange()
          the range from the bottom to the top of the display (may be negative if top of display has smaller values than bottom)
 double getCurrentStart()
           
 ZoomShape getLastZoom()
           
abstract  double getMax()
           
abstract  double getMin()
           
abstract  double getStep()
          Get unit step for scroll bar (e.g.
abstract  java.lang.String getTitle()
           
abstract  double getYAxisInterval()
           
 void restoreDefaults()
           
abstract  double scrollToValue(int scrollPos)
          Convert a scroll bar position back into avalue.
 void setSelected()
           
 void setupScrollBar(double start, double page)
           
 void setZoom(ZoomShape zoomShape)
           
abstract  int valueToScroll(double value, int visAmount)
          convert a value to a scroll bar position
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentStart

double currentStart

currentRange

double currentRange

lastZoomShape

protected ZoomShape lastZoomShape
Constructor Detail

ClickBTDisplay.VScaleManager

ClickBTDisplay.VScaleManager()
Method Detail

restoreDefaults

public void restoreDefaults()

setSelected

public void setSelected()

getCoordinateType

public abstract int getCoordinateType()

checkNoZoom

public boolean checkNoZoom()
Check for there being no zooms in this coordinate frame

If there was no zoom, restore defaults and return true.

Returns:
true if there were no zooms, and false otherwise

getLastZoom

public ZoomShape getLastZoom()

setZoom

public void setZoom(ZoomShape zoomShape)

calculateScales

public void calculateScales()

setupScrollBar

public void setupScrollBar(double start,
                           double page)

valueToScroll

public abstract int valueToScroll(double value,
                                  int visAmount)
convert a value to a scroll bar position

Parameters:
value - value to convert
visAmount - visible amount of scroll br
Returns:
new scroll bar position

scrollToValue

public abstract double scrollToValue(int scrollPos)
Convert a scroll bar position back into avalue.

Parameters:
scrollPos - scroll position
Returns:
new value

getStep

public abstract double getStep()
Get unit step for scroll bar (e.g. 0.1 if you want a bearing scroll to be in 1/10 degree steps).

Returns:
unit step

getMin

public abstract double getMin()
Returns:
the maximum value for the scroll bar

getMax

public abstract double getMax()
Returns:
the minimum value for the scroll bar

getCurrentStart

public double getCurrentStart()
Returns:
the current value at the bottom of the display

getCurrentRange

public double getCurrentRange()
the range from the bottom to the top of the display (may be negative if top of display has smaller values than bottom)

Returns:
range

getCurrentEnd

public double getCurrentEnd()
Value at the top of the display

Returns:

getTitle

public abstract java.lang.String getTitle()
Returns:
Title to use in the display axis.

adjustmentValueChanged

public void adjustmentValueChanged(java.awt.event.AdjustmentEvent e)
Specified by:
adjustmentValueChanged in interface java.awt.event.AdjustmentListener

getYAxisInterval

public abstract double getYAxisInterval()