edu.sc.seis.fissuresUtil.display
Class TimeScaleCalc

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.display.TimeScaleCalc
All Implemented Interfaces:
TimeListener, ScaleMapper, java.util.EventListener

public class TimeScaleCalc
extends java.lang.Object
implements ScaleMapper, TimeListener

TimeScaleCalc takes the total pixels of a given seismogram along with its beginning and ending times to make divisions that are decently human friendly for the time axis. Created: Thu May 16 13:36:24 2002


Field Summary
static MicroSecondTimeRange roundTheEpoch
           
 
Method Summary
 void calculateTicks()
           
 java.lang.String getAxisLabel()
           
 java.lang.String getLabel(int i)
          Gets the label if there is one for the ith tick.
 int getNumTicks()
          Gets the total number of ticks.
 int getPixelLocation(int i)
          Gets the pixel location for the ith tick.
 int getTotalPixels()
          read the number of pixels allocated for this scale;
 boolean isLabelTick(int i)
           
 boolean isMajorTick(int i)
          True if the ith tick is a major tick.
 void setTimes(edu.iris.Fissures.model.MicroSecondDate beginTime, edu.iris.Fissures.model.MicroSecondDate endTime)
           
 void setTotalPixels(int totalPixels)
           
 void updateTime(TimeEvent event)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

roundTheEpoch

public static MicroSecondTimeRange roundTheEpoch
Method Detail

calculateTicks

public void calculateTicks()

setTotalPixels

public void setTotalPixels(int totalPixels)

getTotalPixels

public int getTotalPixels()
read the number of pixels allocated for this scale;

Specified by:
getTotalPixels in interface ScaleMapper
Returns:

setTimes

public void setTimes(edu.iris.Fissures.model.MicroSecondDate beginTime,
                     edu.iris.Fissures.model.MicroSecondDate endTime)

getLabel

public java.lang.String getLabel(int i)
Description copied from interface: ScaleMapper
Gets the label if there is one for the ith tick. If there is no label then a empty string should be returned instead of a null.

Specified by:
getLabel in interface ScaleMapper
Parameters:
i - the current tick

getAxisLabel

public java.lang.String getAxisLabel()
Specified by:
getAxisLabel in interface ScaleMapper

getPixelLocation

public int getPixelLocation(int i)
Description copied from interface: ScaleMapper
Gets the pixel location for the ith tick.

Specified by:
getPixelLocation in interface ScaleMapper
Parameters:
i - the current tick

getNumTicks

public int getNumTicks()
Description copied from interface: ScaleMapper
Gets the total number of ticks.

Specified by:
getNumTicks in interface ScaleMapper

isLabelTick

public boolean isLabelTick(int i)
Parameters:
i - the current tick

isMajorTick

public boolean isMajorTick(int i)
Description copied from interface: ScaleMapper
True if the ith tick is a major tick. This could be used by the plotting component to draw major tick longer or thicker.

Specified by:
isMajorTick in interface ScaleMapper
Parameters:
i - the current tick

updateTime

public void updateTime(TimeEvent event)
Specified by:
updateTime in interface TimeListener