Package ucar.unidata.idv
Class IntegratedDataViewer
java.lang.Object
ucar.unidata.idv.IdvBase
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:
- Create the instance of the IDV (e.g.,
DefaultIdv.main(String[])) - The IDV, in its constructor, initializes the property files and command line arguments:
- Constucts the
ArgsManager. - Adds the default property file to the ArgsManager list of propertyFiles
- Calls
initPropertyFiles(List)to add in any application specific property file. Properties in files at the end of the list will overwrite properties from files that are in the beginning of the list. - Call
ArgsManager.parseArgs(). This parses the command line arguments. If your IDV app needs to have its own command line arguments then override thedoMakeArgsManager (String[]args)to create your own ArgsManager. - Call
StateManager.loadProperties()to load in the property files.
- Constucts the
- The derived IDV class calls init, either from its constructor or form the main. We have the derived class call init (as opposed to this class) so that its state is fully initialized when init is called.
- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected HashtableMapping from control descriptor id toControlDescriptorprotected ListList of theControlDescriptors defined in the controls.xml fileprotected ListList of all of theDisplayControls currently activeFields 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, vmManagerFields 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_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_APPEARANCEMODE, 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_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_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, 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
ConstructorsConstructorDescriptionParameterless 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
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Implementation of theActionListenerinterface.protected voidAdd a newControlDescriptorinto the controlDescriptor list and controlDescriptorMap hashtable.voidaddDisplayControl(DisplayControl control) Add the givenDisplayControlinto the list of display controls.voidaddErrorButtons(JDialog dialog, List buttonList, String msg, Throwable exc) Implement the LogUtil.DialogManager interface to add buttons to the dialog.voidaddToHistoryList(String filename) Add the given file to the history list.voidaddToHistoryList(History newHistory) Add the givenHistoryobject into the history list.voidApply preferences.protected voidCheck whether the system has the necessary components (ex: Java 3D).voidcleanup()Remove all state, etc.protected voidThis is called when the CacheManager detects the need ot clear memory.voidEmpty the history list and write it out.voidPass through toIdvUIManager.clearWaitCursor()voidclose current windowvoidcontrolHasBeenInitialized(DisplayControl control) Called by the givenDisplayControlwhen it has been fully initialized.Create aDataSelectorwindow.createDataSource(Object definingObject, String dataType, Hashtable properties, boolean checkAlias) Create the data source (or data sources) defined by the given definingObject.createDisplay(String dataSourceName, String paramName, String displayName, String properties) Create a display from the given datasource/paramname pair.createDisplay(String dataSourceName, String paramName, String displayName, String properties, boolean initDisplayInThread) Create a display from the given datasource/paramname pair.voidcreateImage(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.voidCreate a new window containing a newMapViewManagervoiddataSourceChanged(DataSource source) Implementation of the DataContext method.decodeObject(String xml) Create and return the Object defined by the given xml.voidCalled from the menu command to clear the default bundlevoiddoImport()Have the user select an xidv bundle file and then unpersist the bundle.voidMake the background wms imagedoMakeControl(String controlName) This method is called by the helptips, passing in the name of the display control (from controls.xml).doMakeControl(String controlName, List dataChoices) make a controldoMakeControl(String controlName, DataChoice dataChoice) make a controldoMakeControl(List dataChoices, ControlDescriptor descriptor) Create theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoicesdoMakeControl(List dataChoices, ControlDescriptor descriptor, String propertiesString, DataSelection dataSelection) Create theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoicesdoMakeControl(List dataChoices, ControlDescriptor descriptor, String propertiesString, DataSelection dataSelection, boolean initDisplayInThread) Finally, we really create theDisplayControl, identified by the givenControlDescriptorusing the given list ofDataChoicesdoMakeControl(List dataChoices, ControlDescriptor descriptor, Hashtable properties, DataSelection dataSelection) Create theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoicesdoMakeControl(List dataChoices, ControlDescriptor descriptor, Hashtable properties, DataSelection dataSelection, boolean initDisplayInThread) Finally, we really create theDisplayControl, identified by the given *ControlDescriptorusing the given list ofDataChoicesdoMakeControl(DataChoice dataChoice, ControlDescriptor descriptor, String properties) doMakeControl(DataChoice dataChoice, ControlDescriptor descriptor, String properties, DataSelection dataSelection) doMakeDataChoiceMenu(DataChoice dataChoice) Make and return the menu of commands that can be applied to the givenDataChoice.voiddoOpen()Have the user select an xidv bundle file, remove all data sources and displays, and then unpersist the bundle.voidLoad in the given bundle.voidHave the user select an xidv file.voidCalled from the menu command to open the default bundlevoiddoSave()Save the current state off to the current xidv filenamevoiddoSaveAs()Have the user select an xidv filename and write the current application state to it.voidCalled from the menu command to save the current state as the default bundleencodeObject(Object object, boolean prettyPrint) Return the xml representation of the given object.encodeObject(Object object, boolean prettyPrint, boolean withHeader) Return the xml representation of the given object.voidevaluateAndSave(DataChoice dataChoice) Evalute the data choice and then save it off in a CacheDataSourceprotected voidexit(int exitCode) Exit the application.voidFlush the data cacheReturn all theControlDescriptorsGets all of the data sources.booleanHave all of the displays been initialixedGet the background images resourceGet the checkbox to show to change databooleanDid the user select to change the data paths when loading in a bundlegetControlDescriptor(String name) Return theControlDescriptorwith the given name, or null if not found.This returns the set ofControlDescriptors that can be shown.getControlDescriptors(boolean includeTemplates) This returns the set ofControlDescriptors that can be shown.Wrapper method aroundDataManager.getDataSources().getDerivedDataChoices(DataSource dataSource, List dataChoices) Get the list of derived data choicesReturn the list ofDisplayControls currently activeprotected XmlEncoderGet the XmlEncoder for this instanceprotected XmlEncodergetEncoder(boolean forRead) Create anXmlEncoderand initialize it with the VisADPersistence delegates.Create a newXmlEncoderfor doing unpersisting.Create a newXmlEncoderfor doing persisting.booleanHas this IDV been fully initializedCreate, if needed, and return the history list.booleanAre we interactiveCreate (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.intGet the max number of threads to be used when reading dataintGet the max number of threads to be used when rendering in visadprotected ListReturn the list ofProjectionsbooleanSee if we are in server mode or notprotected byte[]getStaticImage(String bundle) Get imagebooleanGet whether we are using the time driver facilityCreate, if needed, and return the default 3d view managergetViewManager(ViewDescriptor viewDescriptor) Implementation of the ControlContext interface call.getViewManager(ViewDescriptor viewDescriptor, boolean newWindow, String properties) Creates, if needed, and returns theViewManagerthat is specified by the givenViewDescriptorReturn a String of semi-colon separated name=value pairs that define the default properties for ViewManagers.booleanhandleAction(String action) handle actionbooleanhandleAction(String action, Hashtable properties) This method tries to handle the given action.booleanhandleAction(String action, Hashtable properties, boolean checkForAlias) This method tries to handle the given action.protected booleanhandleFileOrUrlAction(String action, Hashtable properties) This method checks if the given action is one of the following.voidImplement the hyperlinklistener interface.voidhyperlinkUpdate(HyperlinkEvent e, Hashtable properties) Handle the clickprotected final voidinit()This is a wrapper that calls initInner within a thread.voidSet the state in the cache managervoidinitDone()Gets called when all initialization is finished.protected voidinitEncoder(XmlEncoder encoder, boolean forRead) A hook so derived classes can add their own initialization to the given encoder.protected voidBuild the gui, process bundles, etc.protected voidinitPreferences(IdvPreferenceManager preferenceManager) Add into theIdvPreferenceManagerthe different gui components/preference managersvoidinitPropertyFiles(List files) A hook to allow derived classes to add in their own property files.Utility to list the public api of the given objectprotected voidloadDataFiles(List files) Load in a datasource for each file/url in the given files list.booleanloadDataSource(DataSource dataSource) Load in aDataSource.voidloadRbiFile(String filename) Sometime we will be able to dynamically load in a rbi file (resource bundle)voidlogException(String msg, Throwable exc) Helper method that calls LogUtil.printExceptionstatic voidDefault main implementation.booleanmakeDataSource(Object definingObject, String dataType, Hashtable properties) Create the datasource, identified by the given dataType if non-null, with the given definingObject and properties.booleanmakeDataSource(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.booleanmakeDataSource(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.voidmakeDataSource(DataSourceDescriptor descriptor) Make the data source.makeDataSourceFromXml(String dataSourceXml) This creates a new data source from the xml encoded representation of a persisted data source.makeHelpButton(String helpId) Make a help button for a particular help topicmakeHelpButton(String helpId, String toolTip) Make a help button for a particular help topicmakeOneDataSource(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.voidmoveHistoryToFront(History history) Move a history to the front of the listbooleanIs it ok to show any windows.voidCall CacheManager.printStatsvoidPrint cache statisticsvoidPrint the data cache statsstatic voidprocessScript(String scriptFile) Get the image from the given isl script.booleanquit()Called to end execution of this process.voidregisterHelpKey(JComponent comp, String helpId) Register a help key for a componentvoidreload all data sourcesvoidRemove all current data sources.voidRemove all of the displays.voidremoveAllDisplays(boolean payAttentionToCanDoRemoveAll) remove all displaysvoidremoveDataSource(DataSource dataSource) Remove the data source from the DataManager and from any DataTree-s.voidremoveDisplayControl(DisplayControl control) Remove the givenDisplayControlfrom the list of display controls.protected voidrunImageServer(int port, String propertyFile) startup and run the image servervoidsaveInCache(DataChoice dataChoice, Data data) Clone the data choice and then save it off in a CacheDataSourcevoidsaveInCache(DataChoice dataChoice, Data data, String name) Clone the data choice and then save it off in a CacheDataSourcevoidsaveInCache(DataChoice dataChoice, Data data, DataSelection dataSelection) Save the given data in the CacheDataSourcevoidsaveInCache(DataChoice dataChoice, Data data, DataSelection dataSelection, String name) Clone the data choice and then save it off in a CacheDataSourceselectDataChoice(ControlDescriptor descriptor) Popup a dialog containing aDataTreeshowing theDataChoices that are applicable to the givenControlDescriptor.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.selectDataType(Object definingObject) Ask the user to select a data type for the given defining objectselectDataType(Object definingObject, String message) Popup a dialog to allows the user to select data source typeselectUserChoices(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.voidShow the error message console.voidPass through toIdvUIManager.showNormalCursor()voidPass through toIdvUIManager.showWaitCursor()voidshowWindow(DisplayControl control, IdvWindow window) Implementation of the ControlContext method.protected voidStart up the IDV montior server.voidtoFront(DisplayControl control) Move the given display control to the front.voidThe user clicked on the wait labelvoidWait until the displays have been renderedvoidPersist 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, showStationModelEditorMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ucar.unidata.idv.ControlContext
getColorTableManager, getDisplayConventions, getIdv, getObjectStore, getPersistenceManager, getPreferenceManager, getResourceManager, getStationModelManagerMethods inherited from interface ucar.unidata.data.DataContext
getJythonManager, getPreferenceMethods inherited from interface ucar.unidata.idv.IdvContext
getColorProperty, getProperty, getProperty
-
Field Details
-
displayControls
List of all of theDisplayControls currently active -
controlDescriptors
List of theControlDescriptors defined in the controls.xml file -
controlDescriptorMap
Mapping from control descriptor id toControlDescriptor
-
-
Constructor Details
-
IntegratedDataViewer
Parameterless constructor. Not sure if this is needed. Perhaps it is needed for the XmlEncoder encoding?- Throws:
VisADException- from construction of VisAd objectsRemoteException- from construction of VisAD objects
-
IntegratedDataViewer
The main constructor. After the dervied class is created then theinit()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 objectsRemoteException- from construction of VisAD objects
-
IntegratedDataViewer
Ctor for when some other code is calling us. eg: creating an image- Parameters:
interactiveMode- Is interactive- Throws:
RemoteException- On badnessVisADException- On badness
-
IntegratedDataViewer
public IntegratedDataViewer(String[] args, boolean interactiveMode) throws VisADException, RemoteException ctor- Parameters:
args- cmd line argsinteractiveMode- 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 badnessVisADException- On badness
-
-
Method Details
-
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
Load in a datasource for each file/url in the given files list.- Parameters:
files- String file or urls
-
initInner
Build the gui, process bundles, etc.- Throws:
VisADException- the VisAD exceptionRemoteException- the remote exception
-
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
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
Register a help key for a component- Parameters:
comp- componenthelpId- the help id for that component
-
makeHelpButton
Make a help button for a particular help topic- Parameters:
helpId- the id of the topic- Returns:
- the component
-
makeHelpButton
Make a help button for a particular help topic- Parameters:
helpId- the topic idtoolTip- the tooltip- Returns:
- the button
-
loadRbiFile
Sometime we will be able to dynamically load in a rbi file (resource bundle)- Parameters:
filename- The rbi file.
-
getLocationList
Create (if null) and return the list NamedStationTable-s defined by the locationResources XmlResourceCollection.- Specified by:
getLocationListin interfaceControlContext- Returns:
- The list of
NamedStationTables
-
getProjections
Return the list ofProjections- Returns:
- The list of
Projections
-
addControlDescriptor
Add a newControlDescriptorinto 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
Add into theIdvPreferenceManagerthe different gui components/preference managers- Parameters:
preferenceManager- The preferenceManager to initialize
-
createDataSelector
Create aDataSelectorwindow.- Returns:
- the new DataSelector window.
-
selectDataChoice
Popup a dialog containing aDataTreeshowing theDataChoices that are applicable to the givenControlDescriptor. Return the select data choice.- Parameters:
descriptor- TheControlDescriptorto select a DataChoice for.- Returns:
- The selected
DataChoiceor null if none selected.
-
selectDataChoices
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:
selectDataChoicesin interfaceDataContext- Parameters:
fullParamNames- List of String names representing the operands or parameters that are to be chosen.- Returns:
- List of selected
DataChoices
-
selectUserChoices
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:
selectUserChoicesin interfaceDataContext- Parameters:
msg- The message to display in the GUIuserChoices- List of Strings, one for each value- Returns:
- List of Strings the user entered or null if they cancelled
-
dataSourceChanged
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:
dataSourceChangedin interfaceDataContext- Parameters:
source- The data source that changed
-
evaluateAndSave
Evalute the data choice and then save it off in a CacheDataSource- Parameters:
dataChoice- The data chocie to evaluate
-
saveInCache
Clone the data choice and then save it off in a CacheDataSource- Parameters:
dataChoice- The data choice to savedata- The data
-
saveInCache
Save the given data in the CacheDataSource- Parameters:
dataChoice- data choicedata- datadataSelection- data selection
-
saveInCache
Clone the data choice and then save it off in a CacheDataSource- Parameters:
dataChoice- The data choice to savedata- The dataname- The name to use
-
saveInCache
Clone the data choice and then save it off in a CacheDataSource- Parameters:
dataChoice- The data choice to savedata- The datadataSelection- data selectionname- The name to use
-
getDerivedDataChoices
Get the list of derived data choices- Parameters:
dataSource- data sourcedataChoices- data choices- Returns:
- derived data choices
-
doMakeDataChoiceMenu
Make and return the menu of commands that can be applied to the givenDataChoice. Just a pass through to theIdvUIManager.doMakeDataChoiceMenu(DataChoice)- Specified by:
doMakeDataChoiceMenuin interfaceControlContext- Parameters:
dataChoice- The data choice to make the menu for- Returns:
- The menu
-
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 newMapViewManager -
getViewManager
Create, if needed, and return the default 3d view manager- Returns:
- The view manager
-
getViewManager
Implementation of the ControlContext interface call. Creates, if needed, and returns theViewManagerthat is specified by the givenViewDescriptor- Specified by:
getViewManagerin interfaceControlContext- 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 theViewManagerthat is specified by the givenViewDescriptor- Specified by:
getViewManagerin interfaceControlContext- 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 itproperties- 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
Return all theControlDescriptors- Returns:
- List of ControlDescriptor-s
-
getControlDescriptors
This returns the set ofControlDescriptors 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
This returns the set ofControlDescriptors 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
Return theControlDescriptorwith 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
Return the list ofDisplayControls currently active- Returns:
- List of display controls
-
getAllDisplaysIntialized
public boolean getAllDisplaysIntialized()Have all of the displays been initialixed- Returns:
- all displays initialized
-
toFront
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
Called by the givenDisplayControlwhen it has been fully initialized.- Parameters:
control- The initialized DisplayControl
-
addDisplayControl
Add the givenDisplayControlinto the list of display controls. Update the user interfaces.- Specified by:
addDisplayControlin interfaceControlContext- Parameters:
control- The new display control
-
removeDisplayControl
Remove the givenDisplayControlfrom the list of display controls. Update the user interfaces.- Specified by:
removeDisplayControlin interfaceControlContext- 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
Implement the hyperlinklistener interface. This gets called code that handles html. It gets the URL from the event and callshandleAction(String,Hashtable).- Specified by:
hyperlinkUpdatein interfaceHyperlinkListener- Parameters:
e- TheHyperlinkEventevent
-
hyperlinkUpdate
Handle the click- Parameters:
e- eventproperties- any properties
-
handleFileOrUrlAction
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 actionproperties- any properties- Returns:
- Was this action handled
- Jython code -- starts with jython:
-
handleAction
handle action- Parameters:
action- action- Returns:
- handled action
-
handleAction
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:
handleActionin interfaceControlContext- 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
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 creationcheckForAlias- 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
Implementation of theActionListenerinterface. This passes the the action command from the givenActionEventoff to the handleAction method.- Specified by:
actionPerformedin interfaceActionListener- Parameters:
event- TheActionEvent
-
removeDataSource
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
Wrapper method aroundDataManager.getDataSources(). Returns the list ofDataSource-s currently being used in the application.- Specified by:
getDataSourcesin interfaceDataContext- Returns:
- List of current data sources.
-
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:
getAllDataSourcesin interfaceDataContext- Returns:
- List of all current data sources.
-
makeOneDataSource
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 imagesdataType- 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.xmlproperties- 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
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 imagesdataType- 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.xmlproperties- Optional properties to pass to the data source. May also contain the data source type id.- Returns:
- Was the creation successfull.
-
makeDataSource
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 imagesdataType- 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.xmlproperties- 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 imagesdataType- 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.xmlproperties- 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
Move a history to the front of the list- Parameters:
history- the history item to move
-
makeDataSourceFromXml
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 imagesdataType- 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.xmlproperties- 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
DataSourceResultsthat hold the results of this method.
-
selectDataType
Ask the user to select a data type for the given defining object- Specified by:
selectDataTypein interfaceDataContext- Parameters:
definingObject- The defining object for the data source- Returns:
- The data type name or null
-
selectDataType
Popup a dialog to allows the user to select data source type- Specified by:
selectDataTypein interfaceDataContext- Parameters:
definingObject- the object to create the data source withmessage- message to show the user- Returns:
- Selected data source type or null
-
loadDataSource
Load in aDataSource. Called from theDataManagerwhen a new data source has been created or unpersisted.- Specified by:
loadDataSourcein interfaceDataContext- 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
-
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 imagedataSourceName- 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.xmlproperties- 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:
createDisplayin interfaceControlContext- 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.xmlproperties- 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
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:
showWindowin interfaceControlContext- Parameters:
control- TheDisplayControlwhose window we should show.window- The window
-
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) - 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
This method is called by the helptips, passing in the name of the display control (from controls.xml). It createsDisplayControlwithout any data.- Parameters:
controlName- Id of the display control- Returns:
- The newly created display control.
-
doMakeControl
make a control- Parameters:
controlName- name of controldataChoice- with data choice- Returns:
- control
-
doMakeControl
make a control- Parameters:
controlName- name of controldataChoices- list of data choices- Returns:
- control
-
doMakeControl
Create theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoices- 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) - 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 theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoices- 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 theDisplayControl, identified by the givenControlDescriptorfor the given list ofDataChoices- Parameters:
dataChoices- List of data choices.descriptor- Defines the control to create.properties- Hashtable of propertiesdataSelection- 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 theDisplayControl, identified by the givenControlDescriptorusing the given list ofDataChoices- 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 theDisplayControl, identified by the given *ControlDescriptorusing the given list ofDataChoices- Parameters:
dataChoices- List of data choices.descriptor- Defines the control to create.properties- Hashtable of propertiesdataSelection- 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
Return the xml representation of the given object. If prettyPrint is true then format the xml with tabs, etc.- Parameters:
object- The object to xmlizeprettyPrint- Should the string xml be formatted- Returns:
- Xml representation of the given object
-
encodeObject
Return the xml representation of the given object. If prettyPrint is true then format the xml with tabs, etc.- Parameters:
object- The object to xmlizeprettyPrint- Should the string xml be formattedwithHeader- should we add the XML header- Returns:
- Xml representation of the given object
-
decodeObject
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
Create, if needed, and return the history list. This is the list ofHistoryobjects that that define the files and data sources the user has loaded in the past.- Returns:
- History list
-
addToHistoryList
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
Add the givenHistoryobject 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
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 opencheckUserPreference- Should we show, if needed, the Open dialogandRemove- 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
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
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
Create a newXmlEncoderfor doing unpersisting.- Returns:
- The encoder used for reading xml encoded objects
-
getEncoderForWrite
Create a newXmlEncoderfor doing persisting.- Returns:
- The encoder used for writing xml encoded objects
-
getEncoder
Get the XmlEncoder for this instance- Overrides:
getEncoderin classIdvBase- Returns:
- the encoder
-
getEncoder
Create anXmlEncoderand initialize it with the VisADPersistence delegates.- Parameters:
forRead- If true then we initialize the encoder for reading the xml- Returns:
- The new encoder
-
initEncoder
A hook so derived classes can add their own initialization to the given encoder.- Parameters:
encoder- The encoder to initializeforRead- 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
Helper method that calls LogUtil.printException- Parameters:
msg- The error messageexc- The exception
-
showWaitCursor
public void showWaitCursor()Pass through toIdvUIManager.showWaitCursor()- Specified by:
showWaitCursorin interfaceControlContext
-
showNormalCursor
public void showNormalCursor()Pass through toIdvUIManager.showNormalCursor()- Specified by:
showNormalCursorin interfaceControlContext
-
clearWaitCursor
public void clearWaitCursor()Pass through toIdvUIManager.clearWaitCursor() -
closeCurrentWindow
public void closeCurrentWindow()close current window -
waitLabelClicked
public void waitLabelClicked()The user clicked on the wait label -
main
Default main implementation. Just turn around and call DefaultIdv.main.- Parameters:
args- Command line arguments.- Throws:
Exception- When something bad happends
-
processScript
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
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
startup and run the image server- Parameters:
port- what port to listen onpropertyFile- properties - may be null
-
addErrorButtons
Implement the LogUtil.DialogManager interface to add buttons to the dialog. This adds the 'Support Form' button.- Specified by:
addErrorButtonsin interfaceLogUtil.DialogManager- Parameters:
dialog- The dialog to add to.buttonList- The list of buttons to add my button into.msg- The error messageexc- The exception that had been thrown.
-
listApi
Utility to list the public api of the given object- Parameters:
o- object- Returns:
- api
-