gov.noaa.pmel.sgt
Class TimeAxis

java.lang.Object
  extended by gov.noaa.pmel.sgt.Axis
      extended by gov.noaa.pmel.sgt.TimeAxis
All Implemented Interfaces:
Selectable, java.lang.Cloneable

public class TimeAxis
extends Axis
implements java.lang.Cloneable

Base class for time axes. A time axis is an axis whose user units are GeoDate objects.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Axis

Field Summary
static int AUTO
          Automatically select the time axis style
protected  int axisStyle_
           
static int DAY_MONTH
          Use the DayMonthAxis style.
static int HOUR_DAY
          Use the HourDayAxis style.
protected  java.lang.String majorLabelFormat_
           
protected  int majorLabelInterval_
           
protected  java.lang.String minorLabelFormat_
           
protected  int minorLabelInterval_
           
static int MINUTE_HOUR
          Use the MinuteHourAxis style.
static int MONTH_YEAR
          Use the MonthYearAxis style.
protected  TimePoint tLocation_
           
protected  TimeRange tRange_
           
protected  TimeAxisStyle txt_
           
protected  int vertalign_
           
protected  double xmajor_
           
protected  double xminor_
           
static int YEAR_DECADE
          Use the YearDecadeAxis style.
protected  double ymajor_
           
protected  double yminor_
           
 
Fields inherited from class gov.noaa.pmel.sgt.Axis
BOTH_SIDES, graph_, HORIZONTAL, labelColor_, labelFont_, labelFormat_, labelHeight_, labelInterval_, labelPosition_, largeTicHeight_, lineColor_, NEGATIVE_SIDE, NO_LABEL, numSmallTics_, orientation_, POSITIVE_SIDE, pRange_, registeredAxes_, registeredTransforms_, selectable_, selected_, sigDigits_, smallTicHeight_, space_, thickTicWidth_, ticPosition_, title_, VERTICAL, visible_
 
Constructor Summary
TimeAxis(int style)
          Default contructor.
TimeAxis(java.lang.String id, int style)
          TimeAxis constructor.
 
Method Summary
 Axis copy()
          Create a copy of the axis.
protected  void drawMajorLabel(java.awt.Graphics g, double val, GeoDate time)
           
protected  void drawMinorLabel(java.awt.Graphics g, double val, GeoDate time)
           
 java.awt.Rectangle getBounds()
          Get the bounding box for the axis in device units.
 TimePoint getLocationU()
          Get the origin in user units.
 java.lang.String getMajorLabelFormat()
          Get the major label format.
 int getMajorLabelInterval()
          Get the major label interval.
 java.lang.String getMinorLabelFormat()
          Get the minor label format.
 int getMinorLabelInterval()
          Get the minor label interval.
 SoTPoint getSoTLocationU()
          Returns origin as a SoTPoint.
 SoTRange getSoTRangeU()
          Get user range.
 int getStyle()
          Get the time axis style.
 TimeRange getTimeRangeU()
          Get the time range of the axis.
 void modified(java.lang.String mess)
          Used internally by sgt.
 void setBounds(int x, int y, int width, int height)
           
 void setBounds(java.awt.Rectangle r)
           
 void setLabelFormat(java.lang.String minor, java.lang.String major)
          Set the minor and major label formats.
 void setLabelInterval(int minor, int major)
          Set the minor and major label intervals.
 void setLocationU(SoTPoint tp)
          Set the axis location.
 void setLocationU(TimePoint tp)
          Set the origin in user units of the axis.
 void setMajorLabelFormat(java.lang.String major)
          Set the major label format.
 void setMajorLabelInterval(int major)
          Set the major label interval.
 void setMinorLabelFormat(java.lang.String minor)
          Set the minor label format.
 void setMinorLabelInterval(int minor)
          Set the minor label interval.
 void setRangeU(SoTRange tr)
          Set user range.
 void setRangeU(TimeRange tr)
          Set the user range to draw the axis.
 void setStyle(int style)
          Set the time axis style.
 void setTitle(SGLabel title)
          Set the axis title.
protected  void setupDraw(double val)
           
protected  void updateRegisteredAxes()
           
protected  void updateRegisteredTransforms()
           
 
Methods inherited from class gov.noaa.pmel.sgt.Axis
clear, clear, clearAllRegisteredAxes, clearAllRegisteredTransforms, drawThickXTic, drawThickYTic, drawXTic, drawYTic, getGraph, getId, getLabelColor, getLabelFont, getLabelHeightP, getLabelPosition, getLargeTicHeightP, getLineColor, getNumberRegisteredAxes, getNumberRegisteredTransforms, getNumberSmallTics, getOrientation, getPane, getRangeP, getSmallTicHeightP, getThickTicWidthP, getTicPosition, getTitle, isSelectable, isSelected, isSpace, isTime, isVisible, register, register, setId, setLabelColor, setLabelFont, setLabelHeightP, setLabelPosition, setLargeTicHeightP, setLineColor, setNumberSmallTics, setOrientation, setRangeP, setSelectable, setSelected, setSmallTicHeightP, setThickTicWidthP, setTicPosition, setVisible, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

tRange_

protected TimeRange tRange_

tLocation_

protected TimePoint tLocation_

minorLabelFormat_

protected java.lang.String minorLabelFormat_

minorLabelInterval_

protected int minorLabelInterval_

majorLabelFormat_

protected java.lang.String majorLabelFormat_

majorLabelInterval_

protected int majorLabelInterval_

yminor_

protected double yminor_

ymajor_

protected double ymajor_

xminor_

protected double xminor_

xmajor_

protected double xmajor_

vertalign_

protected int vertalign_

txt_

protected TimeAxisStyle txt_

axisStyle_

protected int axisStyle_

AUTO

public static final int AUTO
Automatically select the time axis style

See Also:
Constant Field Values

YEAR_DECADE

public static final int YEAR_DECADE
Use the YearDecadeAxis style.
   |..........|..........|..........|..........|
        84         85         86         87
                       1980
 

See Also:
Constant Field Values

MONTH_YEAR

public static final int MONTH_YEAR
Use the MonthYearAxis style.
   |..........|..........|..........|..........|
        Mar        Apr        May       Jun
                       1980
 

See Also:
Constant Field Values

DAY_MONTH

public static final int DAY_MONTH
Use the DayMonthAxis style.
   |..........|..........|..........|..........|
        3          4          5           6
                        1993-04
 

See Also:
Constant Field Values

HOUR_DAY

public static final int HOUR_DAY
Use the HourDayAxis style.
   |..........|..........|..........|..........|
   03         04         05         06         07
                     1987-06-07
 

See Also:
Constant Field Values

MINUTE_HOUR

public static final int MINUTE_HOUR
Use the MinuteHourAxis style.
   |..........|..........|..........|..........|
   15         30         45         00         15
                   1987-06-07 13
 

See Also:
Constant Field Values
Constructor Detail

TimeAxis

public TimeAxis(int style)
Default contructor.


TimeAxis

public TimeAxis(java.lang.String id,
                int style)
TimeAxis constructor.

Parameters:
id - axis identifier
Method Detail

updateRegisteredTransforms

protected void updateRegisteredTransforms()
Specified by:
updateRegisteredTransforms in class Axis

updateRegisteredAxes

protected void updateRegisteredAxes()
Specified by:
updateRegisteredAxes in class Axis

setupDraw

protected void setupDraw(double val)

drawMinorLabel

protected void drawMinorLabel(java.awt.Graphics g,
                              double val,
                              GeoDate time)

drawMajorLabel

protected void drawMajorLabel(java.awt.Graphics g,
                              double val,
                              GeoDate time)

copy

public Axis copy()
Description copied from class: Axis
Create a copy of the axis.

Specified by:
copy in class Axis
Returns:
the copy

setLabelFormat

public void setLabelFormat(java.lang.String minor,
                           java.lang.String major)
Set the minor and major label formats.

Parameters:
minor - minor label format
major - major label format

setMinorLabelFormat

public void setMinorLabelFormat(java.lang.String minor)
Set the minor label format.

Parameters:
minor - minor label format

setMajorLabelFormat

public void setMajorLabelFormat(java.lang.String major)
Set the major label format.

Parameters:
major - major label format

getMinorLabelFormat

public java.lang.String getMinorLabelFormat()
Get the minor label format.

Returns:
minor label format

getMajorLabelFormat

public java.lang.String getMajorLabelFormat()
Get the major label format.

Returns:
major label format

setLabelInterval

public void setLabelInterval(int minor,
                             int major)
Set the minor and major label intervals.

Parameters:
minor - minor label interval
major - major label interval

setMinorLabelInterval

public void setMinorLabelInterval(int minor)
Set the minor label interval.

Parameters:
minor - minor label interval

setMajorLabelInterval

public void setMajorLabelInterval(int major)
Set the major label interval.

Parameters:
major - major label interval

getMinorLabelInterval

public int getMinorLabelInterval()
Get the minor label interval.

Returns:
minor label interval

getMajorLabelInterval

public int getMajorLabelInterval()
Get the major label interval.

Returns:
major label interval

setStyle

public void setStyle(int style)
Set the time axis style.

Parameters:
style - new time axis style

getStyle

public int getStyle()
Get the time axis style.

Returns:
time axis style

setRangeU

public void setRangeU(TimeRange tr)
Set the user range to draw the axis. Registered Axes and Transforms will be updated.

Parameters:
tr - TimeRange of axis.

getTimeRangeU

public TimeRange getTimeRangeU()
Get the time range of the axis.

Returns:
TimeRange of axis

setRangeU

public void setRangeU(SoTRange tr)
Description copied from class: Axis
Set user range.

Specified by:
setRangeU in class Axis

getSoTRangeU

public SoTRange getSoTRangeU()
Description copied from class: Axis
Get user range.

Specified by:
getSoTRangeU in class Axis

setLocationU

public void setLocationU(TimePoint tp)
Set the origin in user units of the axis.

Parameters:
tp - origin of axis in user units

setLocationU

public void setLocationU(SoTPoint tp)
Description copied from class: Axis
Set the axis location.

Specified by:
setLocationU in class Axis

getSoTLocationU

public SoTPoint getSoTLocationU()
Returns origin as a SoTPoint.

Specified by:
getSoTLocationU in class Axis

getLocationU

public TimePoint getLocationU()
Get the origin in user units.

Returns:
origin in user units

getBounds

public java.awt.Rectangle getBounds()
Description copied from class: Axis
Get the bounding box for the axis in device units.

Specified by:
getBounds in interface Selectable
Specified by:
getBounds in class Axis
Returns:
bounding box

setBounds

public void setBounds(java.awt.Rectangle r)

setBounds

public void setBounds(int x,
                      int y,
                      int width,
                      int height)

modified

public void modified(java.lang.String mess)
Description copied from class: Axis
Used internally by sgt.

Overrides:
modified in class Axis

setTitle

public void setTitle(SGLabel title)
Description copied from class: Axis
Set the axis title.

Overrides:
setTitle in class Axis
Parameters:
title - axis title