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 anIntegerOptionor one of its subclasses.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JSliderslider
-
Constructor Summary
Constructors Constructor Description SliderOptionUI(T option, boolean editable)Creates a newSliderOptionUIfor the givenIntegerOption.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JSlidergetComponent()Get theComponentused to set the value of the Option.javax.swing.JLabelgetJLabel()voidreset()Reset the value of the UI's component from the Option.voidupdateOption()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 newSliderOptionUIfor the givenIntegerOption.- Parameters:
option- TheIntegerOptionto 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 theComponentused to set the value of the Option.- Specified by:
getComponentin classOptionUI<T extends Option<java.lang.Integer>>- Returns:
- a
JComponentvalue
-
updateOption
public void updateOption()
Update the value of the Option from the UI's component.- Specified by:
updateOptionin interfaceOptionUpdater- Specified by:
updateOptionin classOptionUI<T extends Option<java.lang.Integer>>
-
-