ucar.unidata.idv.ui
Class DataControlDialog

java.lang.Object
  extended by ucar.unidata.idv.ui.DataControlDialog
All Implemented Interfaces:
ActionListener, EventListener

public class DataControlDialog
extends Object
implements ActionListener

This class provides a list of the display controls and the data selection dialog

Version:
$Revision: 1.98 $
Author:
Jeff McWhirter

Constructor Summary
DataControlDialog(IntegratedDataViewer idv, boolean inOwnWindow, boolean horizontalOrientation)
          Constructor for when we are a part of the DataSelector
DataControlDialog(IntegratedDataViewer idv, DataChoice dataChoice, int x, int y)
          Constructor for configuring a DataChoice
 
Method Summary
 void actionPerformed(ActionEvent event)
          Handle OK, APPLY and CANCEL events
 void addCreateButton(JButton b)
          We keep track of the "Create" buttons so we can enable/disable them
 void dataSourceChanged(DataSource dataSource)
          Called by the DataSelector to handle when the data source has changed
 void displayTemplatesChanged()
          Be notified of a change to the display templates
 void dispose()
          Dispose of the dialog window (if it is created) and remove this object from the IDV's list of DataControlDialog-s
 void doClose()
          Calls dispose, nulls out references (for leaks), etc.
 JComponent doMakeDataChoiceDialog(DataChoice dataChoice)
          Make the GUI for configuring a DataChoice
protected  void doMakeWindow(JComponent contents, int x, int y)
          Make a new window with the given GUI contents and position it at the given screen location
 void doOk()
          Call doApply and close the window
 JComponent getContents()
          Return the gui contents
 DataChoice getDataChoice()
          Get the DataChoice we are representing
 DataSelectionWidget getDataSelectionWidget()
          Get the data selection widget
 DataSource getDataSource()
          Return the DataSource we are configuring
protected  ControlDescriptor getSelectedControl()
          Return the ControlDescriptor that is currently selected
 Object[] getSelectedControls()
          Find and return the array of selected ControlDescriptor-s
 void setCursor(Cursor cursor)
          Utility to set the cursor on the gui contents
 void setDataChoice(DataChoice dc)
          Set the DataChoice we are representing
 void setDataSource(DataSource ds)
          Set the data source
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataControlDialog

public DataControlDialog(IntegratedDataViewer idv,
                         boolean inOwnWindow,
                         boolean horizontalOrientation)
Constructor for when we are a part of the DataSelector

Parameters:
idv - Reference to the IDV
inOwnWindow - Should this object be in its own window
horizontalOrientation - Show display/times hor?

DataControlDialog

public DataControlDialog(IntegratedDataViewer idv,
                         DataChoice dataChoice,
                         int x,
                         int y)
Constructor for configuring a DataChoice

Parameters:
idv - Reference to the IDV
dataChoice - The DataChoice we are configuring
x - X position on the screen to show window
y - Y position on the screen to show window
Method Detail

addCreateButton

public void addCreateButton(JButton b)
We keep track of the "Create" buttons so we can enable/disable them

Parameters:
b - The create button to add into the list

getContents

public JComponent getContents()
Return the gui contents

Returns:
The gui contents

setCursor

public void setCursor(Cursor cursor)
Utility to set the cursor on the gui contents

Parameters:
cursor - The cursor to set

setDataSource

public void setDataSource(DataSource ds)
Set the data source

Parameters:
ds - The new data source

dataSourceChanged

public void dataSourceChanged(DataSource dataSource)
Called by the DataSelector to handle when the data source has changed

Parameters:
dataSource - The data source that changed

getSelectedControl

protected ControlDescriptor getSelectedControl()
Return the ControlDescriptor that is currently selected

Returns:
Selected ControlDescriptor

getSelectedControls

public Object[] getSelectedControls()
Find and return the array of selected ControlDescriptor-s

Returns:
Select control descriptors

displayTemplatesChanged

public void displayTemplatesChanged()
Be notified of a change to the display templates


setDataChoice

public void setDataChoice(DataChoice dc)
Set the DataChoice we are representing

Parameters:
dc - The current DataChoice

getDataSource

public DataSource getDataSource()
Return the DataSource we are configuring

Returns:
The DataSource

getDataChoice

public DataChoice getDataChoice()
Get the DataChoice we are representing

Returns:
The current DataChoice

doMakeDataChoiceDialog

public JComponent doMakeDataChoiceDialog(DataChoice dataChoice)
Make the GUI for configuring a DataChoice

Parameters:
dataChoice - The DataChoice
Returns:
The GUI

getDataSelectionWidget

public DataSelectionWidget getDataSelectionWidget()
Get the data selection widget

Returns:
data selection widget

doMakeWindow

protected void doMakeWindow(JComponent contents,
                            int x,
                            int y)
Make a new window with the given GUI contents and position it at the given screen location

Parameters:
contents - Gui contents
x - Screen x
y - Screen y

dispose

public void dispose()
Dispose of the dialog window (if it is created) and remove this object from the IDV's list of DataControlDialog-s


doClose

public void doClose()
Calls dispose, nulls out references (for leaks), etc.


doOk

public void doOk()
Call doApply and close the window


actionPerformed

public void actionPerformed(ActionEvent event)
Handle OK, APPLY and CANCEL events

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - The event