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
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
private static enum
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final String
private MemoryOption.Prefix
private MemoryOption.State
private final String
private boolean
private String
private int
private String
private JRadioButton
private JRadioButton
private static final org.slf4j.Logger
Logger object.private static final String
private long
private int
private static final long
private static final Pattern
private int
private static final String
private ChangeListener
private static final MemoryOption.Prefix[]
private JSlider
private static final String
private static final String
private static final String
private boolean
private JLabel
private JPanel
private McVTextField
private JPanel
private static final String
private String
-
Constructor Summary
ConstructorsConstructorDescriptionMemoryOption
(String id, String label, String defaultValue, OptionMaster.OptionPlatform optionPlatform, OptionMaster.Visibility optionVisibility) -
Method Summary
Modifier and TypeMethodDescriptionvoid
void
fromPrefsFormat
(String prefText) Initializes the current option using a relevant variable from the startup script.Returns the GUI component that represents the option.private static long
getValue()
Returns the value of the option.private void
handleNewValue
(McVTextField field) private boolean
isSlider()
private boolean
isValid()
private void
setState
(MemoryOption.State newState) void
Forces the value of the option to the data specified.toString()
Friendly string representation of the option.Methods inherited from class edu.wisc.ssec.mcidasv.startupmanager.options.AbstractOption
getLabel, getOptionId, getOptionPlatform, getOptionType, getOptionVisibility, isValidPrefFormat, onValidPlatform, toPrefsFormat
-
Field Details
-
logger
Logger object. -
MEGA_BYTES_TO_BYTES
- See Also:
-
TOO_BIG_FMT
- See Also:
-
BAD_MEM_FMT
- See Also:
-
LTE_ZERO_FMT
- See Also:
-
SLIDER_LABEL_FMT
- See Also:
-
SLIDER_LESS_THAN_MIN_LABEL_FMT
- See Also:
-
SLIDER_GREATER_THAN_MAX_LABEL_FMT
- See Also:
-
NO_MEM_PREFIX_FMT
- See Also:
-
PREFIXES
-
currentPrefix
-
sliderActive
-
MEMSTRING
-
defaultPrefValue
-
failsafeValue
-
value
-
jrbSlider
-
jrbNumber
-
sliderPanel
-
sliderLabel
-
slider
-
textPanel
-
text
-
initTextValue
-
minSliderValue
-
maxSliderValue
-
initSliderValue
-
maxmem
-
currentState
-
doneInit
-
percentListener
-
-
Constructor Details
-
MemoryOption
public MemoryOption(String id, String label, String defaultValue, OptionMaster.OptionPlatform optionPlatform, OptionMaster.Visibility optionVisibility)
-
-
Method Details
-
setState
-
isValid
-
isSlider
-
actionPerformed
- Specified by:
actionPerformed
in interfaceActionListener
-
handleNewValue
-
getComponent
Description copied from class:AbstractOption
Returns the GUI component that represents the option.BooleanOptions
are represented by aJCheckBox
, whileTextOptions
appear as aJTextField
.- Specified by:
getComponent
in interfaceOption
- Specified by:
getComponent
in classAbstractOption
- Returns:
- The GUI representation of this option.
-
getSliderComponent
-
getTextComponent
-
toString
Description copied from class:AbstractOption
Friendly string representation of the option.- Specified by:
toString
in interfaceOption
- Specified by:
toString
in classAbstractOption
- Returns:
String
containing relevant info about the option.- See Also:
-
getValue
Description copied from class:AbstractOption
Returns the value of the option. Note thatBooleanOptions
return either "0" or "1".- Specified by:
getValue
in interfaceOption
- Specified by:
getValue
in classAbstractOption
- Returns:
- The current value of the option.
-
fromPrefsFormat
Description copied from class:AbstractOption
Initializes the current option using a relevant variable from the startup script.- Specified by:
fromPrefsFormat
in interfaceOption
- Overrides:
fromPrefsFormat
in classAbstractOption
- Parameters:
prefText
- Line from the startup script that represents the current option.
-
setValue
Description copied from class:AbstractOption
Forces the value of the option to the data specified. Note thatBooleanOptions
accept either "0", or "1".- Specified by:
setValue
in interfaceOption
- Specified by:
setValue
in classAbstractOption
- Parameters:
newValue
- New value to use.
-
getSystemMemory
-