app.gui
Class CyclicFrameIndexModel

java.lang.Object
  extended by javax.swing.AbstractSpinnerModel
      extended by javax.swing.SpinnerNumberModel
          extended by app.gui.CyclicFrameIndexModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.SpinnerModel

public class CyclicFrameIndexModel
extends javax.swing.SpinnerNumberModel

Cyclic frame number data model for use by a FrameNumberSpinner control. This model extends (in fact, largely supersedes) the standard Swing SpinnerNumberModel. It is bound via a FrameIndexScanAccess implemention to the animation scan data used by a JA avatar player component.

See Also:
Serialized Form

Constructor Summary
CyclicFrameIndexModel()
          Constructs a new cyclic frame number model.
 
Method Summary
 void clearAccess()
          Removes this model's current scan access, if any, and resets the model's value, minimum and maximum all to zero.
 java.lang.Comparable<?> getMaximum()
          Returns the current maximum value for this spinner model (as an Integer).
 java.lang.Comparable<?> getMinimum()
          Returns the current minimum value for this spinner model (as an Integer).
 java.lang.Object getNextValue()
          Returns the next value (as an Integer), cycling from the current maximum to the current minimum if need be.
 java.lang.Number getNumber()
          Returns this model's current value as an Integer.
 java.lang.Object getPreviousValue()
          Returns the previous value (as an Integer), cycling from the current minimum to the current maximum if need be.
 java.lang.Object getValue()
          Returns this model's current value as an Integer.
 void setAccess(player.FrameIndexScanAccess fisa)
          Binds this spinner model to the given animation scan access.
 void setValue(java.lang.Object value)
          Sets this model's value to the one given, which must be an Integer.
 
Methods inherited from class javax.swing.SpinnerNumberModel
getStepSize, setMaximum, setMinimum, setStepSize
 
Methods inherited from class javax.swing.AbstractSpinnerModel
addChangeListener, getChangeListeners, getListeners, removeChangeListener
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CyclicFrameIndexModel

public CyclicFrameIndexModel()
Constructs a new cyclic frame number model.

Method Detail

clearAccess

public void clearAccess()
Removes this model's current scan access, if any, and resets the model's value, minimum and maximum all to zero.


setAccess

public void setAccess(player.FrameIndexScanAccess fisa)
Binds this spinner model to the given animation scan access.


setValue

public void setValue(java.lang.Object value)
Sets this model's value to the one given, which must be an Integer.

Specified by:
setValue in interface javax.swing.SpinnerModel
Overrides:
setValue in class javax.swing.SpinnerNumberModel

getNumber

public java.lang.Number getNumber()
Returns this model's current value as an Integer.

Overrides:
getNumber in class javax.swing.SpinnerNumberModel

getValue

public java.lang.Object getValue()
Returns this model's current value as an Integer.

Specified by:
getValue in interface javax.swing.SpinnerModel
Overrides:
getValue in class javax.swing.SpinnerNumberModel

getMinimum

public java.lang.Comparable<?> getMinimum()
Returns the current minimum value for this spinner model (as an Integer). If the underlying animation scan is in single-sign mode, then the the minimum is the first frame index for the current sign.

Overrides:
getMinimum in class javax.swing.SpinnerNumberModel

getMaximum

public java.lang.Comparable<?> getMaximum()
Returns the current maximum value for this spinner model (as an Integer). If the underlying animation scan is in single-sign mode, then the the maximum is the final frame index for the current sign.

Overrides:
getMaximum in class javax.swing.SpinnerNumberModel

getNextValue

public java.lang.Object getNextValue()
Returns the next value (as an Integer), cycling from the current maximum to the current minimum if need be.

Specified by:
getNextValue in interface javax.swing.SpinnerModel
Overrides:
getNextValue in class javax.swing.SpinnerNumberModel

getPreviousValue

public java.lang.Object getPreviousValue()
Returns the previous value (as an Integer), cycling from the current minimum to the current maximum if need be.

Specified by:
getPreviousValue in interface javax.swing.SpinnerModel
Overrides:
getPreviousValue in class javax.swing.SpinnerNumberModel