public class StateManager extends ucar.unidata.idv.StateManager implements Constants, javax.swing.event.HyperlinkListener
The initialization process includes creating an "object store" (for preferences), user-modifiable settings, and so on.
McIDAS-V uses this class to perform pretty much all version-check operations.
Modifier and Type | Field and Description |
---|---|
private static org.slf4j.Logger |
logger
Logging object.
|
private java.lang.String |
netcdfDate
Lazily-loaded
ncIdv.jar build timestamp. |
private java.lang.String |
netcdfVersion
Lazily-loaded
ncIdv.jar version. |
static java.lang.String |
USERPATH_IS_BAD_MESSAGE
Error message shown when given userpath cannot be used.
|
static java.lang.String |
USERPATH_PICK
Message shown when asking the user to select a userpath.
|
private java.lang.String |
version
Lazily-loaded
mcidasv.jar version. |
private java.lang.String |
visadDate
Lazily-loaded VisAD build date.
|
private java.lang.String |
visadVersion
Lazily-loaded VisAD revision number.
|
PREF_SunAwtDisableMixing, showControlsInTree, userName
BLANK_COMP_GROUP, COMP_MONITORPANEL, DATASELECTOR_NAME, DEFAULT_DOCPATH, DEFAULT_SERVERSTATE, DISPLAY_NAME, DISPLAYCONTROLLER_NAME, ELEMENT_DOUBLE_WIDTH, ELEMENT_DOUBLEDOUBLE_WIDTH, ELEMENT_HALF_WIDTH, ELEMENT_ONEHALF_WIDTH, ELEMENT_WIDTH, EVENT_FILECHOOSER_START, EVENT_FILECHOOSER_STOP, FILTER_MCV, FILTER_MCVMCVZ, FILTER_MCVZ, GAP_RELATED, GAP_UNRELATED, HOMEPAGE_URL, ICON_ACCEPT_SMALL, ICON_ADD_SMALL, ICON_APPLY_SMALL, ICON_BACKGROUND_SMALL, ICON_CANCEL, ICON_CANCEL_SMALL, ICON_CHECKVERSION_SMALL, ICON_COLORTABLE_SMALL, ICON_CONNECT_SMALL, ICON_CONSOLE_SMALL, ICON_DATAEXPLORER_SMALL, ICON_DEFAULTLAYOUT_SMALL, ICON_DEFAULTLAYOUTADD_SMALL, ICON_DEFAULTLAYOUTDELETE_SMALL, ICON_DELETE_SMALL, ICON_DISCONNECT_SMALL, ICON_ERROR_SMALL, ICON_EXCLAMATION_SMALL, ICON_FAVORITE_SMALL, ICON_FAVORITEMANAGE_SMALL, ICON_FAVORITESAVE_SMALL, ICON_FORUMS_SMALL, ICON_GETTINGSTARTED_SMALL, ICON_HELP, ICON_HELP_SMALL, ICON_HELPTIPS_SMALL, ICON_INFORMATION_SMALL, ICON_LAYOUTEDIT_SMALL, ICON_LOCALDATA_SMALL, ICON_LOCATION_SMALL, ICON_MCIDASV_DEFAULT, ICON_MCIDASV_SMALL, ICON_NEWTAB_SMALL, ICON_NEWWINDOW_SMALL, ICON_NEXT_SMALL, ICON_NOTE_SMALL, ICON_OPEN, ICON_OPEN_SMALL, ICON_PREFERENCES_SMALL, ICON_PREVIOUS_SMALL, ICON_RANDOM_SMALL, ICON_RANGEANDBEARING_SMALL, ICON_REDO_SMALL, ICON_REFRESH, ICON_REFRESH_SMALL, ICON_REMOVE_SMALL, ICON_REMOVEDATA_SMALL, ICON_REMOVELAYERS_SMALL, ICON_REMOVELAYERSDATA_SMALL, ICON_SAVE, ICON_SAVE_SMALL, ICON_SAVEAS_SMALL, ICON_SUPPORT_SMALL, ICON_UNDO_SMALL, ICON_UPDATE, ICON_USERSGUIDE_SMALL, LOCAL_ADDE_PORT, MACRO_BUILDDATE, MACRO_COPYRIGHT_YEAR, MACRO_GRANULE_COUNT, MACRO_IDV_VERSION, MACRO_VERSION, MACRO_VISAD_VERSION, MAX_MEMORY_32BIT, MCV_BLUE, MCV_BLUE_DARK, NOTICE_URL, OS_OSX, PANEL_NAME, PREF_AUTO_SAVE_DEFAULT_LAYOUT, PREF_CONFIRM_REMOVE_BOTH, PREF_CONFIRM_REMOVE_DATA, PREF_CONFIRM_REMOVE_LAYERS, PREF_IMAGE_PREVIEW, PREF_LIST_ADDE_SERVERS, PREF_LIST_ADVANCED, PREF_LIST_AVAILABLE_DISPLAYS, PREF_LIST_DATA_CHOOSERS, PREF_LIST_FORMATS_DATA, PREF_LIST_GENERAL, PREF_LIST_LOCAL_ADDE, PREF_LIST_NAV_CONTROLS, PREF_LIST_TOOLBAR, PREF_LIST_VIEW, PREF_OPEN_LIMIT_WIN, PREF_PRERELEASE_CHECK, PREF_SAVE_DASHBOARD_VIZ, PREF_SERVERSTATE, PREF_SHOW_SYSTEM_BUNDLES, PREF_SYSTEMSERVERSIMG, PREF_TBM_SIZE, PREF_VERSION_CHECK, PREF_VIIRS_PLUGIN, PRERELEASE_URL, PROP_ABOUTTEXT, PROP_APP_ICON, PROP_BUILD_DATE, PROP_CHAN, PROP_COPYRIGHT_YEAR, PROP_DASHBOARD_BOUNDS, PROP_GRANULE_COUNT, PROP_HOMEPAGE, PROP_HYDRA_360, PROP_RECENT_COLORS, PROP_SERVERS, PROP_SERVERS_ALL, PROP_SYSMEM, PROP_TABBED_UI, PROP_VERSION_MAJOR, PROP_VERSION_MINOR, PROP_VERSION_RELEASE, PROP_VERSIONFILE, PROP_VISAD_DATE, PROP_VISAD_ORIGINAL, PROP_VISAD_PARSE_FAIL, PROP_VISAD_REVISION, PROP_VP_CATOPEN, PROP_VP_SHOWCATS, PROP_VP_SHOWPOPUP, PROPERTIES_FILE, SCRUB_STRINGS_FILE, SUFFIX_MCV, SUFFIX_MCVZ, TOOLTIP_PROGRESSIVE_RESOLUTION, USER_DIRECTORY_NAME, VERSION_HANDLER_URL, VERSION_URL, VIIRS_PLUGIN_VERSION_NUMBER
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_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_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_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 |
---|
StateManager(ucar.unidata.idv.IntegratedDataViewer idv) |
Modifier and Type | Method and Description |
---|---|
void |
checkForNewerVersion(boolean notifyDialog) |
void |
checkForNewerVersionPrerelease(boolean notifyDialog) |
void |
checkForNewerVersionStable(boolean notifyDialog) |
void |
checkForNotice(boolean notifyDialog) |
void |
click(java.lang.String url)
Handle a click on a link.
|
static int |
compareVersions(java.lang.String thisVersion,
java.lang.String thatVersion)
Compare version strings.
|
void |
debugNotice(java.lang.String noticeContents,
boolean notifyDialog,
boolean disableCache)
Debug a McIDAS-V "system notice" before sending it to all
users!
|
protected ucar.unidata.idv.IdvObjectStore |
doMakeObjectStore()
Override to set the right user directory.
|
java.lang.String |
getIdvVersion() |
boolean |
getIsPrerelease() |
java.lang.String |
getJythonVersion()
Returns the current Jython version.
|
java.lang.String |
getMcIdasVersion() |
java.lang.String |
getMcIdasVersionAbout() |
java.lang.String |
getMcIdasVersionPrerelease()
Connect to McIDAS-V website and look for latest pre-release version.
|
java.lang.String |
getMcIdasVersionStable()
Connect to McIDAS-V website and look for latest stable version.
|
java.lang.String |
getNetcdfDate()
Return the timestamp from when
ncIdv.jar was created. |
java.lang.String |
getNetcdfVersion()
Return the version information within
ncIdv.jar . |
private java.lang.String |
getNoticeCached() |
java.lang.String |
getNoticeLatest()
Connect to McIDAS website and look for latest notice.
|
private java.lang.String |
getNoticePath() |
java.lang.String |
getOSName()
Get the name of the current operating system (via
"os.name" system property).
|
java.lang.Object |
getProperty(java.lang.String name)
Get a property.
|
java.lang.Object |
getPropertyOrPreference(java.lang.String name)
Find the value associated with the given ID by checking the
"properties", and if nothing was found, check the preferences.
|
boolean |
getPropertyOrPreference(java.lang.String name,
boolean dflt)
Find the
Boolean value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences. |
double |
getPropertyOrPreference(java.lang.String name,
double dflt)
Find the
Double value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences. |
int |
getPropertyOrPreference(java.lang.String name,
int dflt)
Find the
Integer value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences. |
java.lang.String |
getPropertyOrPreference(java.lang.String name,
java.lang.String dflt)
Find the
String value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences. |
java.lang.String |
getStoreName()
Overridden to get dir of the unnecessary second level directory.
|
java.lang.String |
getStoreSystemName()
Overridden to set default of McIDAS-V
|
java.util.Hashtable<java.lang.String,java.lang.String> |
getVersionInfo()
Returns information about the current version of McIDAS-V and the IDV,
along with their respective build dates.
|
java.lang.String |
getVisadDate()
Return the timestamp from when visad.jar was created.
|
java.lang.String |
getVisadVersion()
Return the "version" of VisAD.
|
void |
hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
Handle a change to a link.
|
protected void |
initObjectStore(ucar.unidata.idv.IdvObjectStore store)
Initialize the given object store.
|
protected void |
initUserDirectory(java.io.File directory)
Initialize the McIDAS-V user directory (if it is not already
initalized).
|
private void |
setNoticeCached(java.lang.String notice) |
static int |
versionToInteger(java.lang.String version)
Turn version strings of the form {@code #.
|
applyMacros, applyPreferences, fixIds, getBuildDate, getColorProperty, getDefaultHelpTarget, getDefaultHelpUrl, getHelpRoot, getNumberVersion, getPreference, getPreference, getPreferenceOrProperty, getPreferenceOrProperty, getPreferenceOrProperty, getPreferenceOrProperty, getPreferencePaths, getProperties, getProperty, getProperty, getProperty, getProperty, getRunningIsl, getShouldLoadBundlesSynchronously, getShowControlsInTree, getShowDashboardOnStart, getStore, getTitle, getUserName, getVersion, getVersionAbout, getVersionMajor, getVersionMinor, getVersionRevision, getViewSize, initNewUserDirectory, initState, isLoadingXml, loadProperties, processPropertyTable, putPreference, putProperty, putProperty, setAlwaysLoadBundlesSynchronously, setRunningIsl, setViewSize, writePreference, writePreferences
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDone
private static final org.slf4j.Logger logger
public static final java.lang.String USERPATH_IS_BAD_MESSAGE
public static final java.lang.String USERPATH_PICK
private java.lang.String visadDate
null
.getVisadDate()
private java.lang.String visadVersion
null
.getVisadVersion()
private java.lang.String netcdfDate
ncIdv.jar
build timestamp. Value may be
null
.getNetcdfDate()
private java.lang.String netcdfVersion
ncIdv.jar
version. Value may be null
.getNetcdfVersion()
private java.lang.String version
mcidasv.jar
version. Value may be null
.getMcIdasVersion()
public StateManager(ucar.unidata.idv.IntegratedDataViewer idv)
protected ucar.unidata.idv.IdvObjectStore doMakeObjectStore()
doMakeObjectStore
in class ucar.unidata.idv.StateManager
protected void initObjectStore(ucar.unidata.idv.IdvObjectStore store)
initObjectStore
in class ucar.unidata.idv.StateManager
store
- Object store to initialize. Cannot be null
.protected void initUserDirectory(java.io.File directory)
Here, initialization means "the user directory exists, and contains a barebones version of mcidasv.rbi".
initUserDirectory
in class ucar.unidata.idv.StateManager
directory
- McIDAS-V user directory. Cannot be null
.public void hyperlinkUpdate(javax.swing.event.HyperlinkEvent e)
hyperlinkUpdate
in interface javax.swing.event.HyperlinkListener
e
- Link event. Cannot be null
.public void click(java.lang.String url)
url
- Link to visit.public java.lang.String getOSName()
Note: all space characters will be replaced with underscores.
public java.lang.String getMcIdasVersionAbout()
public java.lang.String getMcIdasVersion()
public java.lang.String getJythonVersion()
getJythonVersion
in class ucar.unidata.idv.StateManager
public java.lang.Object getProperty(java.lang.String name)
getProperty
in class ucar.unidata.idv.StateManager
name
- Name of the property. Cannot be null
.name
or null
.public java.lang.Object getPropertyOrPreference(java.lang.String name)
name
- Property or preference ID. Cannot be null
.name
or null
.public java.lang.String getPropertyOrPreference(java.lang.String name, java.lang.String dflt)
String
value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences.name
- Property or preference ID. Cannot be null
.dflt
- Value to return if there is no property or preference
associated with name
name
or dflt
.public int getPropertyOrPreference(java.lang.String name, int dflt)
Integer
value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences.name
- Property or preference ID. Cannot be null
.dflt
- Value to return if there is no property or preference
associated with name
name
or dflt
.public double getPropertyOrPreference(java.lang.String name, double dflt)
Double
value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences.name
- Property or preference ID. Cannot be null
.dflt
- Value to return if there is no property or preference
associated with name
name
or dflt
.public boolean getPropertyOrPreference(java.lang.String name, boolean dflt)
Boolean
value associated with the given ID by checking
the "properties", and if nothing was found, check the
preferences.name
- Property or preference ID. Cannot be null
.dflt
- Value to return if there is no property or preference
associated with name
name
or dflt
.public java.util.Hashtable<java.lang.String,java.lang.String> getVersionInfo()
Hashtable
containing versioning information.public java.lang.String getNetcdfDate()
ncIdv.jar
was created.String
representation of the creation timestamp.public java.lang.String getNetcdfVersion()
ncIdv.jar
.ncIdv.jar
shipped by McIDAS-V.public java.lang.String getVisadDate()
String
representation of the creation timestamp.
Likely to change formatting over time.public java.lang.String getVisadVersion()
public java.lang.String getIdvVersion()
public java.lang.String getStoreSystemName()
getStoreSystemName
in class ucar.unidata.idv.StateManager
public java.lang.String getStoreName()
getStoreName
in class ucar.unidata.idv.StateManager
public java.lang.String getMcIdasVersionStable()
public java.lang.String getMcIdasVersionPrerelease()
public java.lang.String getNoticeLatest()
public static int compareVersions(java.lang.String thisVersion, java.lang.String thatVersion)
The logic is as follows.
0: thisVersion and thatVersion are equal. <0: thisVersion is greater. >0: thatVersion is greater.
thisVersion
- First version string to compare.thatVersion
- Second version string to compare.thisVersion
and
thatVersion
is "greater".public static int versionToInteger(java.lang.String version)
#.#(a#)
, where # is one or two
digits, a is one of alpha or beta, and () is optional, into an integer
value... (empty) > beta > alpha.version
- String representation of version number.version
.public boolean getIsPrerelease()
public void checkForNewerVersion(boolean notifyDialog)
public void checkForNewerVersionStable(boolean notifyDialog)
public void checkForNewerVersionPrerelease(boolean notifyDialog)
public void checkForNotice(boolean notifyDialog)
public void debugNotice(java.lang.String noticeContents, boolean notifyDialog, boolean disableCache)
noticeContents
- Contents of the notice.notifyDialog
- if true
, show notice even if already seen.disableCache
- Whether or not noticeContents
will be cached.private java.lang.String getNoticePath()
private java.lang.String getNoticeCached()
private void setNoticeCached(java.lang.String notice)