gov.noaa.pmel.sgt.beans
Class DataGroup

java.lang.Object
  extended by gov.noaa.pmel.sgt.beans.DataGroup
All Implemented Interfaces:
java.io.Serializable, java.util.EventListener, javax.swing.event.ChangeListener

public class DataGroup
extends java.lang.Object
implements java.io.Serializable, javax.swing.event.ChangeListener

A holder for the X and Y transforms and optionally references to the X and Y axes for a CartesianGraph. This class is used with DataModel and Panel.

Since:
3.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Serialized Form

Field Summary
static int BOTTOM
          X axis placed at bottom of DataGroup area.
static int LEFT
          Y axis placed left of DataGroup area.
static int LINEAR
          Linear transform type.
static int LOG
          Log transform type.
static int MANUAL
          Axes placed in default locations.
static int PLAIN
          Plain linear axis type.
static int REFERENCE
          Refer to a transform in another DataGroup.
static int RIGHT
          Y axis placed right of DataGroup area.
static int TIME
          Time axis type.
static int TOP
          X axis placed at top of DataGroup area.
static int X_DIR
          X direction.
static int Y_DIR
          Y direction.
 
Constructor Summary
DataGroup()
          Default constructor.
DataGroup(java.lang.String id, PanelHolder ph)
          Simple constructor.
DataGroup(java.lang.String id, PanelHolder ph, int xt, int xAxis, int yt, int yAxis)
          Full constructor.
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener l)
          Add changelistener
protected  void fireStateChanged()
           
 java.lang.String getId()
          Get datagroup id.
 Margin getMargin()
          Get the margin.
 int getNumberAutoContourLevels()
          Get number of auto contour levels.
 PanelHolder getPanelHolder()
          Get parent.
 AxisHolder getXAxisHolder()
          Get X axisholder
 AxisHolder getYAxisHolder()
          Get Y axisholder.
 SoTRange getZRangeU()
          Get Z range.
 boolean isInstantiated()
          Is datagrouplayer instantiated?
 boolean isZAutoScale()
          Is auto Z scale?
 boolean isZoomable()
          Is datagroup zoomable?
 void removeAllChangeListeners()
          Remove all ChangeListeners.
 void removeChangeListener(javax.swing.event.ChangeListener l)
          Remove changelistener.
 void removeDesignChangeListeners()
          Remove all ChangeListeners that implement the DesignListener interface.
 void setId(java.lang.String id)
          Set datagroup id.
 void setInstantiated(boolean instantiated)
          Set instantiated.
 void setMargin(float top, float left, float bottom, float right)
          Set the Margin.
 void setMargin(Margin margin)
          Set the margin.
 void setNumberAutoContourLevels(int numberAutoContourLevels)
          Set number of auto contour levels.
 void setPanelHolder(PanelHolder ph)
          Set panelhodler parent.
 void setXAxisHolder(AxisHolder xah)
          Set X axisholder
 void setYAxisHolder(AxisHolder yah)
          Set Y axisholder
 void setZAutoScale(boolean zAutoScale)
          Set auto Z scale.
 void setZoomable(boolean zoomable)
          Set datagroup zoomable.
 void setZRangeU(SoTRange zRange)
          Set Z range, user units.
 void stateChanged(javax.swing.event.ChangeEvent e)
          ChangeListner callback.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOP

public static final int TOP
X axis placed at top of DataGroup area.

See Also:
Constant Field Values

BOTTOM

public static final int BOTTOM
X axis placed at bottom of DataGroup area.

See Also:
Constant Field Values

LEFT

public static final int LEFT
Y axis placed left of DataGroup area.

See Also:
Constant Field Values

RIGHT

public static final int RIGHT
Y axis placed right of DataGroup area.

See Also:
Constant Field Values

MANUAL

public static final int MANUAL
Axes placed in default locations.

See Also:
Constant Field Values

LINEAR

public static final int LINEAR
Linear transform type.

See Also:
Constant Field Values

LOG

public static final int LOG
Log transform type.

See Also:
Constant Field Values

REFERENCE

public static final int REFERENCE
Refer to a transform in another DataGroup.

See Also:
Constant Field Values

TIME

public static final int TIME
Time axis type.

See Also:
Constant Field Values

PLAIN

public static final int PLAIN
Plain linear axis type.

See Also:
Constant Field Values

X_DIR

public static final int X_DIR
X direction.

See Also:
Constant Field Values

Y_DIR

public static final int Y_DIR
Y direction.

See Also:
Constant Field Values
Constructor Detail

DataGroup

public DataGroup()
Default constructor. PanelHodler is set to null. X and Y transforms are LINEAR and axes PLAIN.


DataGroup

public DataGroup(java.lang.String id,
                 PanelHolder ph)
Simple constructor. X and Y transforms are LINEAR and axes PLAIN.

Parameters:
id - data group id
ph - panelholder parent

DataGroup

public DataGroup(java.lang.String id,
                 PanelHolder ph,
                 int xt,
                 int xAxis,
                 int yt,
                 int yAxis)
Full constructor.

Parameters:
id - data group id
ph - panelholder parent
xt - x transform type
xAxis - x axis type
yt - y transform type
yAxis - y axis type
Method Detail

setPanelHolder

public void setPanelHolder(PanelHolder ph)
Set panelhodler parent.

Parameters:
ph - panelholder parent

getPanelHolder

public PanelHolder getPanelHolder()
Get parent.

Returns:
panelholder parent

getXAxisHolder

public AxisHolder getXAxisHolder()
Get X axisholder

Returns:
x axisholder

setXAxisHolder

public void setXAxisHolder(AxisHolder xah)
Set X axisholder

Parameters:
xah - x axisholder

getYAxisHolder

public AxisHolder getYAxisHolder()
Get Y axisholder.

Returns:
y axisholder

setYAxisHolder

public void setYAxisHolder(AxisHolder yah)
Set Y axisholder

Parameters:
yah - y axisholder

getId

public java.lang.String getId()
Get datagroup id.

Returns:
datagroup id

setId

public void setId(java.lang.String id)
Set datagroup id.

Parameters:
id - datagroup id

getMargin

public Margin getMargin()
Get the margin.

Returns:
margin

setMargin

public void setMargin(Margin margin)
Set the margin. The margin is used to automatically place the axes in a Panel. The margin is the distance from each edge of the Panel to the DataGroup. Default is (0.25f, 0.5f, 0.5f, 0.25f)

Parameters:
margin - margin

setMargin

public void setMargin(float top,
                      float left,
                      float bottom,
                      float right)
Set the Margin. Default is (0.25f, 0.5f, 0.5f, 0.25f)

Parameters:
top - top margin
left - left margin
bottom - bottom margin
right - right margin

removeAllChangeListeners

public void removeAllChangeListeners()
Remove all ChangeListeners.


setZAutoScale

public void setZAutoScale(boolean zAutoScale)
Set auto Z scale. Auto Z scale is only effective for grids. Default = true.

Parameters:
zAutoScale - autoscale if true

isZAutoScale

public boolean isZAutoScale()
Is auto Z scale?

Returns:
true, if auto z scale

setZRangeU

public void setZRangeU(SoTRange zRange)
Set Z range, user units. Only used if Auto Z Scale is false. Default = (0, 1, 0.1).

Parameters:
zRange - Z range

getZRangeU

public SoTRange getZRangeU()
Get Z range.

Returns:
Z range

setZoomable

public void setZoomable(boolean zoomable)
Set datagroup zoomable. If true, datagroup can be zoomed using the mouse. Default = true.

Parameters:
zoomable - datagroup zoomable

isZoomable

public boolean isZoomable()
Is datagroup zoomable?

Returns:
true, if datagroup zoomable

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener l)
Remove changelistener.

Parameters:
l - changelistener

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener l)
Add changelistener

Parameters:
l - changelistener

removeDesignChangeListeners

public void removeDesignChangeListeners()
Remove all ChangeListeners that implement the DesignListener interface.

See Also:
DesignListener

fireStateChanged

protected void fireStateChanged()

setInstantiated

public void setInstantiated(boolean instantiated)
Set instantiated. Once associated DataGroupLayer object has been created this property is set true. Used internally.

Parameters:
instantiated - true if instantiated

isInstantiated

public boolean isInstantiated()
Is datagrouplayer instantiated?

Returns:
true, if datagrouplayer instantiated

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
ChangeListner callback.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener
Parameters:
e - ChangeEvent

getNumberAutoContourLevels

public int getNumberAutoContourLevels()
Get number of auto contour levels. Valid for grid type data only.

Returns:
number of auto contour levels

setNumberAutoContourLevels

public void setNumberAutoContourLevels(int numberAutoContourLevels)
Set number of auto contour levels. Valid for grid type data only.

Parameters:
numberAutoContourLevels - number of contour levels