Package net.sf.freecol.client.gui.option
Class SliderOptionUI<T extends Option<java.lang.Integer>>
- java.lang.Object
-
- net.sf.freecol.client.gui.option.OptionUI<T>
-
- net.sf.freecol.client.gui.option.SliderOptionUI<T>
-
- All Implemented Interfaces:
OptionUpdater
- Direct Known Subclasses:
PercentageOptionUI
,RangeOptionUI
public class SliderOptionUI<T extends Option<java.lang.Integer>> extends OptionUI<T>
This class provides a JSlider as visualization for anIntegerOption
or one of its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JSlider
slider
-
Constructor Summary
Constructors Constructor Description SliderOptionUI(T option, boolean editable)
Creates a newSliderOptionUI
for the givenIntegerOption
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JSlider
getComponent()
Get theComponent
used to set the value of the Option.javax.swing.JLabel
getJLabel()
void
reset()
Reset the value of the UI's component from the Option.void
updateOption()
Update the value of the Option from the UI's component.-
Methods inherited from class net.sf.freecol.client.gui.option.OptionUI
getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setEnabler, setLabel, setOption
-
-
-
-
Constructor Detail
-
SliderOptionUI
public SliderOptionUI(T option, boolean editable)
Creates a newSliderOptionUI
for the givenIntegerOption
.- Parameters:
option
- TheIntegerOption
to make a user interface for.editable
- boolean whether user can modify the setting
-
-
Method Detail
-
getJLabel
public final javax.swing.JLabel getJLabel()
-
getComponent
public javax.swing.JSlider getComponent()
Get theComponent
used to set the value of the Option.- Specified by:
getComponent
in classOptionUI<T extends Option<java.lang.Integer>>
- Returns:
- a
JComponent
value
-
updateOption
public void updateOption()
Update the value of the Option from the UI's component.- Specified by:
updateOption
in interfaceOptionUpdater
- Specified by:
updateOption
in classOptionUI<T extends Option<java.lang.Integer>>
-
-