public class McIdasPreferenceManager extends ucar.unidata.idv.IdvPreferenceManager implements javax.swing.event.ListSelectionListener, Constants
An extension of IdvPreferenceManager
that uses
a JList instead of tabs to lay out the various PreferenceManagers.
Modifier and Type | Class and Description |
---|---|
class |
McIdasPreferenceManager.IconCellRenderer |
Modifier and Type | Field and Description |
---|---|
private javax.swing.JPanel |
buttonPane
Holds the buttons at the bottom
|
private java.util.Map<java.lang.String,java.lang.Object> |
dataMap
Each PreferenceManager has associated data contained in this table.
|
private java.util.Set<java.lang.String> |
dateFormats
Date formats
|
private static java.util.Set<java.lang.String> |
defaultLatLonFormats
Provide some default values for the lat-lon preference drop down.
|
private static java.lang.String |
DISPLAY_LIST_TEMPLATE_DATA |
private java.util.Map<java.lang.String,javax.swing.ImageIcon> |
iconCache
Maps the name of a panel to an icon.
|
private javax.swing.JList |
labelList
The list that'll contain all the names of the different
PreferenceManagers
|
private java.util.Set<java.lang.String> |
labelSet |
private static java.lang.String |
LAST_PREF_PANEL
Help McV remember the last preference panel the user selected.
|
private static java.text.DecimalFormat |
latlonFormat
Decimal format
|
private static double |
latlonValue
test value for formatting
|
private static java.lang.String |
LEGEND_TEMPLATE_DATA |
private javax.swing.DefaultListModel |
listModel
The "M" in the MVC for JLists.
|
private javax.swing.JScrollPane |
listScrollPane
Handle scrolling like a pro.
|
static java.lang.String[] |
loadComboOptions
Options for bundle loading
|
private static org.slf4j.Logger |
logger
Logger object.
|
private javax.swing.JPanel |
mainPane
Holds the main preference pane
|
private java.util.Map<java.lang.String,ucar.unidata.xml.PreferenceManager> |
managerMap
A table of the different preference managers that'll wind up in the
list.
|
private static java.lang.String |
MCV_CHOOSERS
Path to the McV choosers.xml
|
static java.lang.String[][] |
PREF_PANELS
Controls how the preference panel list is displayed.
|
private java.util.Map<java.lang.String,java.awt.Container> |
prefMap
Maps the "name" of a panel to the actual thing holding the
PreferenceManager.
|
private static java.util.Set<java.lang.String> |
probeFormatsList |
static java.lang.Object[][] |
RENDER_HINTS
Desired rendering hints with their desired values.
|
private static java.util.Map<java.lang.String,java.lang.String> |
replaceMap
Replacing the "incoming" IDV preference tab names with whatever's in
this map.
|
private static java.lang.String |
TEMPLATE_IMAGEDISPLAY |
private static java.lang.String |
TEMPLATE_NO_DATA |
private McvToolbarEditor |
toolbarEditor
The toolbar editor
|
cbxToCdMap, choosersToShow, controlDescriptorsToShow, DATE_FORMATS, haveInitedChoosersToShow, haveInitedControlDescriptorsToShow, showAllChoosers, showAllControls
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 |
---|
McIdasPreferenceManager(ucar.unidata.idv.IntegratedDataViewer idv)
Prep as much as possible for displaying the preference window: load up
icons and create some of the window features.
|
Modifier and Type | Method and Description |
---|---|
void |
actionPerformed(java.awt.event.ActionEvent event)
Overridden so McIDAS-V can direct users to specific help sections for
each preference panel.
|
void |
add(java.lang.String tabLabel,
java.lang.String description,
ucar.unidata.xml.PreferenceManager listener,
java.awt.Container panel,
java.lang.Object data)
Add a PreferenceManager to the list of things that should be shown in
the preference dialog.
|
void |
addAdvancedPreferences() |
protected void |
addChooserPreferences()
Add in the user preference tab for the choosers to show.
|
protected void |
addDisplayPreferences()
Add in the user preference tab for the controls to show
|
protected void |
addDisplayWindowPreferences() |
protected void |
addFormatDataPreferences()
Creates and adds the formats and data preference panel.
|
protected void |
addMcVPreferences()
Creates and adds the basic preference panel.
|
void |
addNavigationPreferences()
Create the navigation preference panel
|
void |
addServerPreferences()
Build a
AddePreferences panel "around" the
server manager EntryStore . |
void |
addToolbarPreferences()
Create the toolbar preference panel
|
boolean |
apply()
Apply the preferences (taken straight from IDV).
|
private void |
fixDisplayListFont() |
private java.lang.String |
getChooserCategory(java.lang.String chooserName)
Parse the full chooser name for a category.
|
private java.util.List<java.lang.String[]> |
getChooserData()
Return a list that contains a bunch of arrays of two strings.
|
private java.lang.String |
getChooserShortName(java.lang.String chooserName)
Parse the full chooser name for a short name.
|
boolean[] |
getDoRemoveBeforeOpening(java.lang.String name)
This determines whether the IDV should do a remove display and data
before a bundle is loaded.
|
static java.awt.RenderingHints |
getRenderingHints() |
private java.lang.String |
getSelectedName()
Returns the container the corresponds to the currently selected label in
the JList.
|
void |
init()
Perform the GUI initialization for the preference dialog.
|
protected void |
initPreferences()
Initialize the preference dialog.
|
static javax.swing.JPanel |
makePrefPanel(java.lang.Object[][] objects,
java.util.Hashtable widgets,
ucar.unidata.xml.XmlObjectStore store)
Make a checkbox preference panel
|
void |
replaceServerPreferences(EntryStore.Event evt) |
void |
replaceServerPrefPanel(javax.swing.JPanel panel) |
private static void |
savePrefsFromWidgets(java.util.Hashtable widgets,
ucar.unidata.xml.XmlObjectStore store) |
void |
selectListItem(java.lang.String labelName)
Select a list item and its corresponding panel that both live within the
preference window JList.
|
private boolean |
setEmptyPref(java.lang.String id,
java.lang.String val) |
void |
showTab(java.lang.String tabNameToShow)
Wrapper so that IDV code can still select which preference pane to show.
|
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
Handle the user clicking around.
|
addBasicPreferences, addSystemPreferences, applyEventPreferences, applyEventsToGui, applyWidgets, exportControlsToPlugin, getDefaultDateFormat, getDefaultDistanceUnit, getDefaultTimeZone, getKeyboardMap, getMouseMap, getWheelMap, getWindowTitle, makeEventPanel, shouldShowChooser, shouldShowChooser, shouldShowControl, shouldShowControl, show, windowIsClosing
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
private static final org.slf4j.Logger logger
public static final java.lang.String[][] 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.
The JList
in the preferences window will order the panels
basedupon PREF_PANELS
.
public static final java.lang.Object[][] RENDER_HINTS
public static final java.lang.String[] loadComboOptions
private static final java.lang.String LAST_PREF_PANEL
private static final java.lang.String LEGEND_TEMPLATE_DATA
private static final java.lang.String DISPLAY_LIST_TEMPLATE_DATA
private static final java.lang.String TEMPLATE_IMAGEDISPLAY
private static final java.lang.String TEMPLATE_NO_DATA
private static double latlonValue
private static java.text.DecimalFormat latlonFormat
private static final java.util.Set<java.lang.String> defaultLatLonFormats
private static final java.util.Set<java.lang.String> probeFormatsList
private static final java.util.Map<java.lang.String,java.lang.String> replaceMap
private static final java.lang.String MCV_CHOOSERS
private final java.util.Map<java.lang.String,java.awt.Container> prefMap
private final java.util.Map<java.lang.String,javax.swing.ImageIcon> iconCache
private final java.util.Map<java.lang.String,ucar.unidata.xml.PreferenceManager> managerMap
private final java.util.Map<java.lang.String,java.lang.Object> dataMap
private final java.util.Set<java.lang.String> labelSet
private javax.swing.JList labelList
private javax.swing.DefaultListModel listModel
private javax.swing.JScrollPane listScrollPane
private javax.swing.JPanel mainPane
private javax.swing.JPanel buttonPane
private final java.util.Set<java.lang.String> dateFormats
private McvToolbarEditor toolbarEditor
public McIdasPreferenceManager(ucar.unidata.idv.IntegratedDataViewer idv)
idv
- Reference to the supreme IDV object.public static java.awt.RenderingHints getRenderingHints()
private boolean setEmptyPref(java.lang.String id, java.lang.String val)
public void actionPerformed(java.awt.event.ActionEvent event)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class ucar.unidata.idv.IdvPreferenceManager
public void replaceServerPrefPanel(javax.swing.JPanel panel)
public void replaceServerPreferences(EntryStore.Event evt)
public void add(java.lang.String tabLabel, java.lang.String description, ucar.unidata.xml.PreferenceManager listener, java.awt.Container panel, java.lang.Object data)
add
in class ucar.unidata.idv.IdvPreferenceManager
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.public boolean apply()
apply
in class ucar.unidata.idv.IdvPreferenceManager
private void fixDisplayListFont()
public void selectListItem(java.lang.String labelName)
labelName
- The "name" of the JLabel within the JList.public void showTab(java.lang.String tabNameToShow)
showTab
in class ucar.unidata.idv.IdvPreferenceManager
tabNameToShow
- The name of the pane to be shown. Regular
expressions are supported.public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged
in interface javax.swing.event.ListSelectionListener
e
- The event to be handled! Use your imagination!private java.lang.String getSelectedName()
public void init()
protected void initPreferences()
initPreferences
in class ucar.unidata.idv.IdvPreferenceManager
public void addServerPreferences()
AddePreferences
panel "around" the
server manager EntryStore
.McIDASV.getServerManager()
public void addNavigationPreferences()
public void addToolbarPreferences()
public static javax.swing.JPanel makePrefPanel(java.lang.Object[][] objects, java.util.Hashtable widgets, ucar.unidata.xml.XmlObjectStore store)
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 valuepublic void addAdvancedPreferences()
protected void addDisplayPreferences()
addDisplayPreferences
in class ucar.unidata.idv.IdvPreferenceManager
protected void addDisplayWindowPreferences()
private static void savePrefsFromWidgets(java.util.Hashtable widgets, ucar.unidata.xml.XmlObjectStore store)
protected void addMcVPreferences()
public boolean[] getDoRemoveBeforeOpening(java.lang.String name)
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.
getDoRemoveBeforeOpening
in class ucar.unidata.idv.IdvPreferenceManager
name
- Bundle name - may be null.IdvPreferenceManager.getDoRemoveBeforeOpening(String)
protected void addFormatDataPreferences()
protected void addChooserPreferences()
addChooserPreferences
in class ucar.unidata.idv.IdvPreferenceManager
private final java.util.List<java.lang.String[]> 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.
private java.lang.String getChooserCategory(java.lang.String chooserName)
chooserName
- Name of a chooser. Cannot be null
.chooserName
or
"Other" if no category is available.private java.lang.String getChooserShortName(java.lang.String chooserName)
chooserName
- Name of a chooser. Cannot be null
.chooserName
.