public class McIDASV extends ucar.unidata.idv.IntegratedDataViewer
This is where the startup and shutdown processes are handled, as well as the initialization of the application's various "managers".
Modifier and Type | Class and Description |
---|---|
private static class |
McIDASV.IdvResourceStreamHandler
Responsible for handling "idvresource" URLs.
|
private static class |
McIDASV.WarningResult |
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
actions
Actions passed into
handleAction(String, Hashtable, boolean) . |
private EntryStore |
addeEntries
Reference to the ADDE server manager.
|
protected McIdasChooserManager |
chooserManager
Chooser manager
|
private static boolean |
cleanExit
Whether or not the previous session was able to exit as it should.
|
private static long |
estimate
Initialization duration.
|
private static org.slf4j.Logger |
logger
Logging object.
|
private McIDASVMonitor |
mcvMonitor
HTTP based monitor to dump stack traces and shutdown McIDAS-V.
|
private MonitorManager |
monitorManager
MonitorManager allows for relatively easy and efficient
monitoring of various resources. |
private javax.swing.JCheckBox |
overwriteDataCbx
Accessory in file save dialog
|
private static java.util.Date |
previousStart
Date the previous session was started.
|
static ucar.unidata.idv.IdvResourceManager.XmlIdvResource |
RSC_FRAMEDEFAULTS
Points to the adde image defaults.
|
static ucar.unidata.idv.IdvResourceManager.XmlIdvResource |
RSC_SERVERS
Points to the server definitions.
|
private static java.lang.String |
SESSION_FILE
Path to a "session" file--it's created upon McIDAS-V
starting and removed when McIDAS-V exits cleanly.
|
private static long |
startTime
Initialization start time.
|
private static McIDASV |
staticMcv
Used to access McIDAS-V state in a static context.
|
private TabbedAddeManager |
tabbedAddeManager
GUI wrapper for ADDE server management.
|
static boolean |
useAquaLookAndFeel
Set to true only if "-forceaqua" was found in the command line.
|
private DirectoryWatchService |
watchService
Directory monitoring service.
|
controlDescriptorMap, controlDescriptors, displayControls
aliasEditor, args, argsManager, autoDisplayEditor, collabManager, colorTableEditor, colorTableManager, dataManager, displayConventions, idv, imageGenerator, installManager, jythonManager, paramDefaultsEditor, paramGroupsEditor, persistenceManager, pluginManager, preferenceManager, projectionManager, publishManager, resourceManager, resourceViewer, stateManager, stationModelManager, testManager, uiManager, vmManager
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_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 and Description |
---|
McIDASV(java.lang.String[] args)
Create the McIDASV with the given command line arguments.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addControlDescriptor(ucar.unidata.idv.ControlDescriptor cd)
Add a new
ControlDescriptor into the controlDescriptor
list and controlDescriptorMap . |
void |
addErrorButtons(javax.swing.JDialog dialog,
java.util.List buttonList,
java.lang.String msg,
java.lang.Throwable exc)
Overridden so that the support form becomes non-modal if launched from
an exception dialog.
|
private static void |
applyArgs(java.lang.String[] args)
Useful for providing the startup manager with values other than the
defaults...
|
boolean |
autoQuit()
This method is largely a copy of
IntegratedDataViewer.quit() ,
but allows for some GUI testing. |
private static void |
createSessionFile(java.lang.String path)
Attempts to create a "session" file.
|
private void |
detectAndHandleCrash()
Determine if the last "exit" was clean--whether or not
SESSION_FILE was removed before the McIDAS-V process terminated. |
void |
doClearDefaults()
Called from the menu command to clear the default bundle.
|
protected ucar.unidata.idv.ArgsManager |
doMakeArgsManager(java.lang.String[] args)
Creates a McIDAS-V argument manager so that McV can handle some non-IDV
command line things.
|
protected ucar.unidata.ui.colortable.ColorTableManager |
doMakeColorTableManager()
Make the
McIdasColorTableManager . |
protected ucar.unidata.data.DataManager |
doMakeDataManager()
Factory method to create the
McvDataManager . |
protected ucar.unidata.idv.chooser.IdvChooserManager |
doMakeIdvChooserManager()
Factory method to create a McIDAS-V
McIdasChooserManager . |
protected ucar.unidata.idv.ui.IdvUIManager |
doMakeIdvUIManager()
Factory method to create the
IdvUIManager . |
protected JythonManager |
doMakeJythonManager()
Factory method to create the McIDAS-V @link JythonManager}.
|
protected ucar.unidata.idv.IdvPersistenceManager |
doMakePersistenceManager()
McIDAS-V (alpha 10+) needs to handle both IDV bundles without
component groups and all bundles from prior McV alphas.
|
protected ucar.unidata.idv.PluginManager |
doMakePluginManager()
Factory method to create the
McvPluginManager . |
protected ucar.unidata.idv.IdvPreferenceManager |
doMakePreferenceManager()
Make the
McIdasPreferenceManager . |
protected ucar.unidata.idv.IdvResourceManager |
doMakeResourceManager()
Make the McIDAS-V
ResourceManager . |
protected StateManager |
doMakeStateManager()
Make the McIDAS-V
StateManager . |
protected ucar.unidata.idv.VMManager |
doMakeVMManager()
Create our own VMManager so that we can make the tabs play nice.
|
void |
doOpen(java.lang.String filename,
boolean checkUserPreference,
boolean andRemove) |
private void |
doOpenInThread(java.lang.String filename,
boolean checkUserPreference,
boolean andRemove)
Have the user select a bundle.
|
void |
doSaveAsDefaultLayout()
Makes
PersistenceManager save off a default "layout"
bundle. |
protected void |
exit(int exitCode)
Attempts a clean shutdown of McIDAS-V.
|
void |
exitMcIDASV(int exitCode)
Exposes
exit(int) to other classes. |
private static java.util.Date |
extractDate(java.lang.String path)
Attempts to extract a timestamp from
path . |
java.util.List<java.lang.String> |
getActionHistory()
Returns all of the actions used in this McIDAS-V session.
|
java.util.List<java.lang.String> |
getCommandLineArgs()
Converts
ArgsManager.getOriginalArgs() to a List and
returns. |
java.util.List |
getControlDescriptors(boolean includeTemplates)
This returns the set of
ControlDescriptors
that can be shown. |
ucar.unidata.idv.IntegratedDataViewer |
getIdv()
Get McIDASV.
|
static java.lang.String |
getJavaDriveLetter()
If McIDAS-V is running on Windows, this method will return a
String that looks like "C:" or "D:", etc. |
int |
getMaxDataThreadCount()
Get the maximum number of threads to be used when reading data.
|
int |
getMaxRenderThreadCount()
Get the maximum number of threads to be used when rendering in VisAD.
|
McIdasChooserManager |
getMcIdasChooserManager()
Create, if needed, and return the
McIdasChooserManager . |
McvDataManager |
getMcvDataManager() |
MonitorManager |
getMonitorManager()
Returns the
MonitorManager . |
EntryStore |
getServerManager()
Creates a new server manager (if needed) and returns it.
|
static java.lang.String |
getSessionFilePath()
Returns the (current) path to the session file.
|
long |
getStartupDuration()
Returns the time it took for McIDAS-V to start up.
|
static McIDASV |
getStaticMcv()
Returns a reference to the current McIDAS-V object.
|
java.lang.String |
getUserDirectory()
Return the current "userpath".
|
java.lang.String |
getUserFile(java.lang.String filename)
Return the path to a file within "userpath".
|
ucar.unidata.idv.ViewManager |
getViewManager(ucar.unidata.idv.ViewDescriptor viewDescriptor,
boolean newWindow,
java.lang.String properties)
Overridden so that McIDAS-V doesn't have to create an entire new
IdvWindow if
VMManager.findViewManager(ViewDescriptor) can't find an
appropriate ViewManager for viewDescriptor . |
DirectoryWatchService |
getWatchService()
Returns McIDAS-V's
DirectoryWatchService . |
private static boolean |
hadCleanExit(java.lang.String path)
Tries to determine whether or not the last McIDAS-V session ended
"cleanly".
|
boolean |
handleAction(java.lang.String action,
java.util.Hashtable properties,
boolean checkForAlias)
Captures the action passed to
handleAction . |
protected boolean |
handleFileOrUrlAction(java.lang.String action,
java.util.Hashtable properties)
This method checks if the given action is one of the following.
|
private static void |
handleWelcomeWindow(java.lang.String... args)
Show the McIDAS-V "Welcome Window" for the first start up.
|
boolean |
hasDefaultLayout()
Determines whether or not a default layout exists.
|
void |
initDone()
Called after the IDV has finished setting everything up after starting.
|
protected void |
initEncoder(ucar.unidata.xml.XmlEncoder encoder,
boolean forRead)
Initializes a XML encoder with McIDAS-V specific XML delegates.
|
void |
initPropertyFiles(java.util.List files)
Load the McV properties.
|
static boolean |
isLoopback(java.lang.String host)
Attempts to determine if a given string is a
"loopback address" (aka localhost).
|
static boolean |
isMac()
Are we on a Mac?
|
static boolean |
isUnixLike()
Queries the
os.name system property and if the result does not
start with "Windows", the platform is assumed to be
"unix-like". |
static boolean |
isWindows()
Queries the
os.name system property and if the result starts
with "Windows", the platform is assumed to be Windows. |
void |
MacOSXAbout() |
void |
MacOSXPreferences() |
boolean |
MacOSXQuit() |
static void |
main(java.lang.String... args)
Configure the logging and create the McIDAS-V object responsible for
initializing the application session.
|
javax.swing.JComponent |
makeHelpButton(java.lang.String helpId,
java.lang.String toolTip)
Make a help button for a particular help topic
|
void |
onServerManagerWindowEvent(TabbedAddeManager.Event evt)
Responds to events generated by the server manager's GUI.
|
private void |
overridePreferences()
This method is useful for storing commandline "properties"
with the user's preferences.
|
void |
registerForMacOSXEvents()
Generic registration with the macOS application menu.
|
private static void |
registerProtocolHandlers()
Register "adde" and "idvresource" URL protocols.
|
boolean |
removeAllData(boolean showWarning)
Handles removing all loaded data sources.
|
void |
removeAllDataSources()
Overridden so that McIDAS-V can prompt the user before removing, if
necessary.
|
void |
removeAllDisplays()
Overridden so that McIDAS-V can prompt the user before removing, if
necessary.
|
boolean |
removeAllLayers(boolean showWarning)
Handles removing all loaded layers ("displays" in IDV-land).
|
void |
removeAllLayersAndData()
Handles removing all loaded layers ("displays" in IDV-land)
and data sources.
|
private static void |
removeSessionFile(java.lang.String path)
Attempts to remove the file accessible via
path . |
void |
removeTabData() |
void |
removeTabLayers() |
void |
removeTabLayersAndData() |
void |
runPluginMainMethod(java.lang.String className)
Invokes the main method for a given class.
|
void |
setIdv(ucar.unidata.idv.IntegratedDataViewer idv) |
void |
showLayerVisibilityAnimator() |
void |
showServerManager()
Creates (if needed) the server manager GUI and displays it.
|
private java.util.Set<McIDASV.WarningResult> |
showWarningDialog(java.lang.String title,
java.lang.String message,
java.lang.String prefId,
java.lang.String prefLabel,
java.lang.String okLabel,
java.lang.String cancelLabel)
Helper method for showing the removal warning dialog.
|
protected void |
startMonitor()
Start up the McIDAS-V monitor server.
|
void |
startWatchService()
Enable directory monitoring.
|
void |
stopWatchService()
Disable directory monitoring.
|
void |
watchDirectory(java.lang.String path,
java.lang.String glob,
OnFileChangeListener listener)
Register the given
listener so that changes to files matching
glob in path can be handled. |
actionPerformed, addDisplayControl, addToHistoryList, addToHistoryList, applyPreferences, checkSystem, cleanup, clearCachedData, clearHistoryList, clearWaitCursor, closeCurrentWindow, controlHasBeenInitialized, createDataSelector, createDataSource, createDisplay, createDisplay, createImage, createNewWindow, dataSourceChanged, decodeObject, doImport, doMakeBackgroundImage, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeControl, doMakeDataChoiceMenu, doOpen, doOpen, doOpenDefault, doSave, doSaveAs, doSaveAsDefault, encodeObject, encodeObject, evaluateAndSave, flushDataCache, getAllControlDescriptors, getAllDataSources, getAllDisplaysIntialized, getBackgroundImages, getChangeDataPathCbx, getChangeDataPaths, getControlDescriptor, getControlDescriptors, getDataSources, getDerivedDataChoices, getDisplayControls, getEncoder, getEncoder, getEncoderForRead, getEncoderForWrite, getHaveInitialized, getHistory, getInteractiveMode, getLocationList, getProjections, getServerMode, getStaticImage, getUseTimeDriver, getViewManager, getViewManager, getViewManagerProperties, handleAction, handleAction, hyperlinkUpdate, hyperlinkUpdate, init, initCacheManager, initInner, initPreferences, listApi, loadDataFiles, loadDataSource, loadRbiFile, logException, makeDataSource, makeDataSource, makeDataSource, makeDataSource, makeDataSourceFromXml, makeHelpButton, makeOneDataSource, moveHistoryToFront, okToShowWindows, printCache, printCacheStats, printDataCacheStats, processScript, quit, registerHelpKey, reloadAllDataSources, removeAllDisplays, removeDataSource, removeDisplayControl, runImageServer, saveInCache, saveInCache, saveInCache, saveInCache, selectDataChoice, selectDataChoices, selectDataType, selectDataType, selectUserChoices, showConsole, showNormalCursor, showWaitCursor, showWindow, toFront, waitLabelClicked, waitUntilDisplaysAreDone, writeHistoryList
addPluginClass, createElement, doMakeAliasEditor, doMakeAutoDisplayEditor, doMakeCollabManager, doMakeColorTableEditor, doMakeDisplayConventions, doMakeIdvProjectionManager, doMakeImageGenerator, doMakeInstallManager, doMakeParamDefaultsEditor, doMakeParamGroupsEditor, doMakePublishManager, doMakeResourceViewer, doMakeStationModelManager, doMakeTestManager, getAliasEditor, getArgsManager, getAutoDisplayEditor, getCollabManager, getColorProperty, getColorTableEditor, getColorTableManager, getDataManager, getDisplayConventions, 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, showAliasEditor, showAutoDisplayEditor, showChooser, showChooserModal, showColorTableEditor, showColorTableEditor, showDefaultsEditor, showIdvProjectionManager, showParamGroupsEditor, showPreferenceManager, showResourceViewer, showStationModelEditor
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
private static final org.slf4j.Logger logger
private static long startTime
main(String[])
, and is used to estimate the duration of the
session's initialization phase.private static long estimate
initDone()
.private static java.lang.String SESSION_FILE
private static boolean cleanExit
false
, the previous session likely crashed.private static java.util.Date previousStart
null
.public static boolean useAquaLookAndFeel
public static final ucar.unidata.idv.IdvResourceManager.XmlIdvResource RSC_FRAMEDEFAULTS
public static final ucar.unidata.idv.IdvResourceManager.XmlIdvResource RSC_SERVERS
private javax.swing.JCheckBox overwriteDataCbx
protected McIdasChooserManager chooserManager
private McIDASVMonitor mcvMonitor
private final MonitorManager monitorManager
MonitorManager
allows for relatively easy and efficient
monitoring of various resources.private final java.util.List<java.lang.String> actions
handleAction(String, Hashtable, boolean)
.private EntryStore addeEntries
private TabbedAddeManager tabbedAddeManager
AddePreferences
.
Value may be null
.
private final DirectoryWatchService watchService
public McIDASV(java.lang.String[] args) throws java.io.IOException, VisADException
IntegratedDataViewer.init()
args
- Command line argumentsVisADException
- from construction of VisAd objectsjava.rmi.RemoteException
- from construction of VisAD objectsjava.io.IOException
public void registerForMacOSXEvents()
Checks the platform, then attempts to register with Apple's "EAWT" stuff.
See OSXAdapter.java
to learn how this is done without
directly referencing any Apple APIs.
public boolean MacOSXQuit()
public void MacOSXAbout()
public void MacOSXPreferences()
public int getMaxRenderThreadCount()
getMaxRenderThreadCount
in class ucar.unidata.idv.IntegratedDataViewer
Runtime.availableProcessors()
.public int getMaxDataThreadCount()
getMaxDataThreadCount
in class ucar.unidata.idv.IntegratedDataViewer
4
.protected void startMonitor()
This is an HTTP server on the port defined by the property
idv.monitorport
. Default value is 8788.
It is only accessible to 127.0.0.1 (localhost).
startMonitor
in class ucar.unidata.idv.IntegratedDataViewer
protected void initEncoder(ucar.unidata.xml.XmlEncoder encoder, boolean forRead)
initEncoder
in class ucar.unidata.idv.IntegratedDataViewer
encoder
- XML encoder that'll be dealing with persistence.forRead
- Not used as of yet.public java.util.List<java.lang.String> getActionHistory()
public java.util.List<java.lang.String> getCommandLineArgs()
ArgsManager.getOriginalArgs()
to a List
and
returns.ArrayList
.public boolean handleAction(java.lang.String action, java.util.Hashtable properties, boolean checkForAlias)
handleAction
. The action is logged
and additionally, if the action is a HTML link, we attempt to visit the
link in the user's preferred browser.handleAction
in class ucar.unidata.idv.IntegratedDataViewer
protected boolean handleFileOrUrlAction(java.lang.String action, java.util.Hashtable properties)
It returns true
if the action is one of these. false
otherwise.
handleFileOrUrlAction
in class ucar.unidata.idv.IntegratedDataViewer
action
- The string actionproperties
- any propertiestrue
if the action was "handled";
false
otherwise.protected void addControlDescriptor(ucar.unidata.idv.ControlDescriptor cd)
ControlDescriptor
into the controlDescriptor
list and controlDescriptorMap
.
This method differs from the IDV's in that McIDAS-V overwrites
existing ControlDescriptor ControlDescriptors
if
ControlDescriptor.getControlId()
matches.
addControlDescriptor
in class ucar.unidata.idv.IntegratedDataViewer
cd
- The ControlDescriptor to add.java.lang.NullPointerException
- if cd
is null
.public void showLayerVisibilityAnimator()
public boolean removeAllData(boolean showWarning)
If ArgsManager.getIsOffScreen()
is true
, this method
will ignore the user's preferences and remove all data sources.
showWarning
- Whether or not to display a warning message before
removing all data sources. See the return details for more.true
if the user wants to continue showing the
warning dialog, or false
if they've elected to stop showing the
warning. If showWarning
is false
, this method will
always return false
, as the user isn't interested in seeing the
warning.public boolean removeAllLayers(boolean showWarning)
If ArgsManager.getIsOffScreen()
is true
, this method
will ignore the user's preferences and remove all layers.
showWarning
- Whether or not to display a warning message before
removing all layers. See the return details for more.true
if the user wants to continue showing the
warning dialog, or false
if they've elected to stop showing the
warning. If showWarning
is false
, this method will
always return false
, as the user isn't interested in seeing the
warning.public void removeAllDataSources()
removeAllDataSources
in class ucar.unidata.idv.IntegratedDataViewer
public void removeAllDisplays()
removeAllDisplays
in class ucar.unidata.idv.IntegratedDataViewer
public void removeAllLayersAndData()
If ArgsManager.getIsOffScreen()
is true
, this method
will ignore the user's preferences and remove all layers and data.
removeAllData(boolean)
,
removeAllLayers(boolean)
private java.util.Set<McIDASV.WarningResult> showWarningDialog(java.lang.String title, java.lang.String message, java.lang.String prefId, java.lang.String prefLabel, java.lang.String okLabel, java.lang.String cancelLabel)
null
or empty.title
- Title of the warning dialog.message
- Contents of the warning. May contain HTML, but you do
not need to provide opening and closing "html" tags.prefId
- ID of the preference that controls whether or not the
dialog should be displayed.prefLabel
- Brief description of the preference.okLabel
- Text of button that signals removal.cancelLabel
- Text of button that signals cancelling removal.Set
of WarningResults
that
describes what the user opted to do. Should always contain only
two elements. One for whether or not "ok" or
"cancel" was clicked, and one for whether or not the warning
should continue to be displayed.public void removeTabData()
public void removeTabLayers()
public void removeTabLayersAndData()
public ucar.unidata.idv.ViewManager getViewManager(ucar.unidata.idv.ViewDescriptor viewDescriptor, boolean newWindow, java.lang.String properties)
IdvWindow
if
VMManager.findViewManager(ViewDescriptor)
can't find an
appropriate ViewManager for viewDescriptor
.
Not doing the above causes McIDAS-V to get stuck in a window creation loop.
getViewManager
in interface ucar.unidata.idv.ControlContext
getViewManager
in class ucar.unidata.idv.IntegratedDataViewer
public static McIDASV getStaticMcv()
null
.public void setIdv(ucar.unidata.idv.IntegratedDataViewer idv)
setIdv
in class ucar.unidata.idv.IdvBase
IdvBase.setIdv(ucar.unidata.idv.IntegratedDataViewer)
public void initPropertyFiles(java.util.List files)
initPropertyFiles
in class ucar.unidata.idv.IntegratedDataViewer
IntegratedDataViewer.initPropertyFiles(java.util.List)
public void doSaveAsDefaultLayout()
PersistenceManager
save off a default "layout"
bundle.public boolean hasDefaultLayout()
true
if there is a default layout, false
otherwise.public void doClearDefaults()
doClearDefaults
in class ucar.unidata.idv.IntegratedDataViewer
public long getStartupDuration()
System.nanoTime()
calls against one another.public void addErrorButtons(javax.swing.JDialog dialog, java.util.List buttonList, java.lang.String msg, java.lang.Throwable exc)
Overridden so that the support form becomes non-modal if launched from an exception dialog.
addErrorButtons
in interface ucar.unidata.util.LogUtil.DialogManager
addErrorButtons
in class ucar.unidata.idv.IntegratedDataViewer
IntegratedDataViewer.addErrorButtons(JDialog, List, String, Throwable)
private void overridePreferences()
private void detectAndHandleCrash()
SESSION_FILE
was removed before the McIDAS-V process terminated.
If the exit was not clean, the user is prompted to submit a support request.
public void initDone()
SESSION_FILE
was
removed before the McIDAS-V process terminated.
Called after the IDV has finished setting everything up. McIDAS-V uses
this method to handle:
-doaction
flag (if any).initDone
in class ucar.unidata.idv.IntegratedDataViewer
ArgumentManager.clearAutomaticDisplayArgs()
,
overridePreferences()
,
detectAndHandleCrash()
public void doOpen(java.lang.String filename, boolean checkUserPreference, boolean andRemove)
doOpen
in class ucar.unidata.idv.IntegratedDataViewer
IntegratedDataViewer.doOpen(String, boolean, boolean)
private void doOpenInThread(java.lang.String filename, boolean checkUserPreference, boolean andRemove)
filename
- The filename to opencheckUserPreference
- Should we show, if needed, the
"open" dialogandRemove
- If true then first remove all data sources and displaysprotected JythonManager doMakeJythonManager()
doMakeJythonManager
in class ucar.unidata.idv.IdvBase
JythonManager
.protected ucar.unidata.idv.chooser.IdvChooserManager doMakeIdvChooserManager()
McIdasChooserManager
.
Here we create our own manager so it can do things specific to McIDAS-V.doMakeIdvChooserManager
in class ucar.unidata.idv.IdvBase
McIdasChooserManager
indicated by the startup properties.IdvBase.doMakeIdvChooserManager()
protected ucar.unidata.idv.ui.IdvUIManager doMakeIdvUIManager()
IdvUIManager
. Here we create our
own UI manager so it can do things specific to McIDAS-V.doMakeIdvUIManager
in class ucar.unidata.idv.IdvBase
UIManager
indicated by the startup properties.IdvBase.doMakeIdvUIManager()
protected ucar.unidata.idv.VMManager doMakeVMManager()
doMakeVMManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakeVMManager()
protected ucar.unidata.idv.IdvPreferenceManager doMakePreferenceManager()
McIdasPreferenceManager
.doMakePreferenceManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakePreferenceManager()
protected ucar.unidata.idv.IdvPersistenceManager doMakePersistenceManager()
McIDAS-V (alpha 10+) needs to handle both IDV bundles without component groups and all bundles from prior McV alphas. You better believe we need to extend the persistence manager functionality!
doMakePersistenceManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakePersistenceManager()
public McIdasChooserManager getMcIdasChooserManager()
McIdasChooserManager
.public MonitorManager getMonitorManager()
MonitorManager
.public void onServerManagerWindowEvent(TabbedAddeManager.Event evt)
TabbedAddeManager.Event#CLOSED
.evt
- TabbedAddeManager
event to respond to.public void showServerManager()
public EntryStore getServerManager()
public McvDataManager getMcvDataManager()
public ucar.unidata.idv.IntegratedDataViewer getIdv()
getIdv
in interface ucar.unidata.data.DataContext
getIdv
in interface ucar.unidata.idv.ControlContext
getIdv
in class ucar.unidata.idv.IdvBase
IdvBase.getIdv()
protected ucar.unidata.idv.ArgsManager doMakeArgsManager(java.lang.String[] args)
doMakeArgsManager
in class ucar.unidata.idv.IdvBase
args
- The arguments from the command line.IdvBase.doMakeArgsManager(java.lang.String[])
protected ucar.unidata.data.DataManager doMakeDataManager()
McvDataManager
.doMakeDataManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakeDataManager()
protected StateManager doMakeStateManager()
StateManager
.doMakeStateManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakeStateManager()
protected ucar.unidata.idv.IdvResourceManager doMakeResourceManager()
ResourceManager
.doMakeResourceManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakeResourceManager()
protected ucar.unidata.ui.colortable.ColorTableManager doMakeColorTableManager()
McIdasColorTableManager
.doMakeColorTableManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakeColorTableManager()
protected ucar.unidata.idv.PluginManager doMakePluginManager()
McvPluginManager
.doMakePluginManager
in class ucar.unidata.idv.IdvBase
IdvBase.doMakePluginManager()
public javax.swing.JComponent makeHelpButton(java.lang.String helpId, java.lang.String toolTip)
makeHelpButton
in class ucar.unidata.idv.IntegratedDataViewer
helpId
- the topic idtoolTip
- the tooltippublic java.lang.String getUserDirectory()
public java.lang.String getUserFile(java.lang.String filename)
filename
- File within the userpath.public void runPluginMainMethod(java.lang.String className)
Note: this is rather limited so far as it doesn't pass in any arguments.
className
- Class whose main method is to be invoked. Cannot be
null
.public static boolean isLoopback(java.lang.String host)
Strings are trimmed and converted to lowercase, and currently checked against:
127.0.0.1
::1
(for IPv6)localhost
.host
- String
to check. Should not be null
.true
if host
is a recognized loopback address.
false
otherwise.java.lang.NullPointerException
- if host
is null
.public static boolean isMac()
true
if this session is running on top of OS X,
false
otherwise.public static boolean isUnixLike()
os.name
system property and if the result does not
start with "Windows", the platform is assumed to be
"unix-like".
Given the McIDAS-V supported platforms (Windows, "Unix", and OS X), the above logic is safe.
true
if we're not running on Windows, false
otherwise.java.lang.RuntimeException
- if there is no property associated with
os.name
.public static boolean isWindows()
os.name
system property and if the result starts
with "Windows", the platform is assumed to be Windows. Duh.true
if we're running on Windows, false
otherwise.java.lang.RuntimeException
- if there is no property associated with
os.name
.public static java.lang.String getJavaDriveLetter()
String
that looks like "C:" or "D:", etc.
If McIDAS-V is not running on Windows, this method will return an
empty String
.
java.home
property or an empty String
if McIDAS-V isn't running on Windows.java.lang.RuntimeException
- if there is no property associated with
java.home
.private static void createSessionFile(java.lang.String path)
path
- Path of the session file that should get created.
null
values are not allowed, and sufficient priviledges are
assumed.java.lang.AssertionError
- if McIDAS-V couldn't write to path
.SESSION_FILE
,
hadCleanExit(String)
,
removeSessionFile(String)
private static java.util.Date extractDate(java.lang.String path)
path
. path
is
expected to only contain a single line consisting of a
Long
integer.path
- Path to the file of interest.Date
of the timestamp contained in
path
or null
if the extraction failed.private static void removeSessionFile(java.lang.String path)
path
.path
- Path of the file that'll get removed. This should be
non-null and point to an existing and writable filename (not a
directory).java.lang.AssertionError
- if the file at path
could not be
removed.SESSION_FILE
,
createSessionFile(String)
,
hadCleanExit(String)
private static boolean hadCleanExit(java.lang.String path)
path
- Path to the session file to check. Can't be null
.true
if the file pointed at by path
does
NOT exist, false
if it does exist.SESSION_FILE
,
createSessionFile(String)
,
removeSessionFile(String)
public static java.lang.String getSessionFilePath()
String
pointing to the session file.SESSION_FILE
private static void applyArgs(java.lang.String[] args)
SESSION_FILE
.args
- Likely the argument array coming from the main method.public java.util.List getControlDescriptors(boolean includeTemplates)
ControlDescriptors
that can be shown. The ordering of this list determines the
"default" controls shown in the Field Selector, so we override
here for control over the ordering.getControlDescriptors
in class ucar.unidata.idv.IntegratedDataViewer
includeTemplates
- If true then include the display templatesprivate static void handleWelcomeWindow(java.lang.String... args)
args
- Commandline arguments, used to handle autoquit stress testing.private static void registerProtocolHandlers()
This needs to be called pretty early in the McIDAS-V initialization process. They're currently being registered immediately after the session file is created.
public static void main(java.lang.String... args) throws java.lang.Exception
args
- Command line arguments.java.lang.Exception
- When something untoward happens.protected void exit(int exitCode)
addeEntries
, removing SESSION_FILE
, and disabling
the directory monitors found in the file choosers.exit
in class ucar.unidata.idv.IntegratedDataViewer
exitCode
- System exit code to use.IntegratedDataViewer.quit()
public boolean autoQuit()
IntegratedDataViewer.quit()
,
but allows for some GUI testing.public void watchDirectory(java.lang.String path, java.lang.String glob, OnFileChangeListener listener) throws java.io.IOException
listener
so that changes to files matching
glob
in path
can be handled.path
- Directory to watch.glob
- Only respond to files matching this file mask.listener
- Listener that can handle file changes.java.io.IOException
- if there was a problem registering listener
.public DirectoryWatchService getWatchService()
DirectoryWatchService
.DirectoryWatchService
responsible for handling all of
McIDAS-V's directory monitoring.public void startWatchService()
public void stopWatchService()
public void exitMcIDASV(int exitCode)
exit(int)
to other classes.exitCode
- System exit code to use.exit(int)