fi.helsinki.dacopan.ui
Class CalcYCoord

java.lang.Object
  extended by fi.helsinki.dacopan.ui.CalcYCoord

public class CalcYCoord
extends java.lang.Object

Calculates proper y-coordinates for events based on max and min stepping and visual scale. Mainly used by MSC and related classes.


Constructor Summary
CalcYCoord(DataView dataView, SettingsMSC settings)
           
 
Method Summary
 int getFirstYCoord()
          Getter for first y-coord in this layer, normaly 0.
 int getLastYCoord()
          Getter for last y-coord in this layer.
 float getLinearTimeForYCoord(int yCoord)
          Getter for linear time for given y-coord.
 int getLinearYCoordForTime(float time)
          Getter for linear y-coord for given time, i.e. the ratio time/total time is equal to the ratio y-coord / greatest y-coord.
 float getTimeForYCoord(int yCoord)
          Getter for time for given y-coord.
 int getYCoordForTime(float time)
          Getter for y-coordinate for given time.
 void setMaxGap(int maxGap)
          Setter for maximum gap.
 void setMaxStepping(int maxStepping)
          Setter for maximum stepping.
 void setMinStepping(int minStepping)
          Setter for minimum stepping.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CalcYCoord

public CalcYCoord(DataView dataView,
                  SettingsMSC settings)
Method Detail

getYCoordForTime

public int getYCoordForTime(float time)
Getter for y-coordinate for given time. Y-coordinate either exactly the wanted (if time == some event time) or lineary interpolated from nearest y-coordinates for events.

Parameters:
time -
Returns:
y-coord for given time

getLinearYCoordForTime

public int getLinearYCoordForTime(float time)
Getter for linear y-coord for given time, i.e. the ratio time/total time is equal to the ratio y-coord / greatest y-coord.

Parameters:
time -
Returns:
y-coord for given time

getLastYCoord

public int getLastYCoord()
Getter for last y-coord in this layer.

Returns:
last y-coord

getFirstYCoord

public int getFirstYCoord()
Getter for first y-coord in this layer, normaly 0.

Returns:
firs y-coord

getTimeForYCoord

public float getTimeForYCoord(int yCoord)
Getter for time for given y-coord. Time is calculated vice versa as in getYCoordForTime.

Parameters:
value -
Returns:
time

getLinearTimeForYCoord

public float getLinearTimeForYCoord(int yCoord)
Getter for linear time for given y-coord. Time is calculated similary as in getLinearYCoordForTime.

Parameters:
yCoord -
Returns:
time

setMaxStepping

public void setMaxStepping(int maxStepping)
Setter for maximum stepping. Sets also maxGap to be greater than maxStepping. Re-calculates y-coordinates.

Parameters:
maxStepping -

setMinStepping

public void setMinStepping(int minStepping)
Setter for minimum stepping. Re-calculates y-coordinates.

Parameters:
minStepping -

setMaxGap

public void setMaxGap(int maxGap)
Setter for maximum gap. Re-calculates y-coordinates.

Parameters:
maxGap -


© Dacopan2 team, 2005-