Package net.sf.freecol.client.gui.option
Class BooleanOptionUI
- java.lang.Object
-
- net.sf.freecol.client.gui.option.OptionUI<BooleanOption>
-
- net.sf.freecol.client.gui.option.BooleanOptionUI
-
- All Implemented Interfaces:
OptionUpdater
public final class BooleanOptionUI extends OptionUI<BooleanOption>
This class provides visualization for aBooleanOption
in order to enable values to be both seen and changed.
-
-
Field Summary
Fields Modifier and Type Field Description private javax.swing.JCheckBox
box
-
Constructor Summary
Constructors Constructor Description BooleanOptionUI(BooleanOption option, boolean editable)
Creates a newBooleanOptionUI
for the givenBooleanOption
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addActionListener(java.awt.event.ActionListener actionListener)
javax.swing.JCheckBox
getComponent()
Get theComponent
used to set the value of the Option.boolean
getValue()
void
removeActionListener(java.awt.event.ActionListener actionListener)
void
reset()
Reset the value of the UI's component from the Option.void
setValue(boolean b)
Sets the value of this UI's component.void
updateOption()
Update the value of the Option from the UI's component.-
Methods inherited from class net.sf.freecol.client.gui.option.OptionUI
getJLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setEnabler, setLabel, setOption
-
-
-
-
Constructor Detail
-
BooleanOptionUI
public BooleanOptionUI(BooleanOption option, boolean editable)
Creates a newBooleanOptionUI
for the givenBooleanOption
.- Parameters:
option
- TheBooleanOption
to make a user interface for.editable
- Whether user can modify the setting.
-
-
Method Detail
-
setValue
public void setValue(boolean b)
Sets the value of this UI's component.- Parameters:
b
- The new boolean value.
-
getValue
public boolean getValue()
-
addActionListener
public void addActionListener(java.awt.event.ActionListener actionListener)
-
removeActionListener
public void removeActionListener(java.awt.event.ActionListener actionListener)
-
getComponent
public javax.swing.JCheckBox getComponent()
Get theComponent
used to set the value of the Option.- Specified by:
getComponent
in classOptionUI<BooleanOption>
- 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<BooleanOption>
-
reset
public void reset()
Reset the value of the UI's component from the Option.- Specified by:
reset
in interfaceOptionUpdater
- Specified by:
reset
in classOptionUI<BooleanOption>
-
-