Class PersistenceManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants,PrototypeManager
- Bundles prior to alpha 9 use the
TabbedUIManager. Each tab is, internally, an IDV window. This is reflected in the contents of bundles, so the IDV wants to create a new window for each tab upon loading. Alpha 10 allows the user to force bundles to only create one window. This work is done ininjectComponentGroups(List). - The IDV allows users to save bundles that contain both
ViewManagerswith component groups and without! This is actually only a problem when limiting the windows;injectComponentGroupshas to wrap ViewManagers without component groups in dynamic skins. These ViewManagers must be removed from the bundle's internal list of ViewManagers, as they don't exist until the dynamic skin is built. Do not simply clear the list! The ViewManagers within component groups must appear in it, otherwise the IDV does not add them to theVMManager. If limiting windows is off, everything will be caught properly by the unpersisting facilities inUIManager.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ucar.unidata.idv.IdvPersistenceManager
IdvPersistenceManager.DataSourceComponent -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Stringprivate static final Stringprivate static final Stringprivate static final StringDynamic skin template for buildWindow.private booleanWhether or not a bundle is actively loading.private static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate static final Stringstatic final StringKey used to access a bundle's McIDAS-V in-depth versioning info section.private ViewManagerStores the last active ViewManager from before a bundle load.private JRadioButtonUse radio buttons to control state savingprivate JRadioButtonprivate JRadioButton(package private) static LogUtil.LogCategoryprivate static final org.slf4j.Loggerstatic final StringMacro used as a place holder for wherever the IDV decides to place extracted contents of a bundle.private booleanWhether or not the user wants to attempt merging bundled layers into current displays.private static final Stringprivate static final Stringprivate static final Stringprivate static final Stringprivate XmlResourceCollectionCache the parameter sets XMLprivate static Documentprivate static Elementprivate booleanIs the bundle being saved a layout bundle?private static final StringXML template for generating dynamic skins.private static final Stringprivate static final StringFields inherited from class ucar.unidata.idv.IdvPersistenceManager
bundleIdvVersion, BUNDLES_ALL, BUNDLES_DATA, BUNDLES_DISPLAY, BUNDLES_FAVORITES, BUNDLES_SYSTEM, CAT_GENERAL, CAT_TOOLBAR, CATEGORY_SEPARATOR, CATEGORY_SEPARATOR_XML, makeDataEditable, makeDataEditableCbx, makeDataRelative, makeDataRelativeCbx, PROP_BUNDLEPATH, PROP_ENSLIST, PROP_TIMESLIST, PROP_ZIDVPATH, publishCbx, saveDataCbx, saveDataSources, saveDataSourcesCbx, saveDisplays, saveDisplaysCbx, saveJythonBox, saveViewState, saveViewStateCbxFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, windowFields inherited from interface ucar.unidata.idv.IdvConstants
ARG_B64BUNDLE, ARG_B64ISL, ARG_BUNDLE, ARG_CATALOG, ARG_CHOOSER, ARG_CLEARDEFAULT, ARG_CODE, ARG_CONNECT, ARG_CURRENTTIME, ARG_DATA, ARG_DEBUG, ARG_DEFAULT, ARG_DISPLAY, ARG_DXML, ARG_FIXEDTIME, ARG_HELP, ARG_IMAGE, ARG_IMAGESERVER, ARG_INSTALLPLUGIN, ARG_ISLFILE, ARG_ISLINTERACTIVE, ARG_LISTRESOURCES, ARG_MAINCLASS, ARG_MOVIE, ARG_MSG_DEBUG, ARG_MSG_RECORD, ARG_NODEFAULT, ARG_NOERRORSINGUI, ARG_NOGUI, ARG_NOONEINSTANCE, ARG_NOPLUGINS, ARG_NOPREF, ARG_ONEINSTANCEPORT, ARG_PLUGIN, ARG_PORT, ARG_PRINTJNLP, ARG_PROPERTIES, ARG_SCRIPT, ARG_SERVER, ARG_SETFILES, ARG_SITEPATH, ARG_TEMPLATE, ARG_TEST, ARG_TESTEVAL, ARG_TRACE, ARG_TRACEONLY, ARG_USERPATH, DEFAULT_DATE_FORMAT, DEFAULT_DOCPATH, DEFAULT_TIMEZONE, FILTER_CPT, FILTER_ISL, FILTER_JNLP, FILTER_XIDV, FILTER_XIDVZIDV, FILTER_XML, FILTER_ZIDV, ID_COMMANDSTORUN, ID_DATASOURCES, ID_DISPLAYCONTROLS, ID_IDV, ID_JYTHON, ID_MESSAGE, ID_MISCHASHTABLE, ID_NCIDV_VERSION, ID_VERSION, ID_VIEWMANAGERS, ID_WINDOWS, INITIAL_PROBE_EARTHLOCATION, NULL_DATA_SELECTION, NULL_STRING, PREF_APPEARANCEMODE, PREF_ARCHIVEDIR, PREF_ARCHIVENAME, PREF_AUTODISPLAYS_ENABLE, PREF_AUTODISPLAYS_SHOWGUI, PREF_AUTOSELECTDATA, PREF_CACHESIZE, PREF_CONTROLSINTABS, PREF_DATAPREFIX, PREF_DATE_FORMAT, PREF_DISTANCEUNIT, PREF_DOCACHE, PREF_EMBEDDATACHOOSERINDASHBOARD, PREF_EMBEDFIELDSELECTORINDASHBOARD, PREF_EMBEDLEGENDINDASHBOARD, PREF_EMBEDQUICKLINKSINDASHBOARD, PREF_EVENT_KEYBOARDMAP, PREF_EVENT_MOUSEMAP, PREF_EVENT_WHEELMAP, PREF_FAST_RENDER, PREF_FIELD_CACHETHRESHOLD, PREF_FILEREADDIR, PREF_FILEWRITEDIR, PREF_GEOMETRY_BY_REF, PREF_HISTORY, PREF_IMAGE_BY_REF, PREF_LARGE_REMOTE_DATA_WARN, PREF_LASTVERSION, PREF_LATLON_FORMAT, PREF_LEGEND_SHOWICONS, PREF_LOCALE, PREF_LOOKANDFEEL, PREF_MAXIMAGESIZE, PREF_MEMORY, PREF_NPOT_IMAGE, PREF_OPEN_ASK, PREF_OPEN_MERGE, PREF_OPEN_REMOVE, PREF_PROJ_LIST, PREF_SAMPLINGMODE, PREF_SHOWCONTROLWINDOW, PREF_SHOWDASHBOARD, PREF_SHOWDECODEDIALOG, PREF_SHOWHIDDENFILES, PREF_SHOWQUITCONFIRM, PREF_SITEPATH, PREF_THREADS_DATA, PREF_THREADS_RENDER, PREF_TIMEZONE, PREF_VERTICALCS, PREF_VERTICALUNIT, PREF_WINDOW_SHOWTOOLBAR, PREF_ZIDV_ASK, PREF_ZIDV_DIRECTORY, PREF_ZIDV_SAVETOTMP, PROP_3DMODE, PROP_ABOUTTEXT, PROP_APPRESOURCEPATH, PROP_CHOOSERS, PROP_CHOOSERS_ALL, PROP_CONTROLDESCRIPTORS, PROP_CONTROLDESCRIPTORS_ALL, PROP_DATAHOLDERBOUNDS, PROP_DEFAULTLOCATIONS, PROP_DISPLAYLIST_GROUP, PROP_FIXFILELOCKUP, PROP_JNLPCODEBASE, PROP_JNLPTEMPLATE, PROP_JNLPTITLE, PROP_LOADINGXML, PROP_MAP_GLOBE_LEVEL, PROP_MAP_MAP_LEVEL, PROP_MINIMUMFRAMECYCLETIME, PROP_MONITORPORT, PROP_OLDCONTROLDESCRIPTORS, PROP_ONEINSTANCEPORT, PROP_PREFERENCES, PROP_PROJ_NAME, PROP_RESOURCEFILES, PROP_SHOWCLOCK_DASH, PROP_SHOWCLOCK_VIEW, PROP_SHOWDASHBOARD, PROP_SHOWDATATREE, PROP_SHOWFORMULAS, PROP_SHOWSPLASH, PROP_SPLASHICON, PROP_UI_DESKTOP, PROP_USE_DISPLAYAREA, PROP_USE_TIMEDRIVER, PROP_VERSIONFILE, PROP_WINDOW_SCREENSIZEOFFSET, PROP_WINDOW_SIZEHEIGHT, PROP_WINDOW_SIZEWIDTH, PROP_WINDOW_USESCREENSIZE, SUFFIX_BAT, SUFFIX_CPT, SUFFIX_ISL, SUFFIX_JNLP, SUFFIX_RBI, SUFFIX_SH, SUFFIX_XIDV, SUFFIX_XML, SUFFIX_ZIDV -
Constructor Summary
ConstructorsConstructorDescriptionJava requires this constructor.Create a new persistence manager. -
Method Summary
Modifier and TypeMethodDescriptionbooleanaddParameterSetCategory(String parameterType, String category) Add the directory.protected booleanaddToBundle(Hashtable data, List dataSources, List displayControls, List viewManagers, String jython) Overridden so that McIDAS-V can: add better versioning information to bundles removeReadoutProbesfrom thedisplayControlsthat are getting persisted. disallow saving multi-banded ADDE data sources until we have fix!protected List<WindowInfo> betterInject(List<WindowInfo> windows) Builds an altered copy ofwindowsthat preserves the number of windows while ensuring all displays are inside component holders.static IdvWindowbuildDynamicSkin(int width, int height, int rows, int cols, boolean showWidgets, List<org.python.core.PyObject> panelTypes) protected List<IdvComponentHolder> buildHolders(WindowInfo window) Builds a list of component holders with all ofwindow's displays.private voidcheckForBadMaps(String bundlePath) voiddecodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean removeAll, boolean letUserChangeData) Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.voiddecodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean removeAll, boolean letUserChangeData, boolean limitWindows) Hijacks the second part of the IDV bundle loading pipeline so that McIDAS-V can limit the number of new windows.booleandecodeXmlFile(String xmlFile, String label, boolean checkToRemove, boolean letUserChangeData, Hashtable bundleProperties) Hijacks control of the IDV's bundle loading facilities.protected voiddecodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean changeData) Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.protected voiddecodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData, boolean limitNewWindows) Hijacks the third part of the bundle loading pipeline.voiddeleteParameterSet(String parameterType, ParameterSet set) Delete the given parameter setvoiddeleteParameterSetCategory(String parameterType, String category) Delete the directory and all of its contents that the given category represents.voidOverridden because McIDAS-V has a different definition of "default bundle" than the IDV.voiddoSaveAs()Have the user select an xidv filename and write the current application state to it.voidprotected static List<ViewManager> extractCompGroupVMs(List<WindowInfo> windows) Builds a list of an incoming bundle'sViewManagers that are part of a component group.private booleanAttempts to reconcile McIDAS-V's ability to easily load all files in a directory with the way the IDV expects file data sources to behave upon unpersistence.protected IdvComponentGroupflattenGroup(IdvComponentGroup nested) Altersnestedso that there are no nested component groups.protected voidflattenWindows(List<WindowInfo> windows) Alterswindowsso that no windows in the bundle contain nested component groups.private List<ViewManager> generateViewManagers(List<DisplayControlImpl> controls) getAllParameterSetCategories(String parameterType) Get a list of all of the categories for the given parameterTypegetAllParameterSets(String parameterType) Get the list ofParameterSets that are writableCreate, if needed, and return te GUI panel to put into the file dialog when saving a file.Returns the last activeViewManagerfrom before loading the most recent bundle.Create, if needed, and return the list of locally savedSavedBundlesbooleanprivate ElementgetParameterTypeNode(String parameterType) Get the node representing the parameterTypebooleanShould the data sources be savedbooleanShould the displays be savedbooleanShould the jython be savedbooleanShould the view state be savedprotected List<WindowInfo> injectComponentGroups(List<WindowInfo> windows) Builds a single window with a single component group.protected voidinstantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.protected voidinstantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData, boolean limitNewWindows) Overridden so that McIDAS-V can preempt the IDV's bundle loading.private booleanAttempts to determine whether or not a givenDataSourceImplis the result of a McIDAS-V "bulk load".booleanReturns whether or not a bundle is currently being loaded.protected voidloadBundlesInDirectory(List<SavedBundle> allBundles, List categories, File file) For each of of the bundle files in the given file directory create a SavedBundle object with the given categories list ad add it into the given allBundles list.makeDynSkin(WindowInfo info) Uses theViewManagersininfoto build a dynamic skin.mapDynamicSkins(List<WindowInfo> windows) Builds a list of any dynamic skins in the bundle and adds them to the UIMananger's "cache" of encountered ViewManagers.voidmoveParameterSet(String parameterType, ParameterSet set, List categories) Move the bundle to the given category area.voidmoveParameterSetCategory(String parameterType, List fromCategories, List toCategories) Move the bundle category.protected static voidpopulateEssentialLists(String[] ids, Hashtable<String, Object> table) Ensures that the lists corresponding to the ids inidsactually exist intable, even if they are empty.protected static List<WindowInfo> removeUIHolders(List<WindowInfo> windows) Returns an altered copy ofwindowscontaining only component holders that have displays.protected static List<IdvComponentHolder> removeUIHolders(IdvComponentGroup group) Remove component holders that are "UI-only".voidrenameParameterSet(String parameterType, ParameterSet set) Rename the parameter set.protected voidreverseCollisions(List<ViewManager> vms) Does the work in fixing the collisions described in theinstantiateFromBundlejavadoc.voidsaveDisplayControlFavorite(DisplayControl displayControl, String templateName) Prompt the user for a name and write out the given display control as a bundle into the user'sMcIDAS-V/displaytemplatesdirectory.booleansaveParameterSet(String parameterType, Hashtable parameterValues) Show the Save Parameter Set dialog.private voidsetMergeBundledLayers(boolean newValue) private List<WindowInfo> wrapViewManagers(List<ViewManager> vms) voidWrite the parameter setsMethods inherited from class ucar.unidata.idv.IdvPersistenceManager
addBundleCategories, addBundleCategory, addFileMapping, addToBundle, applyPropertiesToBundle, categoriesToString, changeData, changeState, changeState, cleanupOldSavedBundles, clearDataSourcesState, clearDataSourcesState, clearFileMapping, clearPrototype, copyBundle, decodeBase64Bundle, decodeJnlpFile, decodeXml, decodeXmlFile, decodeXmlFile, decodeXmlFile, decodeXmlFile, decodeXmlFile, decodeXmlInner, deleteBundle, deleteBundleCategory, doImport, doSave, doSave, doSave, doSaveAsDefault, doSaveAsFavorite, encodeSpecial, export, extractBundleFromJnlp, fileToCategories, flushState, getAllCategories, getBundleDirectory, getBundleIdvVersion, getBundles, getBundleTitle, getBundleXml, getBundleXml, getBundleXml, getCategories, getCategorizedFile, getControlDescriptors, getCurrentFileName, getCurrentTemplateName, getDataSourceBundles, getDataSourcesToPersist, getDefaultBundles, getDisplayTemplates, getFavorites, getFavoritesCategories, getJnlpBundle, getJnlpBundle, getPrototype, getPrototypeFile, getSaveData, getWritableBundles, getXmlBundles, initBundleMenu, instantiateFromTemplate, loadB64Bundle, makeCategoryBox, makeDataSourceFromXml, moveBundle, moveCategory, moveOrCopyBundle, open, open, rename, renameBundleCategory, saveDataSource, saveDisplayControl, saveDisplayControl, setCurrentFileName, setFileMapping, showDataEditableGui, showDataEmbedGui, showDataRelativeGui, stringToCategories, updateDataPaths, writePrototypeMethods inherited from class ucar.unidata.idv.IdvManager
getArgsManager, getCollabManager, getColorTableManager, getDataManager, getIdv, getIdvChooserManager, getIdvClass, getIdvProjectionManager, getIdvUIManager, getImageGenerator, getInstallManager, getJythonManager, getPersistenceManager, getPreferenceManager, getProperty, getProperty, getProperty, getPublishManager, getResourceManager, getStateManager, getStationModelManager, getStore, getVMManager, logException, showNormalCursor, showWaitCursor, waitUntilDisplaysAreDone, waitUntilDisplaysAreDoneMethods inherited from class ucar.unidata.ui.WindowHolder
actionPerformed, close, doMakeContents, getContents, getDialog, getFrame, getWindow, getWindowTitle, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, show, showModal, toFront, windowIsClosing
-
Field Details
-
ID_MCV_VERSION
Key used to access a bundle's McIDAS-V in-depth versioning info section.- See Also:
-
logger
-
MACRO_ZIDVPATH
Macro used as a place holder for wherever the IDV decides to place extracted contents of a bundle.- See Also:
-
log_
-
savingDefaultLayout
Is the bundle being saved a layout bundle? -
lastBeforeBundle
Stores the last active ViewManager from before a bundle load. -
mergeBundledLayers
Whether or not the user wants to attempt merging bundled layers into current displays. -
bundleLoading
Whether or not a bundle is actively loading. -
parameterSets
Cache the parameter sets XML -
parameterSetsDocument
-
parameterSetsRoot
-
TAG_FOLDER
- See Also:
-
TAG_DEFAULT
- See Also:
-
ATTR_NAME
- See Also:
-
layoutOnlyRadio
Use radio buttons to control state saving -
layoutSourcesRadio
-
layoutSourcesDataRadio
-
OLD_COMP_STUFF
- See Also:
-
NEW_COMP_STUFF
- See Also:
-
OLD_SOURCE_MACRO
- See Also:
-
NEW_SOURCE_MACRO
- See Also:
-
DYNSKIN_TMPNAME
- See Also:
-
DYNSKIN_TAG_PANEL
- See Also:
-
DYNSKIN_TAG_VIEW
- See Also:
-
DYNSKIN_ATTR_ID
- See Also:
-
DYNSKIN_ATTR_COLS
- See Also:
-
DYNSKIN_ATTR_ROWS
- See Also:
-
DYNSKIN_ATTR_PROPS
- See Also:
-
DYNSKIN_ATTR_CLASS
- See Also:
-
DYNSKIN_ATTR_VIEWID
- See Also:
-
DYNSKIN_PROPS_GLOBE
- See Also:
-
DYNSKIN_PROPS_GENERAL
- See Also:
-
DYNSKIN_ID_VALUE
- See Also:
-
SIMPLE_SKIN_TEMPLATE
XML template for generating dynamic skins.- See Also:
-
BUILDWINDOW_COMP_GROUP_HIDE_WIDGETS
- See Also:
-
BUILDWINDOW_PROPS_GENERAL
- See Also:
-
BUILDWINDOW_SKIN_TEMPLATE
Dynamic skin template for buildWindow.- See Also:
-
-
Constructor Details
-
PersistenceManager
public PersistenceManager()Java requires this constructor. -
PersistenceManager
Create a new persistence manager.- Parameters:
idv- Reference back to the application session. Cannot benull.- See Also:
-
-
Method Details
-
getLastViewManager
Returns the last activeViewManagerfrom before loading the most recent bundle.- Returns:
- Either the ViewManager or
nullif there was no previous ViewManager (such as loading a default bundle/layout).
-
isBundleLoading
Returns whether or not a bundle is currently being loaded.- Returns:
- Either
trueifinstantiateFromBundleis doing what it needs to do, orfalse. - See Also:
-
getMergeBundledLayers
-
setMergeBundledLayers
-
getSaveDataSources
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerShould the data sources be saved- Overrides:
getSaveDataSourcesin classIdvPersistenceManager- Returns:
- Save the data sources
-
getSaveDisplays
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerShould the displays be saved- Overrides:
getSaveDisplaysin classIdvPersistenceManager- Returns:
- Save the displays
-
getSaveViewState
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerShould the view state be saved- Overrides:
getSaveViewStatein classIdvPersistenceManager- Returns:
- Save the view state
-
getSaveJython
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerShould the jython be saved- Overrides:
getSaveJythonin classIdvPersistenceManager- Returns:
- Save the data sources
-
doSaveAsDefaultLayout
-
getFileAccessory
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerCreate, if needed, and return te GUI panel to put into the file dialog when saving a file.- Overrides:
getFileAccessoryin classIdvPersistenceManager- Returns:
- The file accessory panel
-
doSaveAs
Have the user select an xidv filename and write the current application state to it. This also sets the current file name and adds the file to the history list.- Overrides:
doSaveAsin classIdvPersistenceManager
-
doOpenDefault
Overridden because McIDAS-V has a different definition of "default bundle" than the IDV.The McV default bundle is the "startup bundle" from the advanced preferences.
- Overrides:
doOpenDefaultin classIdvPersistenceManager
-
saveDisplayControlFavorite
Prompt the user for a name and write out the given display control as a bundle into the user'sMcIDAS-V/displaytemplatesdirectory.- Overrides:
saveDisplayControlFavoritein classIdvPersistenceManager- Parameters:
displayControl- Display control to write.templateName- Possiblynullinitial name for the template.
-
addToBundle
protected boolean addToBundle(Hashtable data, List dataSources, List displayControls, List viewManagers, String jython) Overridden so that McIDAS-V can:- add better versioning information to bundles
- remove
ReadoutProbesfrom thedisplayControlsthat are getting persisted. - disallow saving multi-banded ADDE data sources until we have fix!
- Overrides:
addToBundlein classIdvPersistenceManager- Parameters:
data- Holds the bundle statedataSources- List of data sources to adddisplayControls- List of displays to addviewManagers- List of view managers to addjython- jython to add- Returns:
- If user is ok
-
getLocalBundles
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerCreate, if needed, and return the list of locally savedSavedBundles- Overrides:
getLocalBundlesin classIdvPersistenceManager- Returns:
- List of saved bundles
-
loadBundlesInDirectory
Description copied from class:ucar.unidata.idv.IdvPersistenceManagerFor each of of the bundle files in the given file directory create a SavedBundle object with the given categories list ad add it into the given allBundles list.- Overrides:
loadBundlesInDirectoryin classIdvPersistenceManager- Parameters:
allBundles- The list to put the bundles incategories- Categories for the SavedBundle objectsfile- Where to look
-
decodeXml
public void decodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean removeAll, boolean letUserChangeData) Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.
- Overrides:
decodeXmlin classIdvPersistenceManager- Parameters:
xml- The bundle xmlfromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.xmlFile- The filename this came from. May be null.label- The label to use in the dialogshowDialog- Should the dialog be shownshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesremoveAll- Should we remove all data/displaysletUserChangeData- Should popup the data path dialog- See Also:
-
decodeXmlFile
public boolean decodeXmlFile(String xmlFile, String label, boolean checkToRemove, boolean letUserChangeData, Hashtable bundleProperties) Hijacks control of the IDV's bundle loading facilities. Due to the way versions of McIDAS-V prior to alpha 10 handled tabs, the user will end up with a new window for each tab in the bundle. McIDAS-V alpha 10 has the ability to only create one new window and have everything else go into that window's tabs.
- Overrides:
decodeXmlFilein classIdvPersistenceManager- Parameters:
xmlFile- filelabel- labelcheckToRemove- check to removeletUserChangeData- if true then ask user to change data pathsbundleProperties- set of properties- Returns:
- everything cool
- See Also:
-
decodeXmlInner
protected void decodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean changeData) Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.
- Overrides:
decodeXmlInnerin classIdvPersistenceManager- Parameters:
xml- The xml bundlefromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.xmlFile- The filename where the xml came from - may be null.label- The label to show in the guishowDialog- Should the loadbundle dialog be shownshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesdidRemoveAll- Was remove all called before we decoded the xmlchangeData- Should popup data path change dialog- See Also:
-
instantiateFromBundle
protected void instantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData) throws Exception Overridden so that McIDAS-V can redirect to the version of this method that supports limiting the number of new windows.
- Overrides:
instantiateFromBundlein classIdvPersistenceManager- Parameters:
ht- Contains the unpersisted objectsfromCollab- Was this bundle from the collaboration facility. If it was we treat it differently.loadDialog- The load bundle dialogshouldMerge- Should we merge the windows/views in the bundle into the existing windowsbundleProperties- set of propertiesdidRemoveAll- Was remove all called before we decoded the xmlletUserChangeData- Should popup data path change dialog- Throws:
Exception- See Also:
-
decodeXml
public void decodeXml(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean removeAll, boolean letUserChangeData, boolean limitWindows) Hijacks the second part of the IDV bundle loading pipeline so that McIDAS-V can limit the number of new windows.- Parameters:
xml- XML withinxmlFile.fromCollab- Whether or not this bundle load was started by collaborator.xmlFile- Bundled XML file.label- Label to use in dialog title.showDialog- Whether or not dialogs should be shown.shouldMerge- Whether or not displays should be merged into existing displays.bundleProperties- Mapping of bundle properties.removeAll- Whether or not existing displays should be removed.letUserChangeData- Whether or not users can alter data sources.limitWindows- Whether or not multiple windows should be created.- See Also:
-
decodeXmlInner
protected void decodeXmlInner(String xml, boolean fromCollab, String xmlFile, String label, boolean showDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData, boolean limitNewWindows) Hijacks the third part of the bundle loading pipeline.
- Parameters:
xml- XML withinxmlFile.fromCollab- Whether or not this bundle load was started by collaborator.xmlFile- Bundled XML file.label- Label to use in dialog title.showDialog- Whether or not dialogs should be shown.shouldMerge- Whether or not displays should be merged into existing displays.bundleProperties- Mapping of bundle properties.didRemoveAll- Were existing displays removed?letUserChangeData- Whether or not users can alter data sources.limitNewWindows- Whether or not multiple windows should be created.- See Also:
-
checkForBadMaps
-
extractCompGroupVMs
Builds a list of an incoming bundle's
ViewManagers that are part of a component group.The reason for only being interested in component groups is because any windows not using component groups will be made into a dynamic skin. The associated ViewManagers do not technically exist until the skin has been "built", so there's nothing to do. These ViewManagers must also be removed from the bundle's list of ViewManagers.
However, any ViewManagers associated with component groups still need to appear in the bundle's ViewManager list, and that's where this method comes into play!
- Parameters:
windows- WindowInfos to be searched.- Returns:
- List of ViewManagers inside any component groups.
-
reverseCollisions
Does the work in fixing the collisions described in the
instantiateFromBundlejavadoc. Basically just queries theVMManagerfor eachViewManager. If a match is found, a new ID is generated and associated with the ViewManager, itsViewDescriptor, and any associatedDisplayControls.- Parameters:
vms- ViewManagers in the incoming bundle.- See Also:
-
injectComponentGroups
Builds a single window with a single component group. The group contains component holders that correspond to each window or component holder stored in the incoming bundle.- Parameters:
windows- The bundle's list ofWindowInfos.- Returns:
- List of WindowInfos that contains only one element/window.
- Throws:
Exception- Bubble up any exceptions frommakeImpromptuSkin.
-
betterInject
Builds an altered copy ofwindowsthat preserves the number of windows while ensuring all displays are inside component holders.- Parameters:
windows- List of bundled windows. Cannot benull.- Returns:
windowswith all displays inside component groups.- Throws:
Exception- Bubble up dynamic skin exceptions.- See Also:
-
buildHolders
Builds a list of component holders with all ofwindow's displays.- Parameters:
window- Window containing displays.- Returns:
Listof component holders forwindow.- Throws:
Exception- Bubble up any problems creating a dynamic skin.
-
mapDynamicSkins
Builds a list of any dynamic skins in the bundle and adds them to the UIMananger's "cache" of encountered ViewManagers.
- Parameters:
windows- The bundle's windows.- Returns:
- Any dynamic skins in
windows.
-
fixBulkDataSources
Attempts to reconcile McIDAS-V's ability to easily load all files in a directory with the way the IDV expects file data sources to behave upon unpersistence.The problem is twofold: the paths referenced in the data source's
Sourcesmay not exist, and the persistence code combines each individual file into a blob.The current solution is to note that the data source's
PollingInfois used byFilesDataSource.initWithPollingInfo()to replace the contents of the data source's file paths. Simply overwritePollingInfo#filePathswith the path to the blob.- Parameters:
ds-ListofDataSourceImplsto inspect and/or fix. Cannot benull.- Returns:
- true if able to load data ok
- See Also:
-
isBulkDataSource
Attempts to determine whether or not a givenDataSourceImplis the result of a McIDAS-V "bulk load".- Parameters:
d-DataSourceImplto check. Cannot benull.- Returns:
trueif theDataSourceImplmatched the criteria.
-
instantiateFromBundle
protected void instantiateFromBundle(Hashtable ht, boolean fromCollab, LoadBundleDialog loadDialog, boolean shouldMerge, Hashtable bundleProperties, boolean didRemoveAll, boolean letUserChangeData, boolean limitNewWindows) throws Exception Overridden so that McIDAS-V can preempt the IDV's bundle loading. There will be problems if any of the incomingViewManagersshare an ID with an existing ViewManager. While this case may seem unlikely, it can be triggered when loading a bundle and then reloading. The problem is that the ViewManagers are the same, and if the previous ViewManagers were not removed, the IDV doesn't know what to do.Assigning the incoming ViewManagers a new ID, and associating its
ViewDescriptorsandDisplayControlswith the new ID fixes this problem.McIDAS-V also allows the user to limit the number of new windows the bundle may create. If enabled, one new window will be created, and any additional windows will become tabs (component holders) inside the new window.
McIDAS-V also prefers the bundles being loaded to be in a semi-regular regular state. For example, say you have bundle containing only data. The bundle will probably not contain lists of WindowInfos or ViewManagers. Perhaps the bundle contains nested component groups as well! McIDAS-V will alter the unpersisted bundle state (not the actual bundle file) to make it fit into the expected idiom. Mostly this just entails wrapping things in component groups and holders while "flattening" any nested component groups.
- Parameters:
ht- Holds unpersisted objects.fromCollab- Did the bundle come from the collab stuff?loadDialog- Show the bundle loading dialog?shouldMerge- Merge bundle contents into an existing window?bundleProperties- If non-null, use the set of time indices for data sources?didRemoveAll- Remove all data and displays?letUserChangeData- Allow changes to the data path?limitNewWindows- Only create one new window?- Throws:
Exception- if there was a problem re-instantiating the bundle.- See Also:
-
wrapViewManagers
-
generateViewManagers
-
flattenWindows
Alterswindowsso that no windows in the bundle contain nested component groups.- Parameters:
windows-Listof windows to "flatten".
-
flattenGroup
Altersnestedso that there are no nested component groups.- Parameters:
nested- Component group to "flatten".- Returns:
- An altered version of
nestedthat contains no nested component groups.
-
removeUIHolders
Remove component holders that are "UI-only"."UI-only" refers to things like having the dashboard embedded in a component holder.
- Parameters:
group- Component group from which "UI-only" holders will be removed.- Returns:
- An altered
groupcontaining only component holders with displays.
-
populateEssentialLists
Ensures that the lists corresponding to the ids inidsactually exist intable, even if they are empty.- Parameters:
ids- IDs that should have a correspondingList.table- Table that should be a mapping ofidstoLists.
-
removeUIHolders
Returns an altered copy ofwindowscontaining only component holders that have displays.The IDV allows users to embed HTML controls or things like the dashboard into component holders. This ability, while powerful, could make for a confusing UI.
- Parameters:
windows- Windows from which "UI-only" holders should be removed.- Returns:
Listof windows that contain displays.
-
makeDynSkin
Uses theViewManagersininfoto build a dynamic skin.- Parameters:
info- Window that needs to become a dynamic skin.- Returns:
McvComponentHoldercontaining the ViewManagers insideinfo.- Throws:
Exception- Bubble up any XML problems.
-
buildDynamicSkin
public static IdvWindow buildDynamicSkin(int width, int height, int rows, int cols, boolean showWidgets, List<org.python.core.PyObject> panelTypes) throws Exception - Throws:
Exception
-
writeParameterSets
Write the parameter sets -
getParameterTypeNode
Get the node representing the parameterType- Parameters:
parameterType- What type of parameter set- Returns:
- Element representing parameterType node
-
getAllParameterSetCategories
Get a list of all of the categories for the given parameterType- Parameters:
parameterType- What type of parameter set- Returns:
- List of (String) categories
-
getAllParameterSets
Get the list ofParameterSets that are writable- Parameters:
parameterType- The type of parameter set- Returns:
- List of writable parameter sets
-
addParameterSetCategory
Add the directory.- Parameters:
parameterType- Type of parameter set.category- Category (really a ">" delimited string).- Returns:
trueif the create was successful.falseif there already is a category with that name
-
deleteParameterSet
Delete the given parameter set- Parameters:
parameterType- The type of parameter setset- Parameter set to delete.
-
deleteParameterSetCategory
Delete the directory and all of its contents that the given category represents.- Parameters:
parameterType- Type of parameter set.category- Category (really a ">" delimited string).
-
renameParameterSet
Rename the parameter set.- Parameters:
parameterType- Type of parameter set.set- Parameter set.
-
moveParameterSet
Move the bundle to the given category area.- Parameters:
parameterType- Type of parameter set.set- Parameter set.categories- Where to move to.
-
moveParameterSetCategory
Move the bundle category.- Parameters:
parameterType- Type of parameter set.fromCategories- Category to move.toCategories- Where to move to.
-
saveParameterSet
Show the Save Parameter Set dialog.- Parameters:
parameterType- Type of parameter set.parameterValues- Values to save.- Returns:
- Whether or not the parameter set was saved.
-