edu.wisc.ssec.mcidasv.servermanager
Class AddePreferences

java.lang.Object
  extended by edu.wisc.ssec.mcidasv.servermanager.AddePreferences

public class AddePreferences
extends Object

The ADDE Server preference panel is almost a read-only "view" of the current state of the server manager. The only thing that users can change from here is the visibility of the individual AddeEntrys, though there has been some talk of allowing for reordering.


Nested Class Summary
static class AddePreferences.AddePrefConglomeration
          This class is essentially a specialized tuple of the different things required by the IdvPreferenceManager.
static class AddePreferences.Selection
           
 
Field Summary
private  JButton allOff
          Allows the user to disable all AddeEntrys, without disabling the preference panel.
private  JButton allOn
          Allows the user to enable all AddeEntrys, without disabling the preference panel.
private  JPanel cbPanel
          Panel that contains the various AddeEntrys.
private  JScrollPane cbScroller
           
private  EntryStore entryStore
          Contains the lists of ADDE servers that we'll use as content.
private static org.slf4j.Logger logger
           
private static String PREF_LIST_DEFAULT_SERV
          Property ID for controlling the display of "default mcv" servers in the server preferences.
private static String PREF_LIST_MCTABLE_SERV
          Property ID for controlling the display of "MCTABLE" servers in the server preferences.
private static String PREF_LIST_SITE_SERV
          Property ID for controlling the display of "site" servers in the server preferences.
private static String PREF_LIST_SPECIFY
          Property ID that allows McIDAS-V to remember whether or not the user has chosen to use all available ADDE servers or has specified the "active" servers.
private static String PREF_LIST_USER_SERV
          Property ID for controlling the display of "user" servers in the server preferences.
 
Constructor Summary
AddePreferences(EntryStore entryStore)
          Prepares a new preference panel based upon the supplied EntryStore.
 
Method Summary
 void addPanel(McIdasPreferenceManager prefManager)
          Adds the various AddePreferences.AddePrefConglomeration objects to the prefManager.
 AddePreferences.AddePrefConglomeration buildPanel(McIDASV mcv)
          Builds the remote server preference panel, using the given McIdasPreferenceManager.
private  AddePreferences.Selection getSpecifyServers()
          Returns the value of the PREF_LIST_SPECIFY preference.
 void handleCategoryToggle(String topic, CheckboxCategoryPanel catPanel)
          Listens for CheckboxCategoryPanel updates and stores the current status.
 void setGUIEnabled(boolean enabled)
          Enables or disables: JPanel containing the AddeEntrys (cbPanel).
private  void setSpecifyServers(AddePreferences.Selection entrySelection)
          Sets the value of the PREF_LIST_SPECIFY preference to value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

private static final org.slf4j.Logger logger

PREF_LIST_SITE_SERV

private static final String PREF_LIST_SITE_SERV
Property ID for controlling the display of "site" servers in the server preferences.

See Also:
Constant Field Values

PREF_LIST_DEFAULT_SERV

private static final String PREF_LIST_DEFAULT_SERV
Property ID for controlling the display of "default mcv" servers in the server preferences.

See Also:
Constant Field Values

PREF_LIST_MCTABLE_SERV

private static final String PREF_LIST_MCTABLE_SERV
Property ID for controlling the display of "MCTABLE" servers in the server preferences.

See Also:
Constant Field Values

PREF_LIST_USER_SERV

private static final String PREF_LIST_USER_SERV
Property ID for controlling the display of "user" servers in the server preferences.

See Also:
Constant Field Values

PREF_LIST_SPECIFY

private static final String PREF_LIST_SPECIFY
Property ID that allows McIDAS-V to remember whether or not the user has chosen to use all available ADDE servers or has specified the "active" servers.

See Also:
Constant Field Values

entryStore

private final EntryStore entryStore
Contains the lists of ADDE servers that we'll use as content.


cbPanel

private JPanel cbPanel
Panel that contains the various AddeEntrys.


cbScroller

private JScrollPane cbScroller

allOn

private JButton allOn
Allows the user to enable all AddeEntrys, without disabling the preference panel.


allOff

private JButton allOff
Allows the user to disable all AddeEntrys, without disabling the preference panel.

Constructor Detail

AddePreferences

public AddePreferences(EntryStore entryStore)
Prepares a new preference panel based upon the supplied EntryStore.

Parameters:
entryStore - The EntryStore to query. Cannot be null.
Throws:
NullPointerException - if entryStore is null.
Method Detail

addPanel

public void addPanel(McIdasPreferenceManager prefManager)
Adds the various AddePreferences.AddePrefConglomeration objects to the prefManager.

Parameters:
prefManager - McIDAS-V's PreferenceManager. Should not be null.

handleCategoryToggle

public void handleCategoryToggle(String topic,
                                 CheckboxCategoryPanel catPanel)
Listens for CheckboxCategoryPanel updates and stores the current status.

Parameters:
topic - Topic of interest is "CheckboxCategoryPanel.PanelToggled".
catPanel - The object that changed.

buildPanel

public AddePreferences.AddePrefConglomeration buildPanel(McIDASV mcv)
Builds the remote server preference panel, using the given McIdasPreferenceManager.

Parameters:
mcv - Reference to the McIDAS-V object; mostly used to control the server manager GUI. Cannot be null.
Returns:
An object containing the various components required of a preference panel.

setGUIEnabled

public void setGUIEnabled(boolean enabled)
Enables or disables: Enabling the components allows the user to pick and choose servers, while disabling enables all servers.

Parameters:
enabled - true enables the components and false disables.

setSpecifyServers

private void setSpecifyServers(AddePreferences.Selection entrySelection)
Sets the value of the PREF_LIST_SPECIFY preference to value.

Parameters:
entrySelection - New value to associate with PREF_LIST_SPECIFY.

getSpecifyServers

private AddePreferences.Selection getSpecifyServers()
Returns the value of the PREF_LIST_SPECIFY preference. Defaults to "ALL".