|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectucar.unidata.ui.WindowHolder
ucar.unidata.idv.IdvManager
ucar.unidata.idv.IdvPreferenceManager
edu.wisc.ssec.mcidasv.McIdasPreferenceManager
public class McIdasPreferenceManager
An extension of IdvPreferenceManager
that uses
a JList instead of tabs to lay out the various PreferenceManagers.
Nested Class Summary | |
---|---|
class |
McIdasPreferenceManager.IconCellRenderer
|
Field Summary | |
---|---|
private JPanel |
buttonPane
Holds the buttons at the bottom |
private Map<String,Object> |
dataMap
Each PreferenceManager has associated data contained in this table. |
private Set<String> |
dateFormats
Date formats |
private static Set<String> |
defaultLatLonFormats
Provide some default values for the lat-lon preference drop down. |
private String |
defaultPrefs
|
private static String |
DISPLAY_LIST_TEMPLATE_DATA
|
private Map<String,ImageIcon> |
iconCache
Maps the name of a panel to an icon. |
private boolean |
isUnixLike
Is this a Unix-style platform? |
private boolean |
isWindows
Is this a Windows platform? |
private JList |
labelList
The list that'll contain all the names of the different PreferenceManagers |
private Set<String> |
labelSet
|
private static String |
LAST_PREF_PANEL
Help McV remember the last preference panel the user selected. |
private static DecimalFormat |
latlonFormat
Decimal format |
private static double |
latlonValue
test value for formatting |
private static String |
LEGEND_TEMPLATE_DATA
|
private DefaultListModel |
listModel
The "M" in the MVC for JLists. |
private JScrollPane |
listScrollPane
Handle scrolling like a pro. |
static String[] |
loadComboOptions
Options for bundle loading |
private static org.slf4j.Logger |
logger
Logger object. |
private JPanel |
mainPane
Holds the main preference pane |
private Map<String,PreferenceManager> |
managerMap
A table of the different preference managers that'll wind up in the list. |
private static String |
MCV_CHOOSERS
Path to the McV choosers.xml |
static String[][] |
PREF_PANELS
Controls how the preference panel list is displayed. |
private Map<String,Container> |
prefMap
Maps the "name" of a panel to the actual thing holding the PreferenceManager. |
private static Set<String> |
probeFormatsList
|
static Object[][] |
RENDER_HINTS
Desired rendering hints with their desired values. |
private static Map<String,String> |
replaceMap
Replacing the "incoming" IDV preference tab names with whatever's in this map. |
private static String |
TEMPLATE_IMAGEDISPLAY
|
private static String |
TEMPLATE_NO_DATA
|
private McvToolbarEditor |
toolbarEditor
The toolbar editor |
private String |
userDirectory
|
private String |
userPrefs
|
Fields 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 |
Constructor Summary | |
---|---|
McIdasPreferenceManager(IntegratedDataViewer idv)
Prep as much as possible for displaying the preference window: load up icons and create some of the window features. |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent event)
Overridden so McIDAS-V can direct users to specific help sections for each preference panel. |
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. |
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 String |
getChooserCategory(String chooserName)
Parse the full chooser name for a category. |
private List<String[]> |
getChooserData()
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[] |
getDoRemoveBeforeOpening(String name)
This determines whether the IDV should do a remove display and data before a bundle is loaded. |
static RenderingHints |
getRenderingHints()
|
private String |
getSelectedName()
Returns the container the corresponds to the currently selected label in the JList. |
private Container |
getSelectedPanel()
Returns the container the corresponds to the currently selected label in the JList. |
private Container |
getSelectedPanel(String name)
|
void |
init()
Perform the GUI initialization for the preference dialog. |
protected void |
initPreferences()
Initialize the preference dialog. |
static JPanel |
makePrefPanel(Object[][] objects,
Hashtable widgets,
XmlObjectStore store)
Make a checkbox preference panel |
void |
replaceServerPreferences(EntryStore.Event evt)
|
void |
replaceServerPrefPanel(JPanel panel)
|
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 |
showTab(String tabNameToShow)
Wrapper so that IDV code can still select which preference pane to show. |
void |
valueChanged(ListSelectionEvent e)
Handle the user clicking around. |
Methods inherited from class ucar.unidata.ui.WindowHolder |
---|
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, showModal, toFront |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final org.slf4j.Logger logger
public static final 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:
JList
in the preferences window will order the panels based
upon PREF_PANELS
.
public static final Object[][] RENDER_HINTS
public static final String[] loadComboOptions
private static final String LAST_PREF_PANEL
private static final String LEGEND_TEMPLATE_DATA
private static final String DISPLAY_LIST_TEMPLATE_DATA
private static final String TEMPLATE_IMAGEDISPLAY
private static final String TEMPLATE_NO_DATA
private static double latlonValue
private static DecimalFormat latlonFormat
private static final Set<String> defaultLatLonFormats
private static final Set<String> probeFormatsList
private static final Map<String,String> replaceMap
private static final String MCV_CHOOSERS
private final Map<String,Container> prefMap
private final Map<String,ImageIcon> iconCache
private final Map<String,PreferenceManager> managerMap
private final Map<String,Object> dataMap
private final Set<String> labelSet
private JList labelList
private DefaultListModel listModel
private JScrollPane listScrollPane
private JPanel mainPane
private JPanel buttonPane
private final Set<String> dateFormats
private boolean isUnixLike
private boolean isWindows
private McvToolbarEditor toolbarEditor
private String userDirectory
private String userPrefs
private String defaultPrefs
Constructor Detail |
---|
public McIdasPreferenceManager(IntegratedDataViewer idv)
idv
- Reference to the supreme IDV object.Method Detail |
---|
public static RenderingHints getRenderingHints()
private boolean setEmptyPref(String id, String val)
public void actionPerformed(ActionEvent event)
actionPerformed
in interface ActionListener
actionPerformed
in class IdvPreferenceManager
public void replaceServerPrefPanel(JPanel panel)
public void replaceServerPreferences(EntryStore.Event evt)
public void add(String tabLabel, String description, PreferenceManager listener, Container panel, Object data)
add
in class 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 IdvPreferenceManager
private void fixDisplayListFont()
public void selectListItem(String labelName)
labelName
- The "name" of the JLabel within the JList.public void showTab(String tabNameToShow)
showTab
in class IdvPreferenceManager
tabNameToShow
- The name of the pane to be shown. Regular
expressions are supported.public void valueChanged(ListSelectionEvent e)
valueChanged
in interface ListSelectionListener
e
- The event to be handled! Use your imagination!private Container getSelectedPanel()
private Container getSelectedPanel(String name)
private String getSelectedName()
public void init()
protected void initPreferences()
initPreferences
in class IdvPreferenceManager
public void addServerPreferences()
AddePreferences
panel "around" the
server manager EntryStore
.
McIDASV.getServerManager()
public void addNavigationPreferences()
public void addToolbarPreferences()
public static JPanel makePrefPanel(Object[][] objects, Hashtable widgets, 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 value
public void addAdvancedPreferences()
protected void addDisplayPreferences()
addDisplayPreferences
in class IdvPreferenceManager
protected void addDisplayWindowPreferences()
protected void addMcVPreferences()
public boolean[] getDoRemoveBeforeOpening(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 IdvPreferenceManager
name
- Bundle name - may be null.
IdvPreferenceManager.getDoRemoveBeforeOpening(String)
protected void addFormatDataPreferences()
protected void addChooserPreferences()
addChooserPreferences
in class IdvPreferenceManager
private final List<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 String getChooserCategory(String chooserName)
chooserName
- Name of a chooser. Cannot be null
.
chooserName
or
"Other" if no category is available.private String getChooserShortName(String chooserName)
chooserName
- Name of a chooser. Cannot be null
.
chooserName
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |