Class McIdasPreferenceManager
- All Implemented Interfaces:
Constants
,ActionListener
,EventListener
,ListSelectionListener
,IdvConstants
An extension of IdvPreferenceManager
that uses
a JList instead of tabs to lay out the various PreferenceManagers.
- Author:
- McIDAS-V Dev Team
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate JPanel
Holds the buttons at the bottomEach PreferenceManager has associated data contained in this table.Date formatsProvide some default values for the lat-lon preference drop down.private static final String
Maps the name of a panel to an icon.private JList
The list that'll contain all the names of the different PreferenceManagersprivate static final String
Help McV remember the last preference panel the user selected.private static DecimalFormat
Decimal formatprivate static double
test value for formattingprivate static final String
private DefaultListModel
The "M" in the MVC for JLists.private JScrollPane
Handle scrolling like a pro.static final String[]
Options for bundle loadingprivate static final org.slf4j.Logger
Logger object.static final float
static final float
private JPanel
Holds the main preference paneprivate final Map
<String, PreferenceManager> A table of the different preference managers that'll wind up in the list.private static final String
Path to the McV choosers.xmlstatic final String[][]
Controls how the preference panel list is displayed.Maps the "name" of a panel to the actual thing holding the PreferenceManager.static final String
static final String
static final Object[][]
Desired rendering hints with their desired values.Replacing the "incoming" IDV preference tab names with whatever's in this map.private static final String
private static final String
private McvToolbarEditor
The toolbar editorFields inherited from class ucar.unidata.idv.IdvPreferenceManager
cbxToCdMap, choosersToShow, controlDescriptorsToShow, DATE_FORMATS, haveInitedChoosersToShow, haveInitedControlDescriptorsToShow, showAllChoosers, showAllControls
Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
Fields inherited from interface edu.wisc.ssec.mcidasv.Constants
BLANK_COMP_GROUP, COMP_MONITORPANEL, DATASELECTOR_NAME, DEFAULT_COLOR_PICKER_SIZE, DEFAULT_DOCPATH, DEFAULT_MAP_Z_LEVEL, 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, lineStyles, 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_MODIFY_DEFAULT_COLOR_TABLE, PREF_NUM_IMAGE_PRESET_IMGCHOOSER, PREF_NUM_IMAGE_PRESET_RADARCHOOSER, 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, 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
Fields 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
ConstructorsConstructorDescriptionPrep as much as possible for displaying the preference window: load up icons and create some of the window features. -
Method Summary
Modifier and TypeMethodDescriptionvoid
actionPerformed
(ActionEvent event) Overridden so McIDAS-V can direct users to specific help sections for each preference panel.void
Add a PreferenceManager to the list of things that should be shown in the preference dialog.void
protected void
Add in the user preference tab for the choosers to show.protected void
Add in the user preference tab for the controls to showprotected void
protected void
Creates and adds the formats and data preference panel.protected void
Creates and adds the basic preference panel.void
Create the navigation preference panelvoid
Build aAddePreferences
panel "around" the server managerEntryStore
.void
Create the toolbar preference panelboolean
apply()
Apply the preferences (taken straight from IDV).private void
private String
getChooserCategory
(String chooserName) Parse the full chooser name for a category.Return a list that contains a bunch of arrays of two strings.private String
getChooserShortName
(String chooserName) Parse the full chooser name for a short name.boolean[]
This determines whether the IDV should do a remove display and data before a bundle is loaded.static RenderingHints
private String
Returns the container the corresponds to the currently selected label in the JList.void
init()
Perform the GUI initialization for the preference dialog.void
Creates an ephemeral Preferences window just to apply preferences; hacky workaround for McIDAS Inquiry #983-3141protected void
Initialize the preference dialog.static JPanel
makePrefPanel
(Object[][] objects, Hashtable widgets, XmlObjectStore store) Make a checkbox preference panelvoid
void
replaceServerPrefPanel
(JPanel panel) private static void
savePrefsFromWidgets
(Hashtable widgets, XmlObjectStore store) void
selectListItem
(String labelName) Select a list item and its corresponding panel that both live within the preference window JList.private boolean
setEmptyPref
(String id, String val) void
Wrapper so that IDV code can still select which preference pane to show.void
Handle the user clicking around.Methods inherited from class ucar.unidata.idv.IdvPreferenceManager
addBasicPreferences, addSystemPreferences, applyEventPreferences, applyEventsToGui, applyWidgets, exportControlsToPlugin, getDefaultDateFormat, getDefaultDistanceUnit, getDefaultTimeZone, getKeyboardMap, getMouseMap, getWheelMap, getWindowTitle, makeEventPanel, shouldShowChooser, shouldShowChooser, shouldShowControl, shouldShowControl, show, windowIsClosing
Methods 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, waitUntilDisplaysAreDone
Methods inherited from class ucar.unidata.ui.WindowHolder
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, showModal, toFront
-
Field Details
-
logger
Logger object. -
LOGO_SCALE_MIN
- See Also:
-
LOGO_SCALE_MAX
- See Also:
-
PROP_HIQ_FONT_RENDERING
- See Also:
-
PROP_IS_OFFSCREEN
- See Also:
-
PREF_PANELS
Controls how the preference panel list is displayed. Want to modify the preferences UI in some way? PREF_PANELS is your friend. Think of it like a really brain-dead SQLite.
Each row is a panel, and must consist of three columns.
- Name of the panel.
- Path to the icon associated with the panel.
- The panel's "help ID."
The
JList
in the preferences window will order the panels based uponPREF_PANELS
. -
RENDER_HINTS
Desired rendering hints with their desired values. -
loadComboOptions
Options for bundle loading -
LAST_PREF_PANEL
Help McV remember the last preference panel the user selected.- See Also:
-
LEGEND_TEMPLATE_DATA
- See Also:
-
DISPLAY_LIST_TEMPLATE_DATA
- See Also:
-
TEMPLATE_IMAGEDISPLAY
- See Also:
-
TEMPLATE_NO_DATA
- See Also:
-
latlonValue
test value for formatting -
latlonFormat
Decimal format -
defaultLatLonFormats
Provide some default values for the lat-lon preference drop down. -
probeFormatsList
-
replaceMap
Replacing the "incoming" IDV preference tab names with whatever's in this map. -
MCV_CHOOSERS
Path to the McV choosers.xml- See Also:
-
prefMap
Maps the "name" of a panel to the actual thing holding the PreferenceManager. -
iconCache
Maps the name of a panel to an icon. -
managerMap
A table of the different preference managers that'll wind up in the list. -
dataMap
Each PreferenceManager has associated data contained in this table. TODO: bug Unidata about getting IdvPreferenceManager's dataList protected -
labelSet
-
labelList
The list that'll contain all the names of the different PreferenceManagers -
listModel
The "M" in the MVC for JLists. Contains all the list data. -
listScrollPane
Handle scrolling like a pro. -
mainPane
Holds the main preference pane -
buttonPane
Holds the buttons at the bottom -
dateFormats
Date formats -
toolbarEditor
The toolbar editor
-
-
Constructor Details
-
McIdasPreferenceManager
Prep as much as possible for displaying the preference window: load up icons and create some of the window features.- Parameters:
idv
- Reference to the supreme IDV object.
-
-
Method Details
-
getRenderingHints
- Returns:
- The rendering hints to use, as determined by RENDER_HINTS.
-
setEmptyPref
-
actionPerformed
Overridden so McIDAS-V can direct users to specific help sections for each preference panel.- Specified by:
actionPerformed
in interfaceActionListener
- Overrides:
actionPerformed
in classIdvPreferenceManager
-
replaceServerPrefPanel
-
replaceServerPreferences
-
add
public void add(String tabLabel, String description, PreferenceManager listener, Container panel, Object data) Add a PreferenceManager to the list of things that should be shown in the preference dialog.- Overrides:
add
in classIdvPreferenceManager
- Parameters:
tabLabel
- The label (or name) of the PreferenceManager.description
- Not used.listener
- The actual PreferenceManager.panel
- The container holding all of the PreferenceManager stuff.data
- Data passed to the preference manager.
-
apply
Apply the preferences (taken straight from IDV).- Overrides:
apply
in classIdvPreferenceManager
- Returns:
- Whether or not each of the preference managers applied properly.
-
fixDisplayListFont
-
selectListItem
Select a list item and its corresponding panel that both live within the preference window JList.- Parameters:
labelName
- The "name" of the JLabel within the JList.
-
initAtStartup
Creates an ephemeral Preferences window just to apply preferences; hacky workaround for McIDAS Inquiry #983-3141 -
showTab
Wrapper so that IDV code can still select which preference pane to show.- Overrides:
showTab
in classIdvPreferenceManager
- Parameters:
tabNameToShow
- The name of the pane to be shown. Regular expressions are supported.
-
valueChanged
Handle the user clicking around.- Specified by:
valueChanged
in interfaceListSelectionListener
- Parameters:
e
- The event to be handled! Use your imagination!
-
getSelectedName
Returns the container the corresponds to the currently selected label in the JList. Also stores the selected panel so that the next time a user tries to open the preferences they will start off in the panel they last selected.- Returns:
- The current container.
-
init
Perform the GUI initialization for the preference dialog. -
initPreferences
Initialize the preference dialog. Leave most of the heavy lifting to the IDV, except for creating the server manager.- Overrides:
initPreferences
in classIdvPreferenceManager
-
addServerPreferences
Build aAddePreferences
panel "around" the server managerEntryStore
.- See Also:
-
addToolbarPreferences
Create the toolbar preference panel -
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 to look up the preference value- Returns:
- The created panel
-
addAdvancedPreferences
-
addDisplayPreferences
Add in the user preference tab for the controls to show- Overrides:
addDisplayPreferences
in classIdvPreferenceManager
-
addDisplayWindowPreferences
-
savePrefsFromWidgets
-
addMcVPreferences
Creates and adds the basic preference 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.
Overridden by McIDAS-V so that we can ask the user whether or not we should limit the number of new windows a bundle can create.
- Overrides:
getDoRemoveBeforeOpening
in classIdvPreferenceManager
- Parameters:
name
- Bundle name - may be null.- Returns:
- Element 0: did user hit cancel; Element 1: Should remove data and displays; Element 2: limit new windows.
- See Also:
-
addFormatDataPreferences
Creates and adds the formats and data preference panel. -
addChooserPreferences
Add in the user preference tab for the choosers to show.- Overrides:
addChooserPreferences
in classIdvPreferenceManager
-
getChooserData
Return a list that contains a bunch of arrays of two strings.
The first item in one of the arrays is the chooser id, and the second item is the "name" of the chooser. The name is formed by working through choosers.xml and concatenating each panel's category and title.
- Returns:
- A list of chooser ids and names.
-
getChooserCategory
Parse the full chooser name for a category.- Parameters:
chooserName
- Name of a chooser. Cannot benull
.- Returns:
- "Category" associated with
chooserName
or "Other" if no category is available.
-
getChooserShortName
Parse the full chooser name for a short name.- Parameters:
chooserName
- Name of a chooser. Cannot benull
.- Returns:
- The "short name" of
chooserName
.
-