|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectucar.unidata.idv.IdvBase
ucar.unidata.idv.IntegratedDataViewer
public class IntegratedDataViewer
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:
DefaultIdv.main(String[]))
ArgsManager.
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.
ArgsManager.parseArgs(). This parses the command line arguments.
If your IDV app needs to have its own command line arguments then override the
doMakeArgsManager (String[]args) to create your own ArgsManager.
StateManager.loadProperties() to load in the property files.
| 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, jythonManager, paramDefaultsEditor, paramGroupsEditor, persistenceManager, pluginManager, preferenceManager, projectionManager, publishManager, resourceManager, stateManager, stationModelManager, testManager, uiManager, vmManager |
| 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()
|
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. |
List |
getAllControlDescriptors()
Return all the ControlDescriptors |
List |
getAllDataSources()
Gets all of the data sources. |
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(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. |
protected List |
getProjections()
Return the list of Projections |
protected byte[] |
getStaticImage(String bundle)
Get image |
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. |
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 |
printCacheStats()
Print cache statistics |
static void |
processScript(String scriptFile)
Get the image from the given isl script. |
void |
publishToThredds()
For now a hack for John's demo |
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)
Ask the user what data type to use |
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. |
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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected List displayControls
DisplayControls currently active
protected List controlDescriptors
ControlDescriptors defined in the controls.xml file
protected Hashtable controlDescriptorMap
ControlDescriptor
| Constructor Detail |
|---|
public IntegratedDataViewer()
throws VisADException,
RemoteException
VisADException - from construction of VisAd objects
RemoteException - from construction of VisAD objects
public IntegratedDataViewer(String[] args)
throws VisADException,
RemoteException
init() method should be called.
We have the derived class call init so that the object
has been fully instantiated when init is called.
args - The command line arguments
VisADException - from construction of VisAd objects
RemoteException - from construction of VisAD objects
public IntegratedDataViewer(boolean interactiveMode)
throws VisADException,
RemoteException
interactiveMode - Is interactive
RemoteException - On badness
VisADException - On badness
public IntegratedDataViewer(String[] args,
boolean interactiveMode)
throws VisADException,
RemoteException
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.
RemoteException - On badness
VisADException - On badness| Method Detail |
|---|
public boolean getInteractiveMode()
protected void checkSystem()
public void waitUntilDisplaysAreDone()
protected final void init()