sigmlanim
Class JAnimgen

java.lang.Object
  extended by sigmlanim.JAnimgen

public class JAnimgen
extends java.lang.Object

A Java wrapper for animgen, depends on the underlying jaglib JNI interface to animgen. 2007-08 A new streamed variant with a thread supported by a StreamedSiGMLSupplierForAnimationGen which it calls repeatedly to obtain each sign to be animated and to give notice when the animation frames have been generated for each sign.


Nested Class Summary
static class JAnimgen.JAGException
          JAnimgen exception class.
 
Field Summary
static int AG_OK_STATUS
          animgen status value: NO ERRORS
static int AG_SIGML_WARNING
          animgen status value: SIGML WARNING(S)
static int AGS_FINAL_FAIL
          Animgen completion status value: failure on completion.
static int AGS_INIT_FAIL
          Animgen completion status value: failure at initialization.
static int AGS_OK
          Animgen completion status value: OK.
static int AGS_SIGML_QUERY
          Animgen completion status value: OK, but SiGML warnings.
static int AGS_STATUS_FAIL
          Animgen completion status value: failure at initialization.
static int AGS_TBD
          Animgen completion status value: Yet to be determined.
static int FBIX_BONE_COUNT
          Frame data-buffer index: bone count.
static int FBIX_DATA
          Frame data-buffer index: bone/morph data start.
static int FBIX_DURATION
          Frame data-buffer index: frame duration.
static int FBIX_MORPH_COUNT
          Frame data-buffer index: morph count.
static int JAG_DONE
          JAG object state value for the "done" state.
static int JAG_GENERATING
          JAG object state value for the "generating" state.
static int JAG_PRIMORDIAL
          JAG object state value for the "primordial" state.
static int JAG_READY
          JAG object state value for the "ready" state.
static int JAG_SETTING_UP
          JAG object state value for the "setting-up" state.
static int MAX_JAG_INSTANCES
          Upper limit on the permitted number of concurrent JAnimgen instances.
static int TRSET_SIZE
          TR-set data array size (translation + rotation).
 
Constructor Summary
JAnimgen(JAnimgenConfigData CFG_DATA, AnimatedSign[] ANIM_SIGNS)
          Constructs a new non-streamed Java animgen wrapper with the given configuration data, and runs an animgen thread using the given signs as input and attaching animations to them.
JAnimgen(JAnimgenConfigData CFG_DATA, StreamedSiGMLSupplierForAnimationGen SIGML_SUPPLIER)
          Constructs a new streamed Java animgen wrapper with the given configuration data, and runs an animgen thread using the given signs stream supplier as its input source.
 
Method Summary
 boolean framesAreAvailable()
          Determines if this animgen run has produced frames, blocking if necessary for animgen completion.
 int getAGStatus()
          Gets the animgen completion status, blocking if necessary for animgen completion to deliver this status value.
 CASFrame[] getFrames()
          Returns the CAS frames produced by this animgen run, blocking if necessary for animgen completion.
static void init()
          Initialises JAnimgen: the sole purpose of this is to force execution of the static intialiser, which loads the native jaglib.
 void runAnimgen()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

AG_OK_STATUS

public static final int AG_OK_STATUS
animgen status value: NO ERRORS

See Also:
Constant Field Values

AG_SIGML_WARNING

public static final int AG_SIGML_WARNING
animgen status value: SIGML WARNING(S)

See Also:
Constant Field Values

JAG_PRIMORDIAL

public static final int JAG_PRIMORDIAL
JAG object state value for the "primordial" state.

See Also:
Constant Field Values

JAG_SETTING_UP

public static final int JAG_SETTING_UP
JAG object state value for the "setting-up" state.

See Also:
Constant Field Values

JAG_READY

public static final int JAG_READY
JAG object state value for the "ready" state.

See Also:
Constant Field Values

JAG_GENERATING

public static final int JAG_GENERATING
JAG object state value for the "generating" state.

See Also:
Constant Field Values

JAG_DONE

public static final int JAG_DONE
JAG object state value for the "done" state.

See Also:
Constant Field Values

AGS_TBD

public static final int AGS_TBD
Animgen completion status value: Yet to be determined.

See Also:
Constant Field Values

AGS_OK

public static final int AGS_OK
Animgen completion status value: OK.

See Also:
Constant Field Values

AGS_SIGML_QUERY

public static final int AGS_SIGML_QUERY
Animgen completion status value: OK, but SiGML warnings.

See Also:
Constant Field Values

AGS_INIT_FAIL

public static final int AGS_INIT_FAIL
Animgen completion status value: failure at initialization.

See Also:
Constant Field Values

AGS_STATUS_FAIL

public static final int AGS_STATUS_FAIL
Animgen completion status value: failure at initialization.

See Also:
Constant Field Values

AGS_FINAL_FAIL

public static final int AGS_FINAL_FAIL
Animgen completion status value: failure on completion.

See Also:
Constant Field Values

FBIX_DURATION

public static final int FBIX_DURATION
Frame data-buffer index: frame duration.

See Also:
Constant Field Values

FBIX_BONE_COUNT

public static final int FBIX_BONE_COUNT
Frame data-buffer index: bone count.

See Also:
Constant Field Values

FBIX_MORPH_COUNT

public static final int FBIX_MORPH_COUNT
Frame data-buffer index: morph count.

See Also:
Constant Field Values

FBIX_DATA

public static final int FBIX_DATA
Frame data-buffer index: bone/morph data start.

See Also:
Constant Field Values

TRSET_SIZE

public static final int TRSET_SIZE
TR-set data array size (translation + rotation).

See Also:
Constant Field Values

MAX_JAG_INSTANCES

public static final int MAX_JAG_INSTANCES
Upper limit on the permitted number of concurrent JAnimgen instances.

See Also:
Constant Field Values
Constructor Detail

JAnimgen

public JAnimgen(JAnimgenConfigData CFG_DATA,
                AnimatedSign[] ANIM_SIGNS)
Constructs a new non-streamed Java animgen wrapper with the given configuration data, and runs an animgen thread using the given signs as input and attaching animations to them.


JAnimgen

public JAnimgen(JAnimgenConfigData CFG_DATA,
                StreamedSiGMLSupplierForAnimationGen SIGML_SUPPLIER)
Constructs a new streamed Java animgen wrapper with the given configuration data, and runs an animgen thread using the given signs stream supplier as its input source.

Method Detail

init

public static void init()
Initialises JAnimgen: the sole purpose of this is to force execution of the static intialiser, which loads the native jaglib.


getAGStatus

public int getAGStatus()
                throws java.lang.InterruptedException
Gets the animgen completion status, blocking if necessary for animgen completion to deliver this status value.

Throws:
java.lang.InterruptedException

framesAreAvailable

public boolean framesAreAvailable()
                           throws java.lang.InterruptedException
Determines if this animgen run has produced frames, blocking if necessary for animgen completion.

Throws:
java.lang.InterruptedException

getFrames

public CASFrame[] getFrames()
                     throws java.lang.InterruptedException
Returns the CAS frames produced by this animgen run, blocking if necessary for animgen completion.

Throws:
java.lang.InterruptedException

runAnimgen

public void runAnimgen()
                throws java.lang.InterruptedException
Throws:
java.lang.InterruptedException