ucar.unidata.idv.chooser
Class IdvChooser

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by ucar.unidata.ui.ChooserPanel
                      extended by ucar.unidata.idv.chooser.IdvChooser
All Implemented Interfaces:
ActionListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, IdvConstants
Direct Known Subclasses:
BundleChooser, FileChooser, McidasImageChooser, MesoWestChooser, RaobChooser, SkeletonChooser, SoundingSelector, TimesChooser, UrlChooser, XmlChooser

public abstract class IdvChooser
extends ChooserPanel
implements IdvConstants

This is the base class of all Chooser classes.

Version:
$Revision: 1.91 $Date: 2007/07/27 20:59:03 $
Author:
IDV development team
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String ATTR_ID
          Name of the id attribute in the choosers.xml
static String ATTR_SHOWDETAILS
          Name of the details attribute in the choosers.xml
protected  JComboBox dirHistoryCbx
          For the dir history
protected  boolean ignoreDirHistory
          For the dir history
static Hashtable NULL_PROPERTIES
          Can pass in null properties.
static String NULL_STRING
          Like above, a handy way to pass in a null string
static String PREF_ADDESERVERS
          Used by derived classes to save the list of adde servers
static String PREF_CATALOGLIST
          Used by derived classes to save the list of catalogs
static String PREF_DEFAULTDIR
          Used by derived classes to save the last directory the user was in
static String PREF_IMAGEDESCLIST
          Used by derived classes to save the list of image descriptors
static String PREF_POLLINGINFO
          Saves off the pollinginfo_
static String PREF_RADARDESCLIST
          Used by derived classes to save the list of radar descriptors
static String PREF_TDSPOINTOBSERVER
          Used by derived classes to save the list of tds point ob servers
static String PREF_TDSRADARSERVER
          Used by derived classes to save the list of tds radar servers
static String PROP_CHOOSER_MAPS
          Where we get the maps
static String PROP_CHOOSER_PROJECTION_BOUNDS
          Where we get the projection bounds
static String PROP_CHOOSERCLASSNAME
          _more_
static String PROP_STATUS_BACKGROUND
          status background color
static String PROP_STATUS_FOREGROUND
          status foreground color
static String PROP_STATUS_TEMPLATE
          status template
protected  StationLocationMap stationMap
          station location map
 
Fields inherited from class ucar.unidata.ui.ChooserPanel
cancelButton, CMD_LOAD, contents, GRID_INSETS, GRID_SPACING, GRID_SPACING_H, GRID_SPACING_V, haveData, helpPath, loadButton, MAP_COLOR, simpleMode, statusLabel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_MAX_PERMGENSIZE, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAX_PERMGENSIZE, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
IdvChooser(IdvChooserManager chooserManager, Element chooserNode)
          Create the chooser
IdvChooser(IntegratedDataViewer idv, Element chooserNode)
          Create the chooser
IdvChooser(IntegratedDataViewer idv, IdvChooserManager chooserManager, Element chooserNode)
          Create the chooser
 
Method Summary
protected  void clearSelectedStations()
          Clear any selected stations.
protected  void clearStations()
          Clear all stations in the station map.
protected  void closeChooser()
          Close the chooser window
protected  StationLocationMap createStationMap()
          Create the station map
 JComponent decorateButtons(JComponent buttons)
          Add extra components to "decorate" the button panel
 void doCancel()
          Handle a cancel
 void doClose()
          Close the chooser window
static void errorMessage(String msg)
          Helper method to show a user error message
protected  String getAttribute(String name, String dflt)
          Utility to get the attribute from the chooser xml node.
 JComponent getContents()
          Create and return the GUI contents.
 DataManager getDataManager()
          Return the DataManager
 DataSource getDataSource()
          Get the DataSource property.
protected  String getDataSourceId()
          If the dataSources combo box is non-null then return the data source id the user selected.
protected  String getDataSourceId(JComboBox dataSourcesCbx)
          Get the data source ID for the particular item selected in the box
protected  void getDataSourceProperties(Hashtable ht)
          Get the properties from the datasource
protected  JComboBox getDataSourcesComponent()
          Return the component that holds the dataSources combo box
protected  JComboBox getDataSourcesComponent(boolean justFileSources)
          Return the component that holds the dataSources combo box
static JComboBox getDataSourcesComponent(boolean justFileSources, DataManager dataManager)
          Return the component that holds the dataSources combo box
static JComboBox getDataSourcesComponent(boolean justFileSources, DataManager dataManager, boolean addLucky)
          Get the component for listing data source types
 JComponent getDefaultButtons(ActionListener listener)
          Get the default buttons
protected  String getDefaultDisplayType()
          Get the default display type
protected  String getDefaultMap()
          Get the default map to be used.
protected  List getDefaultMaps()
          Get the default map to be used.
protected  ucar.unidata.geoloc.ProjectionImpl getDefaultProjection()
          Create and return the default projection used for the station map.
protected  ucar.unidata.geoloc.ProjectionRect getDefaultProjectionRect()
          Create and return the default projection rect used for the station map.
protected  boolean getHaveStations()
          Do we have stations
 String getId()
          Return the id
 IntegratedDataViewer getIdv()
          Getter method to return the IDV
 String getMenuTitle()
          Get the title to use for menu entries.
 PreferenceList getPreferenceList(String listProp)
          Find the PreferenceList associated with the given property.
 PreferenceList getPreferenceList(String listProp, boolean mergeTheIdvProperty)
          Find the PreferenceList associated with the given property.
 PreferenceList getPreferenceList(String listProp, boolean mergeTheIdvProperty, List butNotThese)
          Find the PreferenceList associated with the given listProp.
 PreferenceList getPreferenceList(String listProp, boolean mergeTheIdvProperty, String butNotThisOne)
          Find the PreferenceList associated with the given listProp.
 boolean getProperty(String name, boolean dflt)
          Utility to get a boolean property
 String getProperty(String name, String dflt)
          Utility to get a String property
 List getPropList(String property, boolean mergeTheIdvProperty)
          Find the list (of Strings) defined by the property name
protected  String getSelectedStation()
          Get the first seleted station or null if none selected.
 List getSelectedStations()
          Get list of selected stations, objects of ucar/unidata/metdata/NamedStationImpl class
 boolean getShowInMenu()
          Should this chooser entry be shown in the file menu
protected  StationLocationMap getStationMap()
          Create (if needed) and return the station map
protected  JLabel getStatusLabel()
          Create (if needed) and return the JLabel that shows the status messages.
 Color getStatusLabelBackground()
          get the status label background color
 Color getStatusLabelForeground()
          Get the status label foreground color
 String getTitle()
          Get the title
 Element getXmlNode()
          Get the xml node that defined this chooser
protected  boolean haveStationSelected()
          If there is a station map created then return whether there are any stations selected.
protected  void init()
          Initialize after creation
protected  void initChooserPanel(ChooserPanel chooserPanel)
          Initialize the given panel.
protected  void initStationMap(StationLocationMap stationMap)
          Initialize the stations
 boolean isReloadable()
          _more_
 void logException(String msg, Exception exc)
          Helper method that calls LogUtil.printException
protected  boolean makeDataSource(Object definingObject, Hashtable properties)
          Create the data source defined by the given definingObject (e.g., a string filename, a list of images, etc.
protected  boolean makeDataSource(Object definingObject, String dataType, Hashtable properties)
          Create the data source defined by the given definingObject (ex: a string filename, a list of images).
 List makeTimeMenus(ActionListener listener)
          Make time menus
protected  void newSelectedStations(List stations)
          Notify of new selected stations.
protected  void resetDataSourceId()
          Clear the dataSources combo box
 void setDataSource(DataSource value)
          Set the DataSource property.
 void setDataSourceListener(ActionListener listener)
          Set the data source listener
protected  boolean shouldDoUpdateOnFirstDisplay()
          As the name implies should this chooser do call doUpdate the first time it is painted.
 void showNormalCursor()
          show regular cursor
 void showWaitCursor()
          show wait cursor
protected  Object startTask()
          Start the task
protected  void stopTask(Object taskId)
          Stop the task
protected  boolean stopTaskAndIsOk(Object taskId)
          See if we can stop the task and it's okay
protected  boolean taskOk(Object taskId)
          Is the task ok?
protected  void updateStatus()
          Update the status
static void userMessage(String msg)
          Helper method to show a user message
protected  boolean usingStations()
          Is this chooser using the station map
 
Methods inherited from class ucar.unidata.ui.ChooserPanel
actionPerformed, addPropertyChangeListener, canDoUpdate, clearWaitCursor, doHelp, doLoad, doLoadInThread, doMakeContents, doUpdate, firePropertyChange, getButtonLabels, getDefaultButtons, getHaveData, getLoadCommandName, getLoadToolTip, getMessageTemplate, getSimpleMode, getStatusComponent, getUpdateToolTip, padLabel, registerStatusComp, revalidate, setHaveData, setHelpPath, setMessageTemplate, setStatus, setStatus, showNormalCursor, showWaitCursor
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PROP_CHOOSER_MAPS

public static final String PROP_CHOOSER_MAPS
Where we get the maps

See Also:
Constant Field Values

PROP_STATUS_FOREGROUND

public static final String PROP_STATUS_FOREGROUND
status foreground color

See Also:
Constant Field Values

PROP_STATUS_BACKGROUND

public static final String PROP_STATUS_BACKGROUND
status background color

See Also:
Constant Field Values

PROP_STATUS_TEMPLATE

public static final String PROP_STATUS_TEMPLATE
status template

See Also:
Constant Field Values

PROP_CHOOSER_PROJECTION_BOUNDS

public static final String PROP_CHOOSER_PROJECTION_BOUNDS
Where we get the projection bounds

See Also:
Constant Field Values

PROP_CHOOSERCLASSNAME

public static final String PROP_CHOOSERCLASSNAME
_more_

See Also:
Constant Field Values

NULL_PROPERTIES

public static final Hashtable NULL_PROPERTIES
Can pass in null properties. So instead of a null or casting null as a Hashtable we just define one here


NULL_STRING

public static final String NULL_STRING
Like above, a handy way to pass in a null string


PREF_DEFAULTDIR

public static final String PREF_DEFAULTDIR
Used by derived classes to save the last directory the user was in

See Also:
Constant Field Values

PREF_POLLINGINFO

public static final String PREF_POLLINGINFO
Saves off the pollinginfo_

See Also:
Constant Field Values

PREF_CATALOGLIST

public static final String PREF_CATALOGLIST
Used by derived classes to save the list of catalogs

See Also:
Constant Field Values

PREF_ADDESERVERS

public static final String PREF_ADDESERVERS
Used by derived classes to save the list of adde servers

See Also:
Constant Field Values

PREF_IMAGEDESCLIST

public static final String PREF_IMAGEDESCLIST
Used by derived classes to save the list of image descriptors

See Also:
Constant Field Values

PREF_RADARDESCLIST

public static final String PREF_RADARDESCLIST
Used by derived classes to save the list of radar descriptors

See Also:
Constant Field Values

PREF_TDSRADARSERVER

public static final String PREF_TDSRADARSERVER
Used by derived classes to save the list of tds radar servers

See Also:
Constant Field Values

PREF_TDSPOINTOBSERVER

public static final String PREF_TDSPOINTOBSERVER
Used by derived classes to save the list of tds point ob servers

See Also:
Constant Field Values

ATTR_ID

public static final String ATTR_ID
Name of the id attribute in the choosers.xml

See Also:
Constant Field Values

ATTR_SHOWDETAILS

public static final String ATTR_SHOWDETAILS
Name of the details attribute in the choosers.xml

See Also:
Constant Field Values

ignoreDirHistory

protected boolean ignoreDirHistory
For the dir history


dirHistoryCbx

protected JComboBox dirHistoryCbx
For the dir history


stationMap

protected StationLocationMap stationMap
station location map

Constructor Detail

IdvChooser

public IdvChooser(IntegratedDataViewer idv,
                  Element chooserNode)
Create the chooser

Parameters:
idv - The IDV
chooserNode - The Xml

IdvChooser

public IdvChooser(IdvChooserManager chooserManager,
                  Element chooserNode)
Create the chooser

Parameters:
chooserManager - The manager of all of the choosers
chooserNode - The Xml

IdvChooser

public IdvChooser(IntegratedDataViewer idv,
                  IdvChooserManager chooserManager,
                  Element chooserNode)
Create the chooser

Parameters:
idv - The IDV
chooserManager - The manager of all of the choosers
chooserNode - The Xml
Method Detail

getStatusLabel

protected JLabel getStatusLabel()
Create (if needed) and return the JLabel that shows the status messages.

Overrides:
getStatusLabel in class ChooserPanel
Returns:
The status label

decorateButtons

public JComponent decorateButtons(JComponent buttons)
Add extra components to "decorate" the button panel

Parameters:
buttons - button panel
Returns:
decorated buttons

getDefaultButtons

public JComponent getDefaultButtons(ActionListener listener)
Get the default buttons

Overrides:
getDefaultButtons in class ChooserPanel
Parameters:
listener - the listener
Returns:
the button component

getDefaultDisplayType

protected String getDefaultDisplayType()
Get the default display type

Returns:
the name of the default display

getDataSourceProperties

protected void getDataSourceProperties(Hashtable ht)
Get the properties from the datasource

Parameters:
ht - a Hashtable of properties

getDefaultMap

protected String getDefaultMap()
Get the default map to be used. For now needs to be a mcidas map.

Returns:
Default map.

getDefaultMaps

protected List getDefaultMaps()
Get the default map to be used. For now needs to be a mcidas map.

Returns:
Default map.

initStationMap

protected void initStationMap(StationLocationMap stationMap)
Initialize the stations

Parameters:
stationMap - The station map

createStationMap

protected StationLocationMap createStationMap()
Create the station map

Returns:
The new station map.

usingStations

protected boolean usingStations()
Is this chooser using the station map

Returns:
Using stations.

haveStationSelected

protected boolean haveStationSelected()
If there is a station map created then return whether there are any stations selected.

Returns:
Any stations selected.

newSelectedStations

protected void newSelectedStations(List stations)
Notify of new selected stations.

Parameters:
stations - Selected stations.

getStationMap

protected StationLocationMap getStationMap()
Create (if needed) and return the station map

Returns:
The station map

getSelectedStations

public List getSelectedStations()
Get list of selected stations, objects of ucar/unidata/metdata/NamedStationImpl class

Returns:
list of selected stations

getSelectedStation

protected String getSelectedStation()
Get the first seleted station or null if none selected.

Returns:
Get a selected station.

clearSelectedStations

protected void clearSelectedStations()
Clear any selected stations.


clearStations

protected void clearStations()
Clear all stations in the station map.


getHaveStations

protected boolean getHaveStations()
Do we have stations

Returns:
true if there is a station map and there are stations set

getDefaultProjection

protected ucar.unidata.geoloc.ProjectionImpl getDefaultProjection()
Create and return the default projection used for the station map.

Returns:
_Default map projection

getDefaultProjectionRect

protected ucar.unidata.geoloc.ProjectionRect getDefaultProjectionRect()
Create and return the default projection rect used for the station map.

Returns:
Default map projection rectangle

makeTimeMenus

public List makeTimeMenus(ActionListener listener)
Make time menus

Parameters:
listener - the listener for this
Returns:
a list of options for times from each display

getXmlNode

public Element getXmlNode()
Get the xml node that defined this chooser

Returns:
The chooser node

getAttribute

protected String getAttribute(String name,
                              String dflt)
Utility to get the attribute from the chooser xml node. If there is one we'll also apply the global macros

Parameters:
name - attr name
dflt - default value
Returns:
attribute

getProperty

public String getProperty(String name,
                          String dflt)
Utility to get a String property

Parameters:
name - property name
dflt - default value
Returns:
property or default

getProperty

public boolean getProperty(String name,
                           boolean dflt)
Utility to get a boolean property

Parameters:
name - property name
dflt - default value
Returns:
property or default

getShowInMenu

public boolean getShowInMenu()
Should this chooser entry be shown in the file menu

Returns:
Show this chooser in the file menu?

getMenuTitle

public String getMenuTitle()
Get the title to use for menu entries.

Returns:
Menu title

getTitle

public String getTitle()
Get the title

Returns:
The title

initChooserPanel

protected void initChooserPanel(ChooserPanel chooserPanel)
Initialize the given panel. Set the help path on it.

Parameters:
chooserPanel - The panel to initialize.

getDataSourcesComponent

protected JComboBox getDataSourcesComponent()
Return the component that holds the dataSources combo box

Returns:
The GUI for the data sources selector

getDataSourcesComponent

protected JComboBox getDataSourcesComponent(boolean justFileSources)
Return the component that holds the dataSources combo box

Parameters:
justFileSources - If true then just use data sources that access files
Returns:
The GUI for the data sources selector

getDataSourcesComponent

public static JComboBox getDataSourcesComponent(boolean justFileSources,
                                                DataManager dataManager)
Return the component that holds the dataSources combo box

Parameters:
justFileSources - If true then just use data sources that access files
dataManager - The data manager
Returns:
The GUI for the data sources selector

getDataSourcesComponent

public static JComboBox getDataSourcesComponent(boolean justFileSources,
                                                DataManager dataManager,
                                                boolean addLucky)
Get the component for listing data source types

Parameters:
justFileSources - true for just files
dataManager - the data manager
addLucky - true to add the "I'm Feeiling Lucky" option
Returns:
the component

getDataSourceId

protected String getDataSourceId()
If the dataSources combo box is non-null then return the data source id the user selected. Else, return null

Returns:
Data source id

getDataSourceId

protected String getDataSourceId(JComboBox dataSourcesCbx)
Get the data source ID for the particular item selected in the box

Parameters:
dataSourcesCbx - the list of source descriptions
Returns:
the id of the selected data source type

resetDataSourceId

protected void resetDataSourceId()
Clear the dataSources combo box


makeDataSource

protected boolean makeDataSource(Object definingObject,
                                 Hashtable properties)
Create the data source defined by the given definingObject (e.g., a string filename, a list of images, etc.

Parameters:
definingObject - What defines the data source
properties - extra properties
Returns:
Was this creation successful

setDataSourceListener

public void setDataSourceListener(ActionListener listener)
Set the data source listener

Parameters:
listener - the listener

isReloadable

public boolean isReloadable()
_more_

Returns:
_more_

makeDataSource

protected boolean makeDataSource(Object definingObject,
                                 String dataType,
                                 Hashtable properties)
Create the data source defined by the given definingObject (ex: a string filename, a list of images). If dataType is non-null then it defines a data source id (defined in idv/resources/datasources.xml)

Else the creation is done by looking at the string value of the defining object and seeing if it matches any of the patterns that are defined in datasources.xml

One more way to define what data source to create is to add the id into the properties Hashable using DataManager.DATATYPE_ID

Parameters:
definingObject - What defines the data source
dataType - Define the data type to create
properties - extra properties
Returns:
Was this creation successful

startTask

protected Object startTask()
Start the task

Returns:
the task id

stopTask

protected void stopTask(Object taskId)
Stop the task

Parameters:
taskId - the task id

stopTaskAndIsOk

protected boolean stopTaskAndIsOk(Object taskId)
See if we can stop the task and it's okay

Parameters:
taskId - the task id
Returns:
true if ok

taskOk

protected boolean taskOk(Object taskId)
Is the task ok?

Parameters:
taskId - the task id
Returns:
true if ok

showWaitCursor

public void showWaitCursor()
show wait cursor

Overrides:
showWaitCursor in class ChooserPanel

showNormalCursor

public void showNormalCursor()
show regular cursor

Overrides:
showNormalCursor in class ChooserPanel

doClose

public void doClose()
Close the chooser window

Overrides:
doClose in class ChooserPanel

doCancel

public void doCancel()
Handle a cancel

Overrides:
doCancel in class ChooserPanel

closeChooser

protected void closeChooser()
Close the chooser window


init

protected void init()
Initialize after creation


shouldDoUpdateOnFirstDisplay

protected boolean shouldDoUpdateOnFirstDisplay()
As the name implies should this chooser do call doUpdate the first time it is painted. This is a hook for derived classes to specify this behavior.

Returns:
Should update

getContents

public final JComponent getContents()
Create and return the GUI contents.

Overrides:
getContents in class ChooserPanel
Returns:
The GUI

updateStatus

protected void updateStatus()
Update the status

Overrides:
updateStatus in class ChooserPanel

getDataManager

public DataManager getDataManager()
Return the DataManager

Returns:
The data manager

getId

public String getId()
Return the id

Returns:
The id

getIdv

public IntegratedDataViewer getIdv()
Getter method to return the IDV

Returns:
The idv

logException

public void logException(String msg,
                         Exception exc)
Helper method that calls LogUtil.printException

Overrides:
logException in class ChooserPanel
Parameters:
msg - The message
exc - The exception

errorMessage

public static void errorMessage(String msg)
Helper method to show a user error message

Parameters:
msg - The message

userMessage

public static void userMessage(String msg)
Helper method to show a user message

Parameters:
msg - The message

getPreferenceList

public PreferenceList getPreferenceList(String listProp)
Find the PreferenceList associated with the given property.

Parameters:
listProp - The property name
Returns:
The PreferenceList

getPreferenceList

public PreferenceList getPreferenceList(String listProp,
                                        boolean mergeTheIdvProperty)
Find the PreferenceList associated with the given property.

Parameters:
listProp - The property name
mergeTheIdvProperty - If true, then we also lookup the String property from the IDV and merge it into the list.
Returns:
The PreferenceList

getPreferenceList

public PreferenceList getPreferenceList(String listProp,
                                        boolean mergeTheIdvProperty,
                                        String butNotThisOne)
Find the PreferenceList associated with the given listProp.

Parameters:
listProp - The property key
mergeTheIdvProperty - If true, then we also lookup the String property from the IDV and merge it into the list.
butNotThisOne - If non-null then we don't include this property. This is used to remove old catalogs from the XmlChooser's list
Returns:
The PreferenceList

getPreferenceList

public PreferenceList getPreferenceList(String listProp,
                                        boolean mergeTheIdvProperty,
                                        List butNotThese)
Find the PreferenceList associated with the given listProp.

Parameters:
listProp - The property key
mergeTheIdvProperty - If true, then we also lookup the String property from the IDV and merge it into the list.
butNotThese - If non-null or empty then we don't include these properties. This is used to remove old values from the list
Returns:
The PreferenceList

getPropList

public List getPropList(String property,
                        boolean mergeTheIdvProperty)
Find the list (of Strings) defined by the property name

Parameters:
property - The property name
mergeTheIdvProperty - If true, then we also lookup the String property from the IDV and merge it into the list.
Returns:
Property list

getStatusLabelBackground

public Color getStatusLabelBackground()
get the status label background color

Overrides:
getStatusLabelBackground in class ChooserPanel
Returns:
the status label background color

getStatusLabelForeground

public Color getStatusLabelForeground()
Get the status label foreground color

Overrides:
getStatusLabelForeground in class ChooserPanel
Returns:
the status label foreground color

setDataSource

public void setDataSource(DataSource value)
Set the DataSource property.

Parameters:
value - The new value for DataSource

getDataSource

public DataSource getDataSource()
Get the DataSource property.

Returns:
The DataSource