edu.wisc.ssec.mcidasv.startupmanager.options
Class MemoryOption
java.lang.Object
edu.wisc.ssec.mcidasv.startupmanager.options.AbstractOption
edu.wisc.ssec.mcidasv.startupmanager.options.MemoryOption
- All Implemented Interfaces:
- Option, ActionListener, EventListener
public class MemoryOption
- extends AbstractOption
- implements ActionListener
PREFIXES
private static final MemoryOption.Prefix[] PREFIXES
currentPrefix
private MemoryOption.Prefix currentPrefix
MEMSTRING
private static final Pattern MEMSTRING
defaultPrefValue
private final String defaultPrefValue
failsafeValue
private String failsafeValue
value
private String value
jrbSlider
private JRadioButton jrbSlider
jrbNumber
private JRadioButton jrbNumber
jtbBg
private ButtonGroup jtbBg
sliderPanel
private JPanel sliderPanel
sliderLabel
private JLabel sliderLabel
slider
private JSlider slider
textPanel
private JPanel textPanel
text
private McVTextField text
memVals
private JComboBox memVals
initTextValue
private String initTextValue
initPrefixValue
private MemoryOption.Prefix initPrefixValue
minSliderValue
private int minSliderValue
maxSliderValue
private int maxSliderValue
initSliderValue
private int initSliderValue
maxmem
private int maxmem
currentState
private MemoryOption.State currentState
doneInit
private boolean doneInit
percentListener
public ChangeListener percentListener
MemoryOption
public MemoryOption(String id,
String label,
String defaultValue,
OptionMaster.OptionPlatform optionPlatform,
OptionMaster.Visibility optionVisibility)
getNames
private String[] getNames(MemoryOption.Prefix[] arr)
setState
private void setState(MemoryOption.State newState)
isValid
private boolean isValid()
isSlider
private boolean isSlider()
actionPerformed
public void actionPerformed(ActionEvent e)
- Specified by:
actionPerformed
in interface ActionListener
handleNewValue
private void handleNewValue(JTextField field,
JComboBox box)
getComponent
public JPanel getComponent()
- Description copied from class:
AbstractOption
- Returns the GUI component that represents the option.
BooleanOption
s are represented by a JCheckBox
, while
TextOption
s appear as a JTextField
.
- Specified by:
getComponent
in interface Option
- Specified by:
getComponent
in class AbstractOption
- Returns:
- The GUI representation of this option.
getSliderComponent
public JComponent getSliderComponent()
getTextComponent
public JComponent getTextComponent()
toString
public String toString()
- Description copied from class:
AbstractOption
- Friendly string representation of the option.
- Specified by:
toString
in interface Option
- Specified by:
toString
in class AbstractOption
- Returns:
- String containing relevant info about the option.
- See Also:
TextOption.toString()
,
BooleanOption.toString()
getValue
public String getValue()
- Description copied from class:
AbstractOption
- Returns the value of the option. Note that
BooleanOption
s
return either "0" or "1".
- Specified by:
getValue
in interface Option
- Specified by:
getValue
in class AbstractOption
- Returns:
- The current value of the option.
fromPrefsFormat
public void fromPrefsFormat(String prefText)
- Description copied from class:
AbstractOption
- Initializes the current option using a relevant variable from the
startup script.
- Specified by:
fromPrefsFormat
in interface Option
- Overrides:
fromPrefsFormat
in class AbstractOption
- Parameters:
prefText
- Line from the startup script that represents the current
option.
setValue
public void setValue(String newValue)
- Description copied from class:
AbstractOption
- Forces the value of the option to the data specified. Note that
BooleanOption
s accept either "0", or "1".
- Specified by:
setValue
in interface Option
- Specified by:
setValue
in class AbstractOption
- Parameters:
newValue
- New value to use.