public class McIDASV extends IntegratedDataViewer
Modifier and Type | Class and Description |
---|---|
private static class |
McIDASV.WarningResult |
Modifier and Type | Field and Description |
---|---|
private List<String> |
actions
Actions passed into
handleAction(String, Hashtable, boolean) . |
private EntryStore |
addeEntries |
protected McIdasChooserManager |
chooserManager
The chooser manager
|
private static boolean |
cleanExit |
private static long |
estimate
Set at the end of
initDone() . |
private static org.slf4j.Logger |
logger |
private McIDASVMonitor |
mcvMonitor
The http based monitor to dump stack traces and shutdown the IDV
|
private MonitorManager |
monitorManager
MonitorManager allows for relatively easy and efficient
monitoring of various resources. |
private JCheckBox |
overwriteDataCbx
Accessory in file save dialog
|
private static Date |
previousStart |
static IdvResourceManager.XmlIdvResource |
RSC_FRAMEDEFAULTS
Points to the adde image defaults.
|
static IdvResourceManager.XmlIdvResource |
RSC_SERVERS
Points to the server definitions.
|
private static 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
Set at the beginning of
main(String[]) . |
private static McIDASV |
staticMcv
Used to access McIDAS-V state in a static context.
|
private TabbedAddeManager |
tabbedAddeManager |
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(String[] args)
Create the McIDASV with the given command line arguments.
|
Modifier and Type | Method and Description |
---|---|
protected void |
addControlDescriptor(ControlDescriptor cd)
|
void |
addErrorButtons(JDialog dialog,
List buttonList,
String msg,
Throwable exc)
Overridden so that the support form becomes non-modal if launched from
an exception dialog.
|
private static void |
applyArgs(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(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 ArgsManager |
doMakeArgsManager(String[] args)
Creates a McIDAS-V argument manager so that McV can handle some non-IDV
command line things.
|
protected ColorTableManager |
doMakeColorTableManager()
Make the
McIdasColorTableManager . |
protected DataManager |
doMakeDataManager()
Factory method to create the
McvDataManager . |
protected IdvChooserManager |
doMakeIdvChooserManager()
Factory method to create a McIDAS-V
McIdasChooserManager . |
protected IdvUIManager |
doMakeIdvUIManager()
Factory method to create the
IdvUIManager . |
protected JythonManager |
doMakeJythonManager()
Factory method to create the McIDAS-V @link JythonManager}.
|
protected IdvPersistenceManager |
doMakePersistenceManager()
McIDAS-V (alpha 10+) needs to handle both IDV bundles without
component groups and all bundles from prior McV alphas.
|
protected PluginManager |
doMakePluginManager()
Factory method to create the
McvPluginManager . |
protected IdvPreferenceManager |
doMakePreferenceManager()
Make the
McIdasPreferenceManager . |
protected IdvResourceManager |
doMakeResourceManager()
Make the McIDAS-V
ResourceManager . |
protected StateManager |
doMakeStateManager()
Make the McIDAS-V
StateManager . |
protected VMManager |
doMakeVMManager()
Create our own VMManager so that we can make the tabs play nice.
|
void |
doOpen(String filename,
boolean checkUserPreference,
boolean andRemove) |
private void |
doOpenInThread(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 Date |
extractDate(String path)
Attempts to extract a timestamp from
path . |
List<String> |
getActionHistory()
Returns all of the actions used in this McIDAS-V session.
|
List<String> |
getCommandLineArgs()
Converts
ArgsManager.getOriginalArgs() to a List and
returns. |
List |
getControlDescriptors(boolean includeTemplates)
This returns the set of
ControlDescriptors
that can be shown. |
IntegratedDataViewer |
getIdv()
Get McIDASV.
|
static 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 String |
getSessionFilePath()
Returns the (current) path to the session file.
|
static McIDASV |
getStaticMcv()
Returns a reference to the current McIDAS-V object.
|
String |
getUserDirectory()
Return the current "userpath".
|
String |
getUserFile(String filename)
Return the path to a file within "userpath".
|
ViewManager |
getViewManager(ViewDescriptor viewDescriptor,
boolean newWindow,
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(String path)
Tries to determine whether or not the last McIDAS-V session ended
"cleanly".
|
boolean |
handleAction(String action,
Hashtable properties,
boolean checkForAlias)
Captures the action passed to
handleAction . |
protected boolean |
handleFileOrUrlAction(String action,
Hashtable properties)
This method checks if the given action is one of the following.
|
private static void |
handleWelcomeWindow(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(XmlEncoder encoder,
boolean forRead)
Initializes a XML encoder with McIDAS-V specific XML delegates.
|
void |
initPropertyFiles(List files)
Load the McV properties.
|
static boolean |
isLoopback(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(String... args)
The main.
|
JComponent |
makeHelpButton(String helpId,
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() |
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(String path)
Attempts to remove the file accessible via
path . |
void |
removeTabData() |
void |
removeTabLayers() |
void |
removeTabLayersAndData() |
void |
runPluginMainMethod(String className)
Invokes the main method for a given class.
|
void |
setIdv(IntegratedDataViewer idv) |
void |
showLayerVisibilityAnimator() |
void |
showServerManager()
Creates (if needed) the server manager GUI and displays it.
|
private Set<McIDASV.WarningResult> |
showWarningDialog(String title,
String message,
String prefId,
String prefLabel,
String okLabel,
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(String path,
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
getColorTableManager, getDisplayConventions, getObjectStore, getPersistenceManager, getPreferenceManager, getResourceManager, getStationModelManager
getJythonManager, getPreference
getColorProperty, getProperty, getProperty
private static final org.slf4j.Logger logger
private static long startTime
main(String[])
.private static long estimate
initDone()
.private static String SESSION_FILE
private static boolean cleanExit
private static Date previousStart
public static boolean useAquaLookAndFeel
public static final IdvResourceManager.XmlIdvResource RSC_FRAMEDEFAULTS
public static final IdvResourceManager.XmlIdvResource RSC_SERVERS
private 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 List<String> actions
handleAction(String, Hashtable, boolean)
.private EntryStore addeEntries
private TabbedAddeManager tabbedAddeManager
private final DirectoryWatchService watchService
public McIDASV(String[] args) throws IOException, VisADException, RemoteException
IntegratedDataViewer.init()
args
- Command line argumentsVisADException
- from construction of VisAd objectsRemoteException
- from construction of VisAD objectsIOException
public void registerForMacOSXEvents()
public boolean MacOSXQuit()
public void MacOSXAbout()
public void MacOSXPreferences()
public int getMaxRenderThreadCount()
getMaxRenderThreadCount
in class IntegratedDataViewer
Runtime.availableProcessors()
.public int getMaxDataThreadCount()
getMaxDataThreadCount
in class IntegratedDataViewer
4
.protected void startMonitor()
idv.monitorport
(8788).
It is only accessible to 127.0.0.1 (localhost)startMonitor
in class IntegratedDataViewer
protected void initEncoder(XmlEncoder encoder, boolean forRead)
initEncoder
in class IntegratedDataViewer
encoder
- XML encoder that'll be dealing with persistence.forRead
- Not used as of yet.public List<String> getActionHistory()
public List<String> getCommandLineArgs()
ArgsManager.getOriginalArgs()
to a List
and
returns.ArrayList
.public boolean handleAction(String action, 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 IntegratedDataViewer
protected boolean handleFileOrUrlAction(String action, Hashtable properties)
It returns true
if the action is one of these. false
otherwise.
handleFileOrUrlAction
in class IntegratedDataViewer
action
- The string actionproperties
- any propertiestrue
if the action was "handled";
false
otherwise.protected void addControlDescriptor(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 IntegratedDataViewer
cd
- The ControlDescriptor to add.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 IntegratedDataViewer
public void removeAllDisplays()
removeAllDisplays
in class 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 Set<McIDASV.WarningResult> showWarningDialog(String title, String message, String prefId, String prefLabel, String okLabel, 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 ViewManager getViewManager(ViewDescriptor viewDescriptor, boolean newWindow, 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 ControlContext
getViewManager
in class IntegratedDataViewer
public static McIDASV getStaticMcv()
null
.public void setIdv(IntegratedDataViewer idv)
setIdv
in class IdvBase
IdvBase.setIdv(ucar.unidata.idv.IntegratedDataViewer)
public void initPropertyFiles(List files)
initPropertyFiles
in class 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 IntegratedDataViewer
public void addErrorButtons(JDialog dialog, List buttonList, String msg, Throwable exc)
Overridden so that the support form becomes non-modal if launched from an exception dialog.
addErrorButtons
in interface LogUtil.DialogManager
addErrorButtons
in class 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 IntegratedDataViewer
ArgumentManager.clearAutomaticDisplayArgs()
,
overridePreferences()
,
detectAndHandleCrash()
public void doOpen(String filename, boolean checkUserPreference, boolean andRemove)
doOpen
in class IntegratedDataViewer
IntegratedDataViewer.doOpen(String, boolean, boolean)
private void doOpenInThread(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 IdvBase
JythonManager
.protected IdvChooserManager doMakeIdvChooserManager()
McIdasChooserManager
.
Here we create our own manager so it can do things specific to McIDAS-V.doMakeIdvChooserManager
in class IdvBase
McIdasChooserManager
indicated by the startup properties.IdvBase.doMakeIdvChooserManager()
protected IdvUIManager doMakeIdvUIManager()
IdvUIManager
. Here we create our
own UI manager so it can do things specific to McIDAS-V.doMakeIdvUIManager
in class IdvBase
UIManager
indicated by the startup properties.IdvBase.doMakeIdvUIManager()
protected VMManager doMakeVMManager()
doMakeVMManager
in class IdvBase
IdvBase.doMakeVMManager()
protected IdvPreferenceManager doMakePreferenceManager()
McIdasPreferenceManager
.doMakePreferenceManager
in class IdvBase
IdvBase.doMakePreferenceManager()
protected 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 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 IntegratedDataViewer getIdv()
getIdv
in interface DataContext
getIdv
in interface ControlContext
getIdv
in class IdvBase
IdvBase.getIdv()
protected ArgsManager doMakeArgsManager(String[] args)
doMakeArgsManager
in class IdvBase
args
- The arguments from the command line.IdvBase.doMakeArgsManager(java.lang.String[])
protected DataManager doMakeDataManager()
McvDataManager
.doMakeDataManager
in class IdvBase
IdvBase.doMakeDataManager()
protected StateManager doMakeStateManager()
StateManager
.doMakeStateManager
in class IdvBase
IdvBase.doMakeStateManager()
protected IdvResourceManager doMakeResourceManager()
ResourceManager
.doMakeResourceManager
in class IdvBase
IdvBase.doMakeResourceManager()
protected ColorTableManager doMakeColorTableManager()
McIdasColorTableManager
.doMakeColorTableManager
in class IdvBase
IdvBase.doMakeColorTableManager()
protected PluginManager doMakePluginManager()
McvPluginManager
.doMakePluginManager
in class IdvBase
IdvBase.doMakePluginManager()
public JComponent makeHelpButton(String helpId, String toolTip)
makeHelpButton
in class IntegratedDataViewer
helpId
- the topic idtoolTip
- the tooltippublic String getUserDirectory()
public String getUserFile(String filename)
filename
- File within the userpath.public void runPluginMainMethod(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(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.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.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.RuntimeException
- if there is no property associated with
os.name
.public static 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.RuntimeException
- if there is no property associated with
java.home
.private static void createSessionFile(String path)
path
- Path of the session file that should get created.
null
values are not allowed, and sufficient priviledges are
assumed.AssertionError
- if McIDAS-V couldn't write to path
.SESSION_FILE
,
hadCleanExit(String)
,
removeSessionFile(String)
private static Date extractDate(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(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).AssertionError
- if the file at path
could not be
removed.SESSION_FILE
,
createSessionFile(String)
,
hadCleanExit(String)
private static boolean hadCleanExit(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 String getSessionFilePath()
String
pointing to the session file.SESSION_FILE
private static void applyArgs(String[] args)
SESSION_FILE
.args
- Likely the argument array coming from the main method.public 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 IntegratedDataViewer
includeTemplates
- If true then include the display templatesprivate static void handleWelcomeWindow(String... args)
args
- Commandline arguments, used to handle autoquit stress testing.public static void main(String... args) throws Exception
args
- Command line arguments.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 IntegratedDataViewer
exitCode
- System exit code to use.IntegratedDataViewer.quit()
public boolean autoQuit()
IntegratedDataViewer.quit()
,
but allows for some GUI testing.public void watchDirectory(String path, String glob, OnFileChangeListener listener) throws 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.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)