ucar.unidata.idv
Class IntegratedDataViewer

java.lang.Object
  extended by ucar.unidata.idv.IdvBase
      extended by ucar.unidata.idv.IntegratedDataViewer
All Implemented Interfaces:
ActionListener, EventListener, HyperlinkListener, DataContext, ControlContext, IdvConstants, IdvContext, ViewContext, LogUtil.DialogManager, XmlPersistable
Direct Known Subclasses:
DefaultIdv, IdvServer.MyIdv, MultiPaneIdv

public class IntegratedDataViewer
extends IdvBase
implements ControlContext, ViewContext, DataContext, ActionListener, HyperlinkListener, LogUtil.DialogManager

This is the central class for IDV applications. It is abstract and needs a concrete derived class to overwrite the doMakeContents method. (e.g., DefaultIdv). This class serves as the nexus of a collection of editors and managers (e.g., IdvUIManager, VMManager, etc.) Its base class, IdvBase, holds these editors and managers and uses a set of factory methods (e.g., doMakeStationModelManager) for creating them. One can override, in a derived class, one of these factory methods to create special purpose components or handlers.

To run the IDV you:

Author:
IDV development team

Field Summary
protected  Hashtable controlDescriptorMap
          Mapping from control descriptor id to ControlDescriptor
protected  List controlDescriptors
          List of the ControlDescriptors defined in the controls.xml file
protected  List displayControls
          List of all of the DisplayControls currently active
 
Fields inherited from class ucar.unidata.idv.IdvBase
aliasEditor, args, argsManager, autoDisplayEditor, chooserManager, collabManager, colorTableEditor, colorTableManager, dataManager, displayConventions, idv, imageGenerator, installManager, jythonManager, paramDefaultsEditor, paramGroupsEditor, persistenceManager, pluginManager, preferenceManager, projectionManager, publishManager, resourceManager, resourceViewer, stateManager, stationModelManager, testManager, uiManager, vmManager
 
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_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, 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_LARGE_REMOTE_DATA_WARN, 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
 
Constructor Summary
IntegratedDataViewer()
          Parameterless constructor.
IntegratedDataViewer(boolean interactiveMode)
          Ctor for when some other code is calling us.
IntegratedDataViewer(String[] args)
          The main constructor.
IntegratedDataViewer(String[] args, boolean interactiveMode)
          ctor
 
Method Summary
 void actionPerformed(ActionEvent event)
          Implementation of the ActionListener interface.
protected  void addControlDescriptor(ControlDescriptor cd)
          Add a new ControlDescriptor into the controlDescriptor list and controlDescriptorMap hashtable.
 void addDisplayControl(DisplayControl control)
          Add the given DisplayControl into the list of display controls.
 void addErrorButtons(JDialog dialog, List buttonList, String msg, Throwable exc)
          Implement the LogUtil.DialogManager interface to add buttons to the dialog.
 void addToHistoryList(History newHistory)
          Add the given History object into the history list.
 void addToHistoryList(String filename)
          Add the given file to the history list.
 void applyPreferences()
          Apply preferences.
protected  void checkSystem()
          Check whether the system has the necessary components (ex: Java 3D).
 void cleanup()
          Remove all state, etc.
protected  void clearCachedData()
          This is called when the CacheManager detects the need ot clear memory.
 void clearHistoryList()
          Empty the history list and write it out.
 void clearWaitCursor()
          Pass through to IdvUIManager.clearWaitCursor()
 void closeCurrentWindow()
          close current window
 void controlHasBeenInitialized(DisplayControl control)
          Called by the given DisplayControl when it has been fully initialized.
 DataSelector createDataSelector()
          Create a DataSelector window.
 DataSourceResults createDataSource(Object definingObject, String dataType, Hashtable properties, boolean checkAlias)
          Create the data source (or data sources) defined by the given definingObject.
 DisplayControl createDisplay(String dataSourceName, String paramName, String displayName, String properties)
          Create a display from the given datasource/paramname pair.
 DisplayControl createDisplay(String dataSourceName, String paramName, String displayName, String properties, boolean initDisplayInThread)
          Create a display from the given datasource/paramname pair.
 void createImage(String imageName, String dataSourceName, String paramName, String displayName)
          This method loads in the data, creates the display from the given paramName and writes out a screen image.
 void createNewWindow()
          Create a new window containing a new MapViewManager
 void dataSourceChanged(DataSource source)
          Implementation of the DataContext method.
 Object decodeObject(String xml)
          Create and return the Object defined by the given xml.
 void doClearDefaults()
          Called from the menu command to clear the default bundle
 void doImport()
          Have the user select an xidv bundle file and then unpersist the bundle.
 void doMakeBackgroundImage()
          Make the background wms image
 DisplayControl doMakeControl(DataChoice dataChoice, ControlDescriptor descriptor, String properties)
          Create the DisplayControl, identified by the given ControlDescriptor for the given DataChoice
 DisplayControl doMakeControl(DataChoice dataChoice, ControlDescriptor descriptor, String properties, DataSelection dataSelection)
          Create the DisplayControl, identified by the given ControlDescriptor for the given DataChoice
 DisplayControl doMakeControl(List dataChoices, ControlDescriptor descriptor)
          Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices
 DisplayControl doMakeControl(List dataChoices, ControlDescriptor descriptor, Hashtable properties, DataSelection dataSelection)
          Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices
 DisplayControl doMakeControl(List dataChoices, ControlDescriptor descriptor, Hashtable properties, DataSelection dataSelection, boolean initDisplayInThread)
          Finally, we really create the DisplayControl, identified by the given * ControlDescriptor using the given list of DataChoices
 DisplayControl doMakeControl(List dataChoices, ControlDescriptor descriptor, String propertiesString, DataSelection dataSelection)
          Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices
 DisplayControl doMakeControl(List dataChoices, ControlDescriptor descriptor, String propertiesString, DataSelection dataSelection, boolean initDisplayInThread)
          Finally, we really create the DisplayControl, identified by the given ControlDescriptor using the given list of DataChoices
 DisplayControl doMakeControl(String controlName)
          This method is called by the helptips, passing in the name of the display control (from controls.xml).
 DisplayControl doMakeControl(String controlName, DataChoice dataChoice)
          make a control
 DisplayControl doMakeControl(String controlName, List dataChoices)
          make a control
 JMenu doMakeDataChoiceMenu(DataChoice dataChoice)
          Make and return the menu of commands that can be applied to the given DataChoice.
 void doOpen()
          Have the user select an xidv bundle file, remove all data sources and displays, and then unpersist the bundle.
 void doOpen(String bundleUri)
          Load in the given bundle.
 void doOpen(String filename, boolean checkUserPreference, boolean andRemove)
          Have the user select an xidv file.
 void doOpenDefault()
          Called from the menu command to open the default bundle
 void doSave()
          Save the current state off to the current xidv filename
 void doSaveAs()
          Have the user select an xidv filename and write the current application state to it.
 void doSaveAsDefault()
          Called from the menu command to save the current state as the default bundle
 String encodeObject(Object object, boolean prettyPrint)
          Return the xml representation of the given object.
 void evaluateAndSave(DataChoice dataChoice)
          Evalute the data choice and then save it off in a CacheDataSource
protected  void exit(int exitCode)
          Exit the application.
 void flushDataCache()
          Flush the data cache
 List getAllControlDescriptors()
          Return all the ControlDescriptors
 List getAllDataSources()
          Gets all of the data sources.
 boolean getAllDisplaysIntialized()
          Have all of the displays been initialixed
 List getBackgroundImages()
          Get the background images resource
 JCheckBox getChangeDataPathCbx()
          Get the checkbox to show to change data
 boolean getChangeDataPaths()
          Did the user select to change the data paths when loading in a bundle
 ControlDescriptor getControlDescriptor(String name)
          Return the ControlDescriptor with the given name, or null if not found.
 List getControlDescriptors()
          This returns the set of ControlDescriptors that can be shown.
 List getControlDescriptors(boolean includeTemplates)
          This returns the set of ControlDescriptors that can be shown.
 List getDataSources()
          Wrapper method around DataManager.getDataSources().
 List getDerivedDataChoices(DataSource dataSource, List dataChoices)
          Get the list of derived data choices
 List getDisplayControls()
          Return the list of DisplayControls currently active
protected  XmlEncoder getEncoder()
          Get the XmlEncoder for this instance
protected  XmlEncoder getEncoder(boolean forRead)
          Create an XmlEncoder and initialize it with the VisADPersistence delegates.
 XmlEncoder getEncoderForRead()
          Create a new XmlEncoder for doing unpersisting.
 XmlEncoder getEncoderForWrite()
          Create a new XmlEncoder for doing persisting.
 boolean getHaveInitialized()
          Has this IDV been fully initialized
 List getHistory()
          Create, if needed, and return the history list.
 boolean getInteractiveMode()
          Are we interactive
 List getLocationList()
          Create (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.
 int getMaxDataThreadCount()
          Get the max number of threads to be used when reading data
 int getMaxPermGenSize()
          Get the max size of the perm gen space
 int getMaxRenderThreadCount()
          Get the max number of threads to be used when rendering in visad
protected  List getProjections()
          Return the list of Projections
 boolean getServerMode()
          See if we are in server mode or not
protected  byte[] getStaticImage(String bundle)
          Get image
 boolean getUseTimeDriver()
          Get whether we are using the time driver facility
 ViewManager getViewManager()
          Create, if needed, and return the default 3d view manager
 ViewManager getViewManager(ViewDescriptor viewDescriptor)
          Implementation of the ControlContext interface call.
 ViewManager getViewManager(ViewDescriptor viewDescriptor, boolean newWindow, String properties)
          Creates, if needed, and returns the ViewManager that is specified by the given ViewDescriptor
 String getViewManagerProperties()
          Return a String of semi-colon separated name=value pairs that define the default properties for ViewManagers.
 boolean handleAction(String action)
          handle action
 boolean handleAction(String action, Hashtable properties)
          This method tries to handle the given action.
 boolean handleAction(String action, Hashtable properties, boolean checkForAlias)
          This method tries to handle the given action.
protected  boolean handleFileOrUrlAction(String action, Hashtable properties)
          This method checks if the given action is one of the following.
 void hyperlinkUpdate(HyperlinkEvent e)
          Implement the hyperlinklistener interface.
 void hyperlinkUpdate(HyperlinkEvent e, Hashtable properties)
          Handle the click
protected  void init()
          This is a wrapper that calls initInner within a thread.
 void initCacheManager()
          Set the state in the cache manager
 void initDone()
          Gets called when all initialization is finished.
protected  void initEncoder(XmlEncoder encoder, boolean forRead)
          A hook so derived classes can add their own initialization to the given encoder.
protected  void initInner()
          Build the gui, process bundles, etc.
protected  void initPreferences(IdvPreferenceManager preferenceManager)
          Add into the IdvPreferenceManager the different gui components/preference managers
 void initPropertyFiles(List files)
          A hook to allow derived classes to add in their own property files.
 String listApi(Object o)
          Utility to list the public api of the given object
protected  void loadDataFiles(List files)
          Load in a datasource for each file/url in the given files list.
 boolean loadDataSource(DataSource dataSource)
          Load in a DataSource.
 void loadRbiFile(String filename)
          Sometime we will be able to dynamically load in a rbi file (resource bundle)
 void logException(String msg, Throwable exc)
          Helper method that calls LogUtil.printException
static void main(String[] args)
          Default main implementation.
 void makeDataSource(DataSourceDescriptor descriptor)
          Make the data source.
 boolean makeDataSource(Object definingObject, String dataType, Hashtable properties)
          Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.
 boolean makeDataSource(Object definingObject, String dataType, Hashtable properties, boolean checkAlias)
          Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.
 boolean makeDataSource(Object definingObject, String dataType, Hashtable properties, boolean checkAlias, String displayType)
          Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.
 DataSourceResults makeDataSourceFromXml(String dataSourceXml)
          This creates a new data source from the xml encoded representation of a persisted data source.
 JComponent makeHelpButton(String helpId)
          Make a help button for a particular help topic
 JComponent makeHelpButton(String helpId, String toolTip)
          Make a help button for a particular help topic
 DataSource makeOneDataSource(Object definingObject, String dataType, Hashtable properties)
          A helper method that will create a data source from the given defining object (e.g., url, filename, collection of images, etc.) and dataType, will show any errors, and, if a data source was created will return it.
 void moveHistoryToFront(History history)
          Move a history to the front of the list
 boolean okToShowWindows()
          Is it ok to show any windows.
 void printCache()
          Call CacheManager.printStats
 void printCacheStats()
          Print cache statistics
 void printDataCacheStats()
          Print the data cache stats
static void processScript(String scriptFile)
          Get the image from the given isl script.
 boolean quit()
          Called to end execution of this process.
 void registerHelpKey(JComponent comp, String helpId)
          Register a help key for a component
 void reloadAllDataSources()
          reload all data sources
 void removeAllDataSources()
          Remove all current data sources.
 void removeAllDisplays()
          Remove all of the displays.
 void removeAllDisplays(boolean payAttentionToCanDoRemoveAll)
          remove all displays
 void removeDataSource(DataSource dataSource)
          Remove the data source from the DataManager and from any DataTree-s.
 void removeDisplayControl(DisplayControl control)
          Remove the given DisplayControl from the list of display controls.
protected  void runImageServer(int port, String propertyFile)
          startup and run the image server
 void saveInCache(DataChoice dataChoice, Data data)
          Clone the data choice and then save it off in a CacheDataSource
 void saveInCache(DataChoice dataChoice, Data data, DataSelection dataSelection)
          Save the given data in the CacheDataSource
 void saveInCache(DataChoice dataChoice, Data data, DataSelection dataSelection, String name)
          Clone the data choice and then save it off in a CacheDataSource
 void saveInCache(DataChoice dataChoice, Data data, String name)
          Clone the data choice and then save it off in a CacheDataSource
 DataChoice selectDataChoice(ControlDescriptor descriptor)
          Popup a dialog containing a DataTree showing the DataChoices that are applicable to the given ControlDescriptor.
 List selectDataChoices(List fullParamNames)
          Popup a dialog containing a DataTree for each operand in the given fullParamNames list Return a List of DataChoice's the user selects or null if they canceled.
 String selectDataType(Object definingObject)
          Ask the user to select a data type for the given defining object
 String selectDataType(Object definingObject, String message)
          Popup a dialog to allows the user to select data source type
 List selectUserChoices(String msg, List userChoices)
          Popup a JTextField containing dialog that allows the user to enter text values, one for each name in the userChoices List.
 void showConsole()
          Show the error message console.
 void showNormalCursor()
          Pass through to IdvUIManager.showNormalCursor()
 void showWaitCursor()
          Pass through to IdvUIManager.showWaitCursor()
 void showWindow(DisplayControl control, IdvWindow window)
          Implementation of the ControlContext method.
protected  void startMonitor()
          Start up the IDV montior server.
 void toFront(DisplayControl control)
          Move the given display control to the front.
 void waitLabelClicked()
          The user clicked on the wait label
 void waitUntilDisplaysAreDone()
          Wait until the displays have been rendered
 void writeHistoryList()
          Persist the history list into its own file.
 
Methods inherited from class ucar.unidata.idv.IdvBase
addPluginClass, createElement, doMakeAliasEditor, doMakeArgsManager, doMakeAutoDisplayEditor, doMakeCollabManager, doMakeColorTableEditor, doMakeColorTableManager, doMakeDataManager, doMakeDisplayConventions, doMakeIdvChooserManager, doMakeIdvProjectionManager, doMakeIdvUIManager, doMakeImageGenerator, doMakeInstallManager, doMakeJythonManager, doMakeParamDefaultsEditor, doMakeParamGroupsEditor, doMakePersistenceManager, doMakePluginManager, doMakePreferenceManager, doMakePublishManager, doMakeResourceManager, doMakeResourceViewer, doMakeStateManager, doMakeStationModelManager, doMakeTestManager, doMakeVMManager, getAliasEditor, getArgsManager, getAutoDisplayEditor, getCollabManager, getColorProperty, getColorTableEditor, getColorTableManager, getDataManager, getDisplayConventions, getIdv, getIdvChooserManager, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getObjectStore, getParamDefaultsEditor, getParamGroupsEditor, getPersistenceManager, getPluginManager, getPreference, getPreference, getPreferenceManager, getProperty, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getResourceViewer, getStateManager, getStationModelManager, getStore, getTestManager, getVMManager, haveCollabManager, initFromXml, makeManager, setIdv, showAliasEditor, showAutoDisplayEditor, showChooser, showChooserModal, showColorTableEditor, showColorTableEditor, showDefaultsEditor, showIdvProjectionManager, showParamGroupsEditor, showPreferenceManager, showResourceViewer, showStationModelEditor
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface ucar.unidata.idv.ControlContext
getColorTableManager, getDisplayConventions, getIdv, getObjectStore, getPersistenceManager, getPreferenceManager, getResourceManager, getStationModelManager
 
Methods inherited from interface ucar.unidata.data.DataContext
getJythonManager, getPreference
 
Methods inherited from interface ucar.unidata.idv.IdvContext
getColorProperty, getProperty, getProperty
 

Field Detail

displayControls

protected List displayControls
List of all of the DisplayControls currently active


controlDescriptors

protected List controlDescriptors
List of the ControlDescriptors defined in the controls.xml file


controlDescriptorMap

protected Hashtable controlDescriptorMap
Mapping from control descriptor id to ControlDescriptor

Constructor Detail

IntegratedDataViewer

public IntegratedDataViewer()
                     throws VisADException,
                            RemoteException
Parameterless constructor. Not sure if this is needed. Perhaps it is needed for the XmlEncoder encoding?

Throws:
VisADException - from construction of VisAd objects
RemoteException - from construction of VisAD objects

IntegratedDataViewer

public IntegratedDataViewer(String[] args)
                     throws VisADException,
                            RemoteException
The main constructor. After the dervied class is created then the init() method should be called. We have the derived class call init so that the object has been fully instantiated when init is called.

Parameters:
args - The command line arguments
Throws:
VisADException - from construction of VisAd objects
RemoteException - from construction of VisAD objects

IntegratedDataViewer

public IntegratedDataViewer(boolean interactiveMode)
                     throws VisADException,
                            RemoteException
Ctor for when some other code is calling us. eg: creating an image

Parameters:
interactiveMode - Is interactive
Throws:
RemoteException - On badness
VisADException - On badness

IntegratedDataViewer

public IntegratedDataViewer(String[] args,
                            boolean interactiveMode)
                     throws VisADException,
                            RemoteException
ctor

Parameters:
args - cmd line args
interactiveMode - Are we interactive mode. Normally we are, including when running an isl. However, we use this flag when code from some jvm calls us directly. eg: when generating an image.
Throws:
RemoteException - On badness
VisADException - On badness
Method Detail

getServerMode

public boolean getServerMode()
See if we are in server mode or not

Returns:
true if in server mode

getInteractiveMode

public boolean getInteractiveMode()
Are we interactive

Returns:
is interactive

checkSystem

protected void checkSystem()
Check whether the system has the necessary components (ex: Java 3D). Subclasses can override.


waitUntilDisplaysAreDone

public void waitUntilDisplaysAreDone()
Wait until the displays have been rendered


init

protected final void init()
This is a wrapper that calls initInner within a thread. That way the gui can get built and displayed, etc.


loadDataFiles

protected void loadDataFiles(List files)
Load in a datasource for each file/url in the given files list.

Parameters:
files - String file or urls

initInner

protected void initInner()
                  throws VisADException,
                         RemoteException
Build the gui, process bundles, etc.

Throws:
RemoteException
VisADException

initDone

public void initDone()
Gets called when all initialization is finished.


startMonitor

protected void startMonitor()
Start up the IDV montior server. This is an http server on the port defined by the property idv.monitorport (8788). It provides 2 urls only accessible from localhost: http://localhost:8788/stack.html http://localhost:8788/shutdown.html


initCacheManager

public void initCacheManager()
Set the state in the cache manager


clearCachedData

protected void clearCachedData()
This is called when the CacheManager detects the need ot clear memory.


getHaveInitialized

public boolean getHaveInitialized()
Has this IDV been fully initialized

Returns:
Has this idv been initialized

okToShowWindows

public boolean okToShowWindows()
Is it ok to show any windows. This returns false if we have not been initialized yet or if we are in offscreen mode

Returns:
Ok to show windows

initPropertyFiles

public void initPropertyFiles(List files)
A hook to allow derived classes to add in their own property files.

Parameters:
files - A list of file names or urls (String) that point to the property files that are to be loaded in. Properties from later files in the list overwrite properties from earlier files.

registerHelpKey

public void registerHelpKey(JComponent comp,
                            String helpId)
Register a help key for a component

Parameters:
comp - component
helpId - the help id for that component

makeHelpButton

public JComponent makeHelpButton(String helpId)
Make a help button for a particular help topic

Parameters:
helpId - the id of the topic
Returns:
the component

makeHelpButton

public JComponent makeHelpButton(String helpId,
                                 String toolTip)
Make a help button for a particular help topic

Parameters:
helpId - the topic id
toolTip - the tooltip
Returns:
the button

loadRbiFile

public void loadRbiFile(String filename)
Sometime we will be able to dynamically load in a rbi file (resource bundle)

Parameters:
filename - The rbi file.

getLocationList

public List getLocationList()
Create (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.

Specified by:
getLocationList in interface ControlContext
Returns:
The list of NamedStationTables

getProjections

protected List getProjections()
Return the list of Projections

Returns:
The list of Projections

addControlDescriptor

protected void addControlDescriptor(ControlDescriptor cd)
Add a new ControlDescriptor into the controlDescriptor list and controlDescriptorMap hashtable. Only add this in if we do not already have one loaded with the same id

Parameters:
cd - The ControlDescriptor to add

initPreferences

protected void initPreferences(IdvPreferenceManager preferenceManager)
Add into the IdvPreferenceManager the different gui components/preference managers

Parameters:
preferenceManager - The preferenceManager to initialize

createDataSelector

public DataSelector createDataSelector()
Create a DataSelector window.

Returns:
the new DataSelector window.

selectDataChoice

public DataChoice selectDataChoice(ControlDescriptor descriptor)
Popup a dialog containing a DataTree showing the DataChoices that are applicable to the given ControlDescriptor. Return the select data choice.

Parameters:
descriptor - The ControlDescriptor to select a DataChoice for.
Returns:
The selected DataChoice or null if none selected.

selectDataChoices

public List selectDataChoices(List fullParamNames)
Popup a dialog containing a DataTree for each operand in the given fullParamNames list Return a List of DataChoice's the user selects or null if they canceled.

Specified by:
selectDataChoices in interface DataContext
Parameters:
fullParamNames - List of String names representing the operands or parameters that are to be chosen.
Returns:
List of selected DataChoices

selectUserChoices

public List selectUserChoices(String msg,
                              List userChoices)
Popup a JTextField containing dialog that allows the user to enter text values, one for each name in the userChoices List. This is a pass through to (String,List)

Specified by:
selectUserChoices in interface DataContext
Parameters:
msg - The message to display in the GUI
userChoices - List of Strings, one for each value
Returns:
List of Strings the user entered or null if they cancelled

dataSourceChanged

public void dataSourceChanged(DataSource source)
Implementation of the DataContext method. This method gets called when something changed in the data source. It just acts as a pass through to the IdvUIManager that updates any user interfaces.

Specified by:
dataSourceChanged in interface DataContext
Parameters:
source - The data source that changed

evaluateAndSave

public void evaluateAndSave(DataChoice dataChoice)
Evalute the data choice and then save it off in a CacheDataSource

Parameters:
dataChoice - The data chocie to evaluate

saveInCache

public void saveInCache(DataChoice dataChoice,
                        Data data)
Clone the data choice and then save it off in a CacheDataSource

Parameters:
dataChoice - The data choice to save
data - The data

saveInCache

public void saveInCache(DataChoice dataChoice,
                        Data data,
                        DataSelection dataSelection)
Save the given data in the CacheDataSource

Parameters:
dataChoice - data choice
data - data
dataSelection - data selection

saveInCache

public void saveInCache(DataChoice dataChoice,
                        Data data,
                        String name)
Clone the data choice and then save it off in a CacheDataSource

Parameters:
dataChoice - The data choice to save
data - The data
name - The name to use

saveInCache

public void saveInCache(DataChoice dataChoice,
                        Data data,
                        DataSelection dataSelection,
                        String name)
Clone the data choice and then save it off in a CacheDataSource

Parameters:
dataChoice - The data choice to save
data - The data
dataSelection - data selection
name - The name to use

getDerivedDataChoices

public List getDerivedDataChoices(DataSource dataSource,
                                  List dataChoices)
Get the list of derived data choices

Parameters:
dataSource - data source
dataChoices - data choices
Returns:
derived data choices

doMakeDataChoiceMenu

public JMenu doMakeDataChoiceMenu(DataChoice dataChoice)
Make and return the menu of commands that can be applied to the given DataChoice. Just a pass through to the IdvUIManager.doMakeDataChoiceMenu(DataChoice)

Specified by:
doMakeDataChoiceMenu in interface ControlContext
Parameters:
dataChoice - The data choice to make the menu for
Returns:
The menu

getViewManagerProperties

public String getViewManagerProperties()
Return a String of semi-colon separated name=value pairs that define the default properties for ViewManagers.

Returns:
Propery string for when we create a ViewManager

createNewWindow

public void createNewWindow()
Create a new window containing a new MapViewManager


getViewManager

public ViewManager getViewManager()
Create, if needed, and return the default 3d view manager

Returns:
The view manager

getViewManager

public ViewManager getViewManager(ViewDescriptor viewDescriptor)
Implementation of the ControlContext interface call. Creates, if needed, and returns the ViewManager that is specified by the given ViewDescriptor

Specified by:
getViewManager in interface ControlContext
Parameters:
viewDescriptor - Defines the name and type of the ViewManager that is to be found or created.
Returns:
Either the existing ViewManager or a new one

getViewManager

public ViewManager getViewManager(ViewDescriptor viewDescriptor,
                                  boolean newWindow,
                                  String properties)
Creates, if needed, and returns the ViewManager that is specified by the given ViewDescriptor

Specified by:
getViewManager in interface ControlContext
Parameters:
viewDescriptor - Defines the name and type of the ViewManager that is to be found or created.
newWindow - If true we create a new window and add the ViewManager into it
properties - The properties to pass through to the ViewManager if we are creating a new one.
Returns:
Either the existing ViewManager or a new one

getAllControlDescriptors

public List getAllControlDescriptors()
Return all the ControlDescriptors

Returns:
List of ControlDescriptor-s

getControlDescriptors

public List getControlDescriptors()
This returns the set of ControlDescriptors that can be shown. That is, the control descriptors that the user has chosen to show through the user preferences.

Returns:
List of shown control descriptors.

getControlDescriptors

public List getControlDescriptors(boolean includeTemplates)
This returns the set of ControlDescriptors that can be shown. That is, the control descriptors that the user has chosen to show through the user preferences.

Parameters:
includeTemplates - If true then include the display templates
Returns:
List of shown control descriptors.

getControlDescriptor

public ControlDescriptor getControlDescriptor(String name)
Return the ControlDescriptor with the given name, or null if not found.

Parameters:
name - ControlDescriptor name to look up
Returns:
The ControlDescriptor with the given name or null

getDisplayControls

public List getDisplayControls()
Return the list of DisplayControls currently active

Returns:
List of display controls

getAllDisplaysIntialized

public boolean getAllDisplaysIntialized()
Have all of the displays been initialixed

Returns:
all displays initialized

toFront

public void toFront(DisplayControl control)
Move the given display control to the front. We simply move the control to the end of the list of display controls.

Parameters:
control - The display control

controlHasBeenInitialized

public void controlHasBeenInitialized(DisplayControl control)
Called by the given DisplayControl when it has been fully initialized.

Parameters:
control - The initialized DisplayControl

addDisplayControl

public void addDisplayControl(DisplayControl control)
Add the given DisplayControl into the list of display controls. Update the user interfaces.

Specified by:
addDisplayControl in interface ControlContext
Parameters:
control - The new display control

removeDisplayControl

public void removeDisplayControl(DisplayControl control)
Remove the given DisplayControl from the list of display controls. Update the user interfaces.

Specified by:
removeDisplayControl in interface ControlContext
Parameters:
control - The removed display control

removeAllDisplays

public void removeAllDisplays()
Remove all of the displays.


removeAllDisplays

public void removeAllDisplays(boolean payAttentionToCanDoRemoveAll)
remove all displays

Parameters:
payAttentionToCanDoRemoveAll - Remove all

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent e)
Implement the hyperlinklistener interface. This gets called code that handles html. It gets the URL from the event and calls handleAction(String,Hashtable).

Specified by:
hyperlinkUpdate in interface HyperlinkListener
Parameters:
e - The HyperlinkEvent event

hyperlinkUpdate

public void hyperlinkUpdate(HyperlinkEvent e,
                            Hashtable properties)
Handle the click

Parameters:
e - event
properties - any properties

handleFileOrUrlAction

protected boolean handleFileOrUrlAction(String action,
                                        Hashtable properties)
This method checks if the given action is one of the following.

  • Jython code -- starts with jython:
  • Help link -- starts with help:
  • Resource bundle file -- ends with .rbi
  • bundle file -- ends with .xidv
  • jnlp file -- ends with .jnlp
    It returns true if the action is one of these. False otherwise.

    Parameters:
    action - The string action
    properties - any properties
    Returns:
    Was this action handled

  • handleAction

    public boolean handleAction(String action)
    handle action

    Parameters:
    action - action
    Returns:
    handled action

    handleAction

    public boolean handleAction(String action,
                                Hashtable properties)
    This method tries to handle the given action. The action may be a normal gui action (e.g., jython: or help:) or it may be a description of a datasource. The properties table is used to provide further information about this action.

    Specified by:
    handleAction in interface ControlContext
    Parameters:
    action - The action (file, data source url, etc.)
    properties - Properties to pass to the data source creation
    Returns:
    Was this action handled by this method.

    handleAction

    public boolean handleAction(String action,
                                Hashtable properties,
                                boolean checkForAlias)
    This method tries to handle the given action. The action may be a normal gui action (e.g., jython: or help:), a file (e.g., test.xidv) or it may be a description of a datasource. The properties table is used to provide further information about this action.

    Parameters:
    action - The action (file, data source url, etc.)
    properties - Properties to pass to the data source creation
    checkForAlias - Data sources can have aliases, (e.g., ETA means a dods url pointing to the latest eta run on a remote server). This flag, if true, has this routine check if the given action is indeed an alias.
    Returns:
    Was this action handled by this method.

    actionPerformed

    public void actionPerformed(ActionEvent event)
    Implementation of the ActionListener interface. This passes the the action command from the given ActionEvent off to the handleAction method.

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

    removeDataSource

    public void removeDataSource(DataSource dataSource)
    Remove the data source from the DataManager and from any DataTree-s. Update the data menu in all menu bars.

    Parameters:
    dataSource - The data source to remove

    removeAllDataSources

    public void removeAllDataSources()
    Remove all current data sources. Update the GUI.


    reloadAllDataSources

    public void reloadAllDataSources()
    reload all data sources


    getDataSources

    public List getDataSources()
    Wrapper method around DataManager.getDataSources(). Returns the list of DataSource-s currently being used in the application.

    Specified by:
    getDataSources in interface DataContext
    Returns:
    List of current data sources.

    getAllDataSources

    public List getAllDataSources()
    Gets all of the data sources. Normally, the method getDataSources, only returns the data sources held by the DataManager. This method also adds the Formula data source into the list.

    Specified by:
    getAllDataSources in interface DataContext
    Returns:
    List of all current data sources.

    makeOneDataSource

    public DataSource makeOneDataSource(Object definingObject,
                                        String dataType,
                                        Hashtable properties)
    A helper method that will create a data source from the given defining object (e.g., url, filename, collection of images, etc.) and dataType, will show any errors, and, if a data source was created will return it.

    Parameters:
    definingObject - Defines the data source. e.g., filename, url, list of images
    dataType - Defines the data source type id. From datasources.xml. If null then the data source type is found by checking for a pattern match on the defining object from the patterns in datasources.xml
    properties - Optional properties to pass to the data source. May also contain the data source type id.
    Returns:
    The newly create data source or null if there was a failure.

    makeDataSource

    public boolean makeDataSource(Object definingObject,
                                  String dataType,
                                  Hashtable properties)
    Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.

    Parameters:
    definingObject - Defines the data source. e.g., filename, url, list of images
    dataType - Defines the data source type id. From datasources.xml. If null then the data source type is found by checking for a pattern match on the defining object from the patterns in datasources.xml
    properties - Optional properties to pass to the data source. May also contain the data source type id.
    Returns:
    Was the creation successfull.

    makeDataSource

    public void makeDataSource(DataSourceDescriptor descriptor)
    Make the data source. This is a data source that does not need urls or files

    Parameters:
    descriptor - descriptor

    makeDataSource

    public boolean makeDataSource(Object definingObject,
                                  String dataType,
                                  Hashtable properties,
                                  boolean checkAlias)
    Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.

    Parameters:
    definingObject - Defines the data source. e.g., filename, url, list of images
    dataType - Defines the data source type id. From datasources.xml. If null then the data source type is found by checking for a pattern match on the defining object from the patterns in datasources.xml
    properties - Optional properties to pass to the data source. May also contain the data source type id.
    checkAlias - If true then see if the given definineObject is a data source alias name.
    Returns:
    Was the creation successfull.

    makeDataSource

    public boolean makeDataSource(Object definingObject,
                                  String dataType,
                                  Hashtable properties,
                                  boolean checkAlias,
                                  String displayType)
    Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.

    Parameters:
    definingObject - Defines the data source. e.g., filename, url, list of images
    dataType - Defines the data source type id. From datasources.xml. If null then the data source type is found by checking for a pattern match on the defining object from the patterns in datasources.xml
    properties - Optional properties to pass to the data source. May also contain the data source type id.
    checkAlias - If true then see if the given definineObject is a data source alias name.
    displayType - If non-null hten also create this display
    Returns:
    Was the creation successfull.

    moveHistoryToFront

    public void moveHistoryToFront(History history)
    Move a history to the front of the list

    Parameters:
    history - the history item to move

    makeDataSourceFromXml

    public DataSourceResults makeDataSourceFromXml(String dataSourceXml)
    This creates a new data source from the xml encoded representation of a persisted data source. It is used in the data source history mechanism.

    Parameters:
    dataSourceXml - The xml encoded data source representation
    Returns:
    The results that hold the new data source.

    createDataSource

    public DataSourceResults createDataSource(Object definingObject,
                                              String dataType,
                                              Hashtable properties,
                                              boolean checkAlias)
    Create the data source (or data sources) defined by the given definingObject.

    Parameters:
    definingObject - Defines the data source. e.g., filename, url, list of images
    dataType - Defines the data source type id. From datasources.xml. If null then the data source type is found by checking for a pattern match on the defining object from the patterns in datasources.xml
    properties - Optional properties to pass to the data source. May also contain the data source type id.
    checkAlias - If true then see if the given definineObject is a data source alias name.
    Returns:
    List of DataSourceResults that hold the results of this method.

    selectDataType

    public String selectDataType(Object definingObject)
    Ask the user to select a data type for the given defining object

    Specified by:
    selectDataType in interface DataContext
    Parameters:
    definingObject - The defining object for the data source
    Returns:
    The data type name or null

    selectDataType

    public String selectDataType(Object definingObject,
                                 String message)
    Popup a dialog to allows the user to select data source type

    Specified by:
    selectDataType in interface DataContext
    Parameters:
    definingObject - the object to create the data source with
    message - message to show the user
    Returns:
    Selected data source type or null

    loadDataSource

    public boolean loadDataSource(DataSource dataSource)
    Load in a DataSource. Called from the DataManager when a new data source has been created or unpersisted.

    Specified by:
    loadDataSource in interface DataContext
    Parameters:
    dataSource - Data source to load in.
    Returns:
    If true then signals that the given data source should be kept around in the list of data sources. False says to not keep it around in the list.

    getMaxRenderThreadCount

    public int getMaxRenderThreadCount()
    Get the max number of threads to be used when rendering in visad

    Returns:
    max threads for rendering

    getMaxDataThreadCount

    public int getMaxDataThreadCount()
    Get the max number of threads to be used when reading data

    Returns:
    max threads for reading data

    getMaxPermGenSize

    public int getMaxPermGenSize()
    Get the max size of the perm gen space

    Returns:
    max size of perm gen space

    getUseTimeDriver

    public boolean getUseTimeDriver()
    Get whether we are using the time driver facility

    Returns:
    true if using time matching

    createImage

    public void createImage(String imageName,
                            String dataSourceName,
                            String paramName,
                            String displayName)
    This method loads in the data, creates the display from the given paramName and writes out a screen image.

    Parameters:
    imageName - The file name of the image
    dataSourceName - The data source to load (e.g., a filename or url)
    paramName - The parameter to create the display with.
    displayName - The id of the display. From controls.xml

    createDisplay

    public DisplayControl createDisplay(String dataSourceName,
                                        String paramName,
                                        String displayName,
                                        String properties)
    Create a display from the given datasource/paramname pair.

    Parameters:
    dataSourceName - The data source to load (e.g., a filename or url)
    paramName - The parameter to create the display with.
    displayName - The id of the display. From controls.xml
    properties - Semi-color delimited list of name=value properties to pass to the display.
    Returns:
    The newly created DisplayControl

    createDisplay

    public DisplayControl createDisplay(String dataSourceName,
                                        String paramName,
                                        String displayName,
                                        String properties,
                                        boolean initDisplayInThread)
    Create a display from the given datasource/paramname pair.

    Specified by:
    createDisplay in interface ControlContext
    Parameters:
    dataSourceName - The data source to load (e.g., a filename or url)
    paramName - The parameter to create the display with.
    displayName - The id of the display. From controls.xml
    properties - Semi-color delimited list of name=value properties to pass to the display.
    initDisplayInThread - If true then initialize the display in a separate thread
    Returns:
    The newly created DisplayControl

    showWindow

    public void showWindow(DisplayControl control,
                           IdvWindow window)
    Implementation of the ControlContext method. If the idv has been initialized then this simply shows the window. If not yet fully initialized then we place this window in a list of windows to be displayed after initialization is done.

    Specified by:
    showWindow in interface ControlContext
    Parameters:
    control - The DisplayControl whose window we should show.
    window - The window

    getBackgroundImages

    public List getBackgroundImages()
    Get the background images resource

    Returns:
    the resource

    doMakeBackgroundImage

    public void doMakeBackgroundImage()
    Make the background wms image


    doMakeControl

    public DisplayControl doMakeControl(DataChoice dataChoice,
                                        ControlDescriptor descriptor,
                                        String properties)
    Create the DisplayControl, identified by the given ControlDescriptor for the given DataChoice

    Parameters:
    dataChoice - The data choice.
    descriptor - Defines the control to create.
    properties - Semi-colon delimited list of name=value properties to pass to the control.
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(String controlName)
    This method is called by the helptips, passing in the name of the display control (from controls.xml). It creates DisplayControl without any data.

    Parameters:
    controlName - Id of the display control
    Returns:
    The newly created display control.

    doMakeControl

    public DisplayControl doMakeControl(String controlName,
                                        DataChoice dataChoice)
    make a control

    Parameters:
    controlName - name of control
    dataChoice - with data choice
    Returns:
    control

    doMakeControl

    public DisplayControl doMakeControl(String controlName,
                                        List dataChoices)
    make a control

    Parameters:
    controlName - name of control
    dataChoices - list of data choices
    Returns:
    control

    doMakeControl

    public DisplayControl doMakeControl(List dataChoices,
                                        ControlDescriptor descriptor)
    Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices

    Parameters:
    dataChoices - The list of data choices.
    descriptor - Defines the control to create.
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(DataChoice dataChoice,
                                        ControlDescriptor descriptor,
                                        String properties,
                                        DataSelection dataSelection)
    Create the DisplayControl, identified by the given ControlDescriptor for the given DataChoice

    Parameters:
    dataChoice - The data choice.
    descriptor - Defines the control to create.
    properties - Semi-colon delimited list of name=value properties to pass to the control.
    dataSelection - Holds any user specified subsetting of data (e.g., times list).
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(List dataChoices,
                                        ControlDescriptor descriptor,
                                        String propertiesString,
                                        DataSelection dataSelection)
    Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices

    Parameters:
    dataChoices - List of data choices.
    descriptor - Defines the control to create.
    propertiesString - Semi-colon delimited list of name=value properties to pass to the control.
    dataSelection - Holds any user specified subsetting of data (e.g., times list).
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(List dataChoices,
                                        ControlDescriptor descriptor,
                                        Hashtable properties,
                                        DataSelection dataSelection)
    Create the DisplayControl, identified by the given ControlDescriptor for the given list of DataChoices

    Parameters:
    dataChoices - List of data choices.
    descriptor - Defines the control to create.
    properties - Hashtable of properties
    dataSelection - Holds any user specified subsetting of data (e.g., times list).
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(List dataChoices,
                                        ControlDescriptor descriptor,
                                        String propertiesString,
                                        DataSelection dataSelection,
                                        boolean initDisplayInThread)
    Finally, we really create the DisplayControl, identified by the given ControlDescriptor using the given list of DataChoices

    Parameters:
    dataChoices - List of data choices.
    descriptor - Defines the control to create.
    propertiesString - Semi-colon delimited list of name=value properties to pass to the control.
    dataSelection - Holds any user specified subsetting of data (e.g., times list).
    initDisplayInThread - If true then do the display control initialization in a thread.
    Returns:
    The newly create display control or null if it fails.

    doMakeControl

    public DisplayControl doMakeControl(List dataChoices,
                                        ControlDescriptor descriptor,
                                        Hashtable properties,
                                        DataSelection dataSelection,
                                        boolean initDisplayInThread)
    Finally, we really create the DisplayControl, identified by the given * ControlDescriptor using the given list of DataChoices

    Parameters:
    dataChoices - List of data choices.
    descriptor - Defines the control to create.
    properties - Hashtable of properties
    dataSelection - Holds any user specified subsetting of data (e.g., times list).
    initDisplayInThread - If true then do the display control initialization in a thread.
    Returns:
    The newly create display control or null if it fails.

    encodeObject

    public String encodeObject(Object object,
                               boolean prettyPrint)
    Return the xml representation of the given object. If prettyPrint is true then format the xml with tabs, etc.

    Parameters:
    object - The object to xmlize
    prettyPrint - Should the string xml be formatted
    Returns:
    Xml representation of the given object

    decodeObject

    public Object decodeObject(String xml)
                        throws Exception
    Create and return the Object defined by the given xml.

    Parameters:
    xml - The xml representation of an object
    Returns:
    The Object
    Throws:
    Exception

    clearHistoryList

    public void clearHistoryList()
    Empty the history list and write it out.


    getHistory

    public List getHistory()
    Create, if needed, and return the history list. This is the list of History objects that that define the files and data sources the user has loaded in the past.

    Returns:
    History list

    addToHistoryList

    public void addToHistoryList(String filename)
    Add the given file to the history list.

    Parameters:
    filename - The file name to add

    writeHistoryList

    public void writeHistoryList()
    Persist the history list into its own file.


    addToHistoryList

    public void addToHistoryList(History newHistory)
    Add the given History object into the history list. This also writes out the history list.

    Parameters:
    newHistory - The History object to add.

    doSaveAs

    public void doSaveAs()
    Have the user select an xidv filename and write the current application state to it. This also sets the current file name and adds the file to the history list.


    doSave

    public void doSave()
    Save the current state off to the current xidv filename


    doSaveAsDefault

    public void doSaveAsDefault()
    Called from the menu command to save the current state as the default bundle


    doOpenDefault

    public void doOpenDefault()
    Called from the menu command to open the default bundle


    doOpen

    public void doOpen(String filename,
                       boolean checkUserPreference,
                       boolean andRemove)
    Have the user select an xidv file. If andRemove is true then we remove all data sources and displays. Then we open the unpersist the bundle in the xidv file

    Parameters:
    filename - The filename to open
    checkUserPreference - Should we show, if needed, the Open dialog
    andRemove - If true then first remove all data sources and displays

    getChangeDataPaths

    public boolean getChangeDataPaths()
    Did the user select to change the data paths when loading in a bundle

    Returns:
    change data in loaded bundles

    getChangeDataPathCbx

    public JCheckBox getChangeDataPathCbx()
    Get the checkbox to show to change data

    Returns:
    change data cbx

    doOpen

    public void doOpen()
    Have the user select an xidv bundle file, remove all data sources and displays, and then unpersist the bundle.


    doOpen

    public void doOpen(String bundleUri)
    Load in the given bundle. Check to see if we should also remove the current state.

    Parameters:
    bundleUri - The filename or url of the bundle

    doImport

    public void doImport()
    Have the user select an xidv bundle file and then unpersist the bundle. This does not remove the existing data sources and displays.


    doClearDefaults

    public void doClearDefaults()
    Called from the menu command to clear the default bundle


    getEncoderForRead

    public XmlEncoder getEncoderForRead()
    Create a new XmlEncoder for doing unpersisting.

    Returns:
    The encoder used for reading xml encoded objects

    getEncoderForWrite

    public XmlEncoder getEncoderForWrite()
    Create a new XmlEncoder for doing persisting.

    Returns:
    The encoder used for writing xml encoded objects

    getEncoder

    protected XmlEncoder getEncoder()
    Get the XmlEncoder for this instance

    Overrides:
    getEncoder in class IdvBase
    Returns:
    the encoder

    getEncoder

    protected XmlEncoder getEncoder(boolean forRead)
    Create an XmlEncoder and initialize it with the VisADPersistence delegates.

    Parameters:
    forRead - If true then we initialize the encoder for reading the xml
    Returns:
    The new encoder

    initEncoder

    protected void initEncoder(XmlEncoder encoder,
                               boolean forRead)
    A hook so derived classes can add their own initialization to the given encoder.

    Parameters:
    encoder - The encoder to initialize
    forRead - If true then we initialize the encoder for reading the xml

    quit

    public boolean quit()
    Called to end execution of this process. This method must be evoked from the event-dispatching thread. (why?)

    Returns:
    Did the user really want to quit. Of course, if the user did quit then we exit the app and never return true anyway.

    exit

    protected void exit(int exitCode)
    Exit the application. By default this calls System.exit. However, a custom application could override this method.

    Parameters:
    exitCode - System exit code to use

    showConsole

    public void showConsole()
    Show the error message console. We have this as a method so it can be called via jython.


    logException

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

    Parameters:
    msg - The error message
    exc - The exception

    showWaitCursor

    public void showWaitCursor()
    Pass through to IdvUIManager.showWaitCursor()

    Specified by:
    showWaitCursor in interface ControlContext

    showNormalCursor

    public void showNormalCursor()
    Pass through to IdvUIManager.showNormalCursor()

    Specified by:
    showNormalCursor in interface ControlContext

    clearWaitCursor

    public void clearWaitCursor()
    Pass through to IdvUIManager.clearWaitCursor()


    closeCurrentWindow

    public void closeCurrentWindow()
    close current window


    waitLabelClicked

    public void waitLabelClicked()
    The user clicked on the wait label


    main

    public static void main(String[] args)
                     throws Exception
    Default main implementation. Just turn around and call DefaultIdv.main.

    Parameters:
    args - Command line arguments.
    Throws:
    Exception - When something bad happends

    processScript

    public static void processScript(String scriptFile)
                              throws Exception
    Get the image from the given isl script. This is called by other code directly and runs the idv in non-interactive mode

    Parameters:
    scriptFile - The path to the isl script
    Throws:
    Exception - On badness

    cleanup

    public void cleanup()
    Remove all state, etc.


    printCache

    public void printCache()
    Call CacheManager.printStats


    getStaticImage

    protected byte[] getStaticImage(String bundle)
                             throws Exception
    Get image

    Parameters:
    bundle - bundle
    Returns:
    image
    Throws:
    Exception - On badness

    printCacheStats

    public void printCacheStats()
    Print cache statistics


    printDataCacheStats

    public void printDataCacheStats()
    Print the data cache stats


    flushDataCache

    public void flushDataCache()
    Flush the data cache


    applyPreferences

    public void applyPreferences()
    Apply preferences.


    runImageServer

    protected void runImageServer(int port,
                                  String propertyFile)
    startup and run the image server

    Parameters:
    port - what port to listen on
    propertyFile - properties - may be null

    addErrorButtons

    public void addErrorButtons(JDialog dialog,
                                List buttonList,
                                String msg,
                                Throwable exc)
    Implement the LogUtil.DialogManager interface to add buttons to the dialog. This adds the 'Support Form' button.

    Specified by:
    addErrorButtons in interface LogUtil.DialogManager
    Parameters:
    dialog - The dialog to add to.
    buttonList - The list of buttons to add my button into.
    msg - The error message
    exc - The exception that had been thrown.

    listApi

    public String listApi(Object o)
    Utility to list the public api of the given object

    Parameters:
    o - object
    Returns:
    api