app
Class SiGMLPlayerApplet

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by java.awt.Panel
              extended by java.applet.Applet
                  extended by app.SiGMLPlayerApplet
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class SiGMLPlayerApplet
extends java.applet.Applet

An SiGMLPlayerApplet is a simple signed animation player applet which communicates with enclosing HTML/javascript using the LiveConnect protocol defined by Netscape/Mozilla.

This class assumes that the following Javascript event-handler method calls are supported:

     spaSetSiGMLPlayerApplet([SiGMLPlayerApplet] spa);
       // spa is the present applet instance, whose identity is
       // communicated to the Javascript/LiveConnect host by
       // this call, which should be made during the applet's
       // init() sequence.
       // This method is needed to support Google Chrome, whose
       // LiveConnect implementation seems to perform more rigorous
       // integrity checks on Javascript-to-Java calls than those
       // of other browsers.

     spaFramesGenEvent([String] ekind, [int] f, [int] s);
       // ekind is one of the event kind tags:
       //    "LOAD_FRAMES_START",
       //    "LOADED_NEXT_SIGN",
       //    "LOAD_FRAMES_DONE_OK",
       //    "LOAD_FRAMES_DONE_BAD"
       // f, s, when supplied, are frame and sign counts/indices.
 
     spaAnimationEvent(
         [String] ekind, [int] f, [int] s, [String] gloss);
       // ekind is one of the event kind tags:
       //    "PLAY_FRAME",
       //    "SKIP_FRAME",
       //    "PLAY_FIRST_FRAME_OF_SIGN",
       //    "SKIP_FIRST_FRAME_OF_SIGN",
       //    "PLAY_DONE"
       // f, s, when supplied, are frame and sign counts/indices;
       // gloss, when supplied, is the gloss name for a new sign.
 
     spaAvatarEvent([String] ekind, [String] avname);
       // ekind is one of the event kind tags:
       //    "AVATAR_LOADED_OK",
       //    "AVATAR_LOAD_FAILED",
       //    "AVATAR_UNLOADED"
       // avname, when supplied, is the name of the avatar in question.
 

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SiGMLPlayerApplet()
          Constructs a new instance of this applet.
 
Method Summary
 java.lang.String appendToSiGMLPipe(java.lang.String fragment)
          Accepts a request for the given SiGML fragment to be appended to the current piped SiGML input for this player.
 java.lang.String closeSiGMLPipe()
          Accepts a request to close the current piped SiGML input session for this player.
 void destroy()
          Applet destroy method -- a no-op in this case.
 jautil.JAOptions getOpts()
           
 void init()
          Initialises this player applet.
 java.lang.String playSiGMLText(java.lang.String sigml)
          Accepts a new SiGML string to be played by this player.
 java.lang.String playSiGMLURL(java.lang.String url)
          Accepts a new SiGML URL to be played by this player.
 java.lang.String setAnimgenFPS(java.lang.String fpsstr)
          Allows HTML/Javascript to change the speed at which the current animation is played, as the player is running
 java.lang.String setAvatar(java.lang.String avatar)
          Allows HTML/Javascript to request a particular avatar.
 java.lang.String setDoLogDroppedFrames(java.lang.String dldfstr)
          Allows HTML/Javascript to set/unset the avatar panel's "player.do.log.dropped.frames" flag option setting.
 java.lang.String setSpeed(java.lang.String speedupstr)
          Allows HTML/Javascript to change the speed at which the current animation is played, as the player is running
 void start()
          Applet start method.
 java.lang.String startPlaySiGMLPiped()
          Accepts a request for a new piped SiGML input session for this player.
 void stop()
          Applet stop method.
 java.lang.String stopPlayingSiGML()
          Accepts a stop-player request.
 void switchLogEnabled(java.lang.String enableflag)
           
 void terminate()
          Applet unload method: posts a shut-down event to the player thread, and waits for this to take effect.
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAppletInfo, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, getParameterInfo, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, setLayout, transferFocusBackward, transferFocusDownCycle, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SiGMLPlayerApplet

public SiGMLPlayerApplet()
Constructs a new instance of this applet.

Method Detail

getOpts

public jautil.JAOptions getOpts()

init

public void init()
Initialises this player applet.

Overrides:
init in class java.applet.Applet

start

public void start()
Applet start method.

Overrides:
start in class java.applet.Applet

stop

public void stop()
Applet stop method.

Overrides:
stop in class java.applet.Applet

destroy

public void destroy()
Applet destroy method -- a no-op in this case.

Overrides:
destroy in class java.applet.Applet

terminate

public void terminate()
Applet unload method: posts a shut-down event to the player thread, and waits for this to take effect.


playSiGMLURL

public java.lang.String playSiGMLURL(java.lang.String url)
Accepts a new SiGML URL to be played by this player.


playSiGMLText

public java.lang.String playSiGMLText(java.lang.String sigml)
Accepts a new SiGML string to be played by this player.

Returns:
undefined/null if successful; the error description otherwise.

startPlaySiGMLPiped

public java.lang.String startPlaySiGMLPiped()
Accepts a request for a new piped SiGML input session for this player.

Returns:
undefined/null if successful; the error description otherwise.

appendToSiGMLPipe

public java.lang.String appendToSiGMLPipe(java.lang.String fragment)
Accepts a request for the given SiGML fragment to be appended to the current piped SiGML input for this player.

Returns:
undefined/null if successful; the error description otherwise.

closeSiGMLPipe

public java.lang.String closeSiGMLPipe()
Accepts a request to close the current piped SiGML input session for this player.

Returns:
undefined/null if successful; the error description otherwise.

stopPlayingSiGML

public java.lang.String stopPlayingSiGML()
Accepts a stop-player request.

Returns:
undefined/null if successful; the error description otherwise.

setAvatar

public java.lang.String setAvatar(java.lang.String avatar)
Allows HTML/Javascript to request a particular avatar.

Returns:
undefined/null if successful -- the expected outcome for this method, since the request is handled asynchronously; the error description otherwise.

setSpeed

public java.lang.String setSpeed(java.lang.String speedupstr)
Allows HTML/Javascript to change the speed at which the current animation is played, as the player is running

Returns:
undefined/null if successful; the error description otherwise.

setAnimgenFPS

public java.lang.String setAnimgenFPS(java.lang.String fpsstr)
Allows HTML/Javascript to change the speed at which the current animation is played, as the player is running

Returns:
undefined/null if successful; the error description otherwise.

setDoLogDroppedFrames

public java.lang.String setDoLogDroppedFrames(java.lang.String dldfstr)
Allows HTML/Javascript to set/unset the avatar panel's "player.do.log.dropped.frames" flag option setting.

Returns:
undefined/null if successful; the error description otherwise.

switchLogEnabled

public void switchLogEnabled(java.lang.String enableflag)