Package ucar.unidata.idv
Class IdvPreferenceManager
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.IdvPreferenceManager
- All Implemented Interfaces:
ActionListener,EventListener,IdvConstants
This class is responsible for the preference dialog and
managing general preference state.
A set of
PreferenceManager-s are added
into the dialog. This class then constructs a tabbed pane
window, one pane for each PreferenceManager.
On the user's Ok or Apply the dialog will
have each PreferenceManager apply its preferences.- Author:
- IDV development team
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Hashtablemapping between checkbox and control descriptorprotected HashtableA mapping that holds the choosers that should be shownprotected HashtableA mapping that holds the control descriptors that should be shownDate formatsprotected booleanHave we initialized the what choosers should be shown facilityprotected booleanHave we initialized the what control descriptors should be shown facilityprotected booleanShould all choosers be shownprotected booleanShould we show all of the display control descriptorsFields 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
ConstructorsConstructorDescriptionCreate the dialog with the given idv -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent event) Handle the CANCEL, HELP, OK and APPLY eventsvoidAdd in the given PreferenceManager with its associated GUI Container and data Object.protected voidAdds the basic preference tabprotected voidAdd in the user preference tab for the choosers to show.protected voidAdd in the user preference tab for the controls to showprotected voidAdd in the user preference tab for the controls to showbooleanapply()Apply the preferencesprotected voidapplyEventPreferences(XmlObjectStore theStore) Apply the mouse/scroll/keyboard preferencesvoidapplyEventsToGui(List functions) Apply event mappingsprotected static voidapplyWidgets(Hashtable widgets, XmlObjectStore store) A utility that goes through the set of widgets (String preference name to UI widget), finds their value and adds it into the given store.voidExport the selected control descriptors to the plugin managerGet the default date formatGet the unit to be used to show distanceGet the default time zoneboolean[]This determines whether the IDV should do a remove display and data before a bundle is loaded.int[][]Keyboard mappingsint[][][]Get the mouse mapping preference.int[][]Get teh scroll wheel mappingsGet the window titleprotected voidInit the preference guiprotected JComponentMake the mouse/scroll/key mapping panelstatic JPanelmakePrefPanel(Object[][] objects, Hashtable widgets, XmlObjectStore store) Make a checkbox preference panelbooleanshouldShowChooser(String chooserName) Check if the given chooser should be shown in the chooser gui.protected booleanshouldShowChooser(String chooserName, boolean ignoreAllFlag) Should the named chooser be shownbooleanShould the given control descriptor be shownbooleanshouldShowControl(ControlDescriptor cd, boolean ignoreAllFlag) Should the given control descriptor be shown.voidshow()Show the dialogvoidShow the tab whose title matches the given tabNameToShow.protected voidClose the dialogMethods 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
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, showModal, toFront
-
Field Details
-
DATE_FORMATS
Date formats -
choosersToShow
A mapping that holds the choosers that should be shown -
controlDescriptorsToShow
A mapping that holds the control descriptors that should be shown -
haveInitedControlDescriptorsToShow
protected boolean haveInitedControlDescriptorsToShowHave we initialized the what control descriptors should be shown facility -
showAllControls
protected boolean showAllControlsShould we show all of the display control descriptors -
showAllChoosers
protected boolean showAllChoosersShould all choosers be shown -
haveInitedChoosersToShow
protected boolean haveInitedChoosersToShowHave we initialized the what choosers should be shown facility -
cbxToCdMap
mapping between checkbox and control descriptor
-
-
Constructor Details
-
IdvPreferenceManager
Create the dialog with the given idv- Parameters:
idv- The IDV
-
-
Method Details
-
add
public void add(String tabLabel, String description, PreferenceManager listener, Container panel, Object data) Add in the given PreferenceManager with its associated GUI Container and data Object.- Parameters:
tabLabel- The tabbed pane labeldescription- Text to make a JLabel fromlistener- The handler for this set of preferencespanel- The gui for the preferencesdata- Associated data that is passed to the PreferenceManager when done
-
showTab
Show the tab whose title matches the given tabNameToShow. This can be a regular expression.- Parameters:
tabNameToShow- Tab name to show.
-
actionPerformed
Handle the CANCEL, HELP, OK and APPLY events- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classWindowHolder- Parameters:
event- The event
-
windowIsClosing
protected void windowIsClosing()Close the dialog- Overrides:
windowIsClosingin classWindowHolder
-
getWindowTitle
Get the window title- Overrides:
getWindowTitlein classWindowHolder- Returns:
- window title
-
show
public void show()Show the dialog- Overrides:
showin classWindowHolder
-
initPreferences
protected void initPreferences()Init the preference gui -
apply
public boolean apply()Apply the preferences- Returns:
- ok
-
applyWidgets
A utility that goes through the set of widgets (String preference name to UI widget), finds their value and adds it into the given store.- Parameters:
widgets- The preference name to GUI widget mapstore- The store to put preferences in.
-
addDisplayPreferences
protected void addDisplayPreferences()Add in the user preference tab for the controls to show -
addSystemPreferences
protected void addSystemPreferences()Add in the user preference tab for the controls to show -
exportControlsToPlugin
public void exportControlsToPlugin()Export the selected control descriptors to the plugin manager -
addChooserPreferences
protected void addChooserPreferences()Add in the user preference tab for the choosers to show. -
getDefaultTimeZone
Get the default time zone- Returns:
- the default time zone
-
getDefaultDateFormat
Get the default date format- Returns:
- the default time zone
-
addBasicPreferences
protected void addBasicPreferences()Adds the basic preference tab -
makePrefPanel
Make a checkbox preference panel- Parameters:
objects- Holds (Label, preference id, Boolean default value). If preference id is null then just show the label. If the entry is only length 2 (i.e., no value) then default to true.widgets- The map to store the id to widgetstore- Where toi look up the preference value- Returns:
- The created panel
-
getDoRemoveBeforeOpening
This determines whether the IDV should do a remove display and data before a bundle is loaded. It returns a 2 element boolean array. The first element is whether the open should take place at all. The second element determines whether displays and data should be removed before the load.- Parameters:
name- The bundle name - may be null.- Returns:
- Element 0- did user hit cancel. Element 1 - Should remove data and displays. Element 2 Should merge element 3 did we ask the user
-
shouldShowControl
Should the given control descriptor be shown- Parameters:
cd- The control descriptor- Returns:
- Should the cd be shown
-
shouldShowControl
Should the given control descriptor be shown.- Parameters:
cd- The control descriptorignoreAllFlag- If true then don't pay attention to the show all flag. We have this here so this can return the actual show value for the control descriptor when we are constructing the preference gui buttons.- Returns:
- Should the cd be shown
-
shouldShowChooser
Check if the given chooser should be shown in the chooser gui. This will first try to read the user preference PROP_CHOOSERS (A hashtable). If null then it looks for the comma separated list of choosers from the property PROP_CHOOSERS.- Parameters:
chooserName- The name of the chooser.- Returns:
- Should the chooser be shown.
-
shouldShowChooser
Should the named chooser be shown- Parameters:
chooserName- The chooser nameignoreAllFlag- If true then don't pay attention to the show all flag. We have this here so this can return the actual show value for the chooser when we are constructing the preference gui buttons.- Returns:
- Should the chooser be shown
-
getDefaultDistanceUnit
Get the unit to be used to show distance- Returns:
- default distance unit
-
getMouseMap
public int[][][] getMouseMap()Get the mouse mapping preference. Always will return something- Returns:
- mouse mappings
-
getWheelMap
public int[][] getWheelMap()Get teh scroll wheel mappings- Returns:
- scroll wheel mappings
-
getKeyboardMap
public int[][] getKeyboardMap()Keyboard mappings- Returns:
- keyboard mappings
-
applyEventPreferences
Apply the mouse/scroll/keyboard preferences- Parameters:
theStore- The store
-
applyEventsToGui
Apply event mappings- Parameters:
functions- functions
-
makeEventPanel
Make the mouse/scroll/key mapping panel- Returns:
- mouse/scroll/key mapping panel
-