us.zuercher.gpx2map.gui
Class MarkerSizeSpinnerModel

java.lang.Object
  extended by us.zuercher.gpx2map.gui.MarkerSizeSpinnerModel
All Implemented Interfaces:
SpinnerModel

public class MarkerSizeSpinnerModel
extends Object
implements SpinnerModel

MarkerSizeSpinnerModel implements SpinnerModel for the marker size spinner controls in the Gpx2Map GUI.

Author:
Stephan Zuercher

Field Summary
private static int CHANGE_SIZE
          Increment/decrement size for a marker size spinner.
static int DEFAULT_SIZE
          Default marker size.
private  HashSet<ChangeListener> listeners
          A set of ChangeListener implementations to notify when this spinner model changes.
private static int MINIMUM_VALUE
          Minimum marker size.
private  int value
          Current marker size.
 
Constructor Summary
MarkerSizeSpinnerModel()
           
 
Method Summary
 void addChangeListener(ChangeListener listener)
          Add a listener to this spinner model.
 Object getNextValue()
          Compute the next value of this spinner as an Integer.
 Object getPreviousValue()
          Compute the previous value of this spinner as an Integer.
 Object getValue()
          Returns the value of this spinner as an Integer.
 void removeChangeListener(ChangeListener listener)
          Remove a listener from this spinner model.
 void setValue(Object value)
          Sets the value of this spinner using an Integer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MINIMUM_VALUE

private static final int MINIMUM_VALUE
Minimum marker size.

See Also:
Constant Field Values

CHANGE_SIZE

private static final int CHANGE_SIZE
Increment/decrement size for a marker size spinner.

See Also:
Constant Field Values

DEFAULT_SIZE

public static final int DEFAULT_SIZE
Default marker size.

See Also:
Constant Field Values

value

private int value
Current marker size.


listeners

private HashSet<ChangeListener> listeners
A set of ChangeListener implementations to notify when this spinner model changes.

Constructor Detail

MarkerSizeSpinnerModel

public MarkerSizeSpinnerModel()
Method Detail

getValue

public Object getValue()
Returns the value of this spinner as an Integer.

Specified by:
getValue in interface SpinnerModel
Returns:
the value of this spinner as an Integer.

setValue

public void setValue(Object value)
Sets the value of this spinner using an Integer.

Specified by:
setValue in interface SpinnerModel
Parameters:
value - the new spinner value, must be an Integer.

getNextValue

public Object getNextValue()
Compute the next value of this spinner as an Integer. Always returns an integer one larger than value.

Specified by:
getNextValue in interface SpinnerModel
Returns:
the next value of this spinner as an Integer.

getPreviousValue

public Object getPreviousValue()
Compute the previous value of this spinner as an Integer. Always returns an integer one less than value, except when value is MINIMUM_VALUE in which case MINIMUM_VALUE is returned.

Specified by:
getPreviousValue in interface SpinnerModel
Returns:
the previous value of this spinner as an Integer.

addChangeListener

public void addChangeListener(ChangeListener listener)
Add a listener to this spinner model.

Specified by:
addChangeListener in interface SpinnerModel
Parameters:
listener - new listener

removeChangeListener

public void removeChangeListener(ChangeListener listener)
Remove a listener from this spinner model.

Specified by:
removeChangeListener in interface SpinnerModel
Parameters:
listener - listener to remove