net.sf.freecol.client.gui.option
Class IntegerOptionUI

java.lang.Object
  extended by net.sf.freecol.client.gui.option.OptionUI<IntegerOption>
      extended by net.sf.freecol.client.gui.option.IntegerOptionUI
All Implemented Interfaces:
OptionUpdater

public final class IntegerOptionUI
extends OptionUI<IntegerOption>

This class provides visualization for an IntegerOption. In order to enable values to be both seen and changed.


Field Summary
private  javax.swing.JSpinner spinner
           
 
Fields inherited from class net.sf.freecol.client.gui.option.OptionUI
gui
 
Constructor Summary
IntegerOptionUI(GUI gui, IntegerOption option, boolean editable)
          Creates a new IntegerOptionUI for the given IntegerOption.
 
Method Summary
 javax.swing.JSpinner getComponent()
          Get the Component 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
getLabel, getListCellRenderer, getOption, getOptionUI, initialize, isEditable, setEditable, setLabel, setOption
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

spinner

private javax.swing.JSpinner spinner
Constructor Detail

IntegerOptionUI

public IntegerOptionUI(GUI gui,
                       IntegerOption option,
                       boolean editable)
Creates a new IntegerOptionUI for the given IntegerOption.

Parameters:
option - The IntegerOption to make a user interface for.
editable - boolean whether user can modify the setting
Method Detail

getComponent

public javax.swing.JSpinner getComponent()
Get the Component used to set the value of the Option.

Specified by:
getComponent in class OptionUI<IntegerOption>
Returns:
a JComponent value

updateOption

public void updateOption()
Update the value of the Option from the UI's component.

Specified by:
updateOption in interface OptionUpdater
Specified by:
updateOption in class OptionUI<IntegerOption>

reset

public void reset()
Reset the value of the UI's component from the Option.

Specified by:
reset in interface OptionUpdater
Specified by:
reset in class OptionUI<IntegerOption>