Package net.sf.freecol.client.gui.option
Class UnitTypeOptionUI
- java.lang.Object
-
- net.sf.freecol.client.gui.option.OptionUI<UnitTypeOption>
-
- net.sf.freecol.client.gui.option.UnitTypeOptionUI
-
- All Implemented Interfaces:
OptionUpdater
public final class UnitTypeOptionUI extends OptionUI<UnitTypeOption>
This class provides visualization for aUnitTypeOption
in order to enable values to be both seen and changed.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static class
UnitTypeOptionUI.ChoiceRenderer
-
Constructor Summary
Constructors Constructor Description UnitTypeOptionUI(UnitTypeOption option, boolean editable)
Creates a newUnitTypeOptionUI
for the givenUnitTypeOption
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description javax.swing.JComboBox
getComponent()
Get theComponent
used to set the value of the Option.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
getJLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setEnabler, setLabel, setOption
-
-
-
-
Field Detail
-
box
private final javax.swing.JComboBox<UnitType> box
-
-
Constructor Detail
-
UnitTypeOptionUI
public UnitTypeOptionUI(UnitTypeOption option, boolean editable)
Creates a newUnitTypeOptionUI
for the givenUnitTypeOption
.- Parameters:
option
- TheUnitTypeOption
to make a user interface for.editable
- boolean whether user can modify the setting
-
-
Method Detail
-
getComponent
public javax.swing.JComboBox getComponent()
Get theComponent
used to set the value of the Option.- Specified by:
getComponent
in classOptionUI<UnitTypeOption>
- 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<UnitTypeOption>
-
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<UnitTypeOption>
-
-