sigmlanim.sigmlstream
Class SiGMLInputAnimGenCoordinator

java.lang.Object
  extended by sigmlanim.sigmlstream.SiGMLInputAnimGenCoordinator
All Implemented Interfaces:
StreamedSiGMLReceiver, StreamedSiGMLSupplierForAnimationGen

public class SiGMLInputAnimGenCoordinator
extends java.lang.Object
implements StreamedSiGMLReceiver, StreamedSiGMLSupplierForAnimationGen

A SiGMLInputAnimGenCoordinator acts both as a StreamedSiGMLReceiver and as a StreamedSiGMLSupplierForAnimationGen, passing the (as yet unanimated) signs it receives from its source on to a SiGMLAnimationBuildHandler, supplied at construction time, and also caching them and passing them on to the coordinator's target animation generator


Constructor Summary
SiGMLInputAnimGenCoordinator(SiGMLAnimationBuildHandler sab)
          Constructs a new SiGML input animation generation coordinator, supplying the generated signs to the given animation builder.
 
Method Summary
 void abortCurrentSiGMLStream()
          Notifies this receiver that the sign stream associated with the most recent checkpoint (established using addStreamAbortCheckpoint()) has now been aborted, so that the receiver can respond appropriately.
 void addStreamAbortCheckpoint()
          Sets a checkpoint for abortion of the sign stream generated for an individual SiGML document.
 void beginSignStream()
          Accepts notification of the start either of the entire input sign stream, or of an indirectly accessed stream embedded within it, keeping track of the level of such embedding.
 void clearStreamAbortCheckpoint()
          Clears the most recently established stream abortion checkpoint.
 void doneSignAnimation()
          Accepts notification from the animation generator that one more sign has been generated, and forwards this notice to this coordinator's animation builder.
 void endSignStream()
          Accepts notification of the completion either of the entire input sign stream, or of an indirectly accessed stream embedded within it, keeping track of the embedding level and notifying this coordinator's animation builder when the end of the entire input stream has been encountered.
 AnimatedSign getNextSignToBeAnimated()
          Blocks if necessary until sufficent data is available, and then returns the next sign for animation generation, or null if the input sign sequence is known to be exhausted.
 StreamedSiGMLSupplierForAnimationGen getSiGMLSupplierForAG()
          Returns the SiGML supplier for animation generation to be used in association with this coordinator.
 void setNewPlayerSettings(sigmlgen.playerctrl.PlayerSettings ps)
          Accepts a new player settings specification from the input source; these settings will be applied to the next sign received.
 void setNextSign(java.lang.String gsigml, java.lang.String gloss)
          Accepts the next gestural SiGML sign, as specified by the arguments, from the input source, passing it on to this coordinator's animation builder, and queuing it so that it can be supplied when requested from this coordinator's target animation generator.
 void setNextSignWithAnim(AnimatedSign sign)
          Accepts the next sign as one with animation data already attached, passing it on to this coordinator's animation builder, and queuing it so that it can be supplied when requested from this coordinator's target animation generator.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SiGMLInputAnimGenCoordinator

public SiGMLInputAnimGenCoordinator(SiGMLAnimationBuildHandler sab)
Constructs a new SiGML input animation generation coordinator, supplying the generated signs to the given animation builder.

Method Detail

getSiGMLSupplierForAG

public StreamedSiGMLSupplierForAnimationGen getSiGMLSupplierForAG()
Returns the SiGML supplier for animation generation to be used in association with this coordinator. The supplier returned will either be this coordinator itself or a FilteringSupplierForAnimGen instance supported by this coordinator.


beginSignStream

public void beginSignStream()
Accepts notification of the start either of the entire input sign stream, or of an indirectly accessed stream embedded within it, keeping track of the level of such embedding.

Specified by:
beginSignStream in interface StreamedSiGMLReceiver

setNewPlayerSettings

public void setNewPlayerSettings(sigmlgen.playerctrl.PlayerSettings ps)
Accepts a new player settings specification from the input source; these settings will be applied to the next sign received.

Specified by:
setNewPlayerSettings in interface StreamedSiGMLReceiver

setNextSign

public void setNextSign(java.lang.String gsigml,
                        java.lang.String gloss)
Accepts the next gestural SiGML sign, as specified by the arguments, from the input source, passing it on to this coordinator's animation builder, and queuing it so that it can be supplied when requested from this coordinator's target animation generator.

Specified by:
setNextSign in interface StreamedSiGMLReceiver

setNextSignWithAnim

public void setNextSignWithAnim(AnimatedSign sign)
Accepts the next sign as one with animation data already attached, passing it on to this coordinator's animation builder, and queuing it so that it can be supplied when requested from this coordinator's target animation generator.

Specified by:
setNextSignWithAnim in interface StreamedSiGMLReceiver

endSignStream

public void endSignStream()
Accepts notification of the completion either of the entire input sign stream, or of an indirectly accessed stream embedded within it, keeping track of the embedding level and notifying this coordinator's animation builder when the end of the entire input stream has been encountered.

Specified by:
endSignStream in interface StreamedSiGMLReceiver

addStreamAbortCheckpoint

public void addStreamAbortCheckpoint()
Sets a checkpoint for abortion of the sign stream generated for an individual SiGML document. It is expected that the controller of the SiGML scanning process will set a checkpoint for each individual SiGML document scanned, but this is not strictly required. What is required is that each invocation of this method should should be matched by a subsequent invocation either of clearStreamAbortCheckpoint() or of abortCurrentSiGMLStream().

Specified by:
addStreamAbortCheckpoint in interface StreamedSiGMLReceiver

abortCurrentSiGMLStream

public void abortCurrentSiGMLStream()
Notifies this receiver that the sign stream associated with the most recent checkpoint (established using addStreamAbortCheckpoint()) has now been aborted, so that the receiver can respond appropriately. If the stream in question has started it is now terminated, and if it is the top-level stream and has not yet started, an empty sign sequence is notified to this coordinator's animation builder.

Specified by:
abortCurrentSiGMLStream in interface StreamedSiGMLReceiver

clearStreamAbortCheckpoint

public void clearStreamAbortCheckpoint()
Clears the most recently established stream abortion checkpoint.

Specified by:
clearStreamAbortCheckpoint in interface StreamedSiGMLReceiver

getNextSignToBeAnimated

public AnimatedSign getNextSignToBeAnimated()
                                     throws java.lang.InterruptedException
Blocks if necessary until sufficent data is available, and then returns the next sign for animation generation, or null if the input sign sequence is known to be exhausted.

Specified by:
getNextSignToBeAnimated in interface StreamedSiGMLSupplierForAnimationGen
Throws:
java.lang.InterruptedException

doneSignAnimation

public void doneSignAnimation()
Accepts notification from the animation generator that one more sign has been generated, and forwards this notice to this coordinator's animation builder.

Specified by:
doneSignAnimation in interface StreamedSiGMLSupplierForAnimationGen