ecologylab.services.logging.playback
Class LogPlaybackControlModel<E extends MixedInitiativeOp,T extends Logging<E>>

java.lang.Object
  extended by ecologylab.services.logging.playback.LogPlaybackControlModel<E,T>
All Implemented Interfaces:
javax.swing.BoundedRangeModel

public class LogPlaybackControlModel<E extends MixedInitiativeOp,T extends Logging<E>>
extends java.lang.Object
implements javax.swing.BoundedRangeModel

Model of playback for logged operations. Controls advancement through a log during playback, as well as rewind, etc.

Author:
Zachary O. Toups (toupsz@cs.tamu.edu)

Field Summary
protected  T log
           
 
Constructor Summary
LogPlaybackControlModel(T log)
           
 
Method Summary
 void addChangeListener(javax.swing.event.ChangeListener arg0)
           
 void back()
          Moves back one op.
 void forward()
          Advances the current op by one.
 E getCurrentOp()
           
 int getExtent()
           
 Prologue getLogPrologue()
           
 int getMaximum()
           
 int getMinimum()
           
 E getNext()
          Returns the next operation after the current one if one exists, otherwise returns the current operation.
 int getValue()
           
 boolean getValueIsAdjusting()
           
 void removeChangeListener(javax.swing.event.ChangeListener arg0)
           
 void reset()
          Returns the control to the first op.
 void setExtent(int arg0)
           
 void setMaximum(int arg0)
          Throws an UnsupportedOperationException; maximum is set by the underlying log data.
 void setMinimum(int arg0)
          Throws an UnsupportedOperationException; minimum is set by the underlying log data.
protected  void setPlaybackOpTo(int index)
           
 void setRangeProperties(int arg0, int arg1, int arg2, int arg3, boolean arg4)
           
 void setValue(int arg0)
           
 void setValueIsAdjusting(boolean arg0)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

protected T extends Logging<E> log
Constructor Detail

LogPlaybackControlModel

public LogPlaybackControlModel(T log)
Method Detail

reset

public void reset()
Returns the control to the first op.


forward

public void forward()
Advances the current op by one.


back

public void back()
Moves back one op.


getCurrentOp

public E getCurrentOp()

addChangeListener

public void addChangeListener(javax.swing.event.ChangeListener arg0)
Specified by:
addChangeListener in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.addChangeListener(javax.swing.event.ChangeListener)

getExtent

public int getExtent()
Specified by:
getExtent in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.getExtent()

getMaximum

public int getMaximum()
Specified by:
getMaximum in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.getMaximum()

getMinimum

public int getMinimum()
Specified by:
getMinimum in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.getMinimum()

getValue

public int getValue()
Specified by:
getValue in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.getValue()

getValueIsAdjusting

public boolean getValueIsAdjusting()
Specified by:
getValueIsAdjusting in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.getValueIsAdjusting()

removeChangeListener

public void removeChangeListener(javax.swing.event.ChangeListener arg0)
Specified by:
removeChangeListener in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.removeChangeListener(javax.swing.event.ChangeListener)

setMinimum

public void setMinimum(int arg0)
                throws java.lang.UnsupportedOperationException
Throws an UnsupportedOperationException; minimum is set by the underlying log data.

Specified by:
setMinimum in interface javax.swing.BoundedRangeModel
Throws:
java.lang.UnsupportedOperationException
See Also:
BoundedRangeModel.setMinimum(int)

setMaximum

public void setMaximum(int arg0)
                throws java.lang.UnsupportedOperationException
Throws an UnsupportedOperationException; maximum is set by the underlying log data.

Specified by:
setMaximum in interface javax.swing.BoundedRangeModel
Throws:
java.lang.UnsupportedOperationException
See Also:
BoundedRangeModel.setMaximum(int)

setExtent

public void setExtent(int arg0)
               throws java.lang.UnsupportedOperationException
Specified by:
setExtent in interface javax.swing.BoundedRangeModel
Throws:
java.lang.UnsupportedOperationException

setRangeProperties

public void setRangeProperties(int arg0,
                               int arg1,
                               int arg2,
                               int arg3,
                               boolean arg4)
Specified by:
setRangeProperties in interface javax.swing.BoundedRangeModel

setValue

public void setValue(int arg0)
Specified by:
setValue in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.setValue(int)

setPlaybackOpTo

protected void setPlaybackOpTo(int index)

setValueIsAdjusting

public void setValueIsAdjusting(boolean arg0)
Specified by:
setValueIsAdjusting in interface javax.swing.BoundedRangeModel
See Also:
BoundedRangeModel.setValueIsAdjusting(boolean)

getNext

public E getNext()
Returns the next operation after the current one if one exists, otherwise returns the current operation.

Returns:

getLogPrologue

public Prologue getLogPrologue()