jarp
Class View

java.lang.Object
  extended by jarp.View
All Implemented Interfaces:
java.util.EventListener, javax.media.opengl.GLEventListener

public class View
extends java.lang.Object
implements javax.media.opengl.GLEventListener

Top-level Java ARP avatar view class -- each instance of this class maintains its own GLCanvas for which it acts as the GLEventListener


Field Summary
static int CAM_NONE
           
static int CAM_PANNING
           
static int CAM_PANNING_H
           
static int CAM_PANNING_V
           
static int CAM_ROTATING
           
static int CAM_ZOOMING
           
 
Constructor Summary
View(AvatarEventHandler aehdlr, JAOptions jopts, JACanvasEmbedder embedder)
          Constructor -- creates the GLCanvas, but defers the rest of the work until the init() event.
 
Method Summary
 void display(javax.media.opengl.GLAutoDrawable gld)
          JOGL EventListener method: renders the current state of this avatar view's character onto its GLCanvas -- which is identical to the given drawable.
 void displayChanged(javax.media.opengl.GLAutoDrawable drawable, boolean modeChanged, boolean deviceChanged)
          JOGL EventListener method: accepts notification of the given changes to the characteristics of the display supporting this avatar view's OpenGL canvas.
 void getCamClipPlanes(float[] clipnf)
           
 void getCamFacing(float[] facexyz)
           
 float getCamFOV()
           
 void getCamLocation(float[] locxyz)
           
 void getCamUp(float[] upxyz)
           
 void init(javax.media.opengl.GLAutoDrawable gld)
          JOGL EventListener method: initialises the newly established GL drawing context for this avatar view.
 void onLeftMouseDown(int x, int y)
           
 void onMouseMove(int x, int y)
           
 void onMouseUp()
           
 void onRightMouseDown(int x, int y)
           
 void playOneFrame(CASFrame FRAME, int F)
          Generates and plays one frame, often but not necessarily as part of an animation sequence, given the frame data and its index number.
 void playOneFrame(CASFrame FRAME, int F, float SPEED_UP, boolean T_DISPLAY)
          Generates and plays one frame, often but not necessarily as part of an animation sequence, given the frame data, its index number, the current speed-up factor (for use in performance statistics collection), with running performance data logging output controlled by the given flag.
 void requestSwitchAvatar(java.lang.String avatar, java.lang.String nonstddef)
          Requests that this view initiates a switch to the use of the given avatar, by loading its definition from its standard location, or using the given non-standard file if that argument is non-null; the avatar itself maybe null, which is interpreted as a request to unload the current avatar (in which case the second argument is ignored).
 void reshape(javax.media.opengl.GLAutoDrawable gld, int x, int y, int w, int h)
          JOGL EventListener method: accepts notification of the given changes to the location and/or dimensions of this avatar view's OpenGL canvas.
 void saveAvatarIfRequested()
          Checks whether the conditions for the saving of a newly loaded avatar definition or of its texture are satisifed, and if so performs the appropriate save operations.
 void setCamClipPlanes(float znear, float zfar)
           
 void setCamExternal(javax.swing.event.MouseInputListener extmil)
           
 void setCamFacing(float[] facingxyz)
           
 void setCamFacing(float x, float y, float z)
           
 void setCamFOV(float fov)
           
 void setCamInternal()
           
 void setCamLocation(float[] locxyz)
           
 void setCamLocation(float x, float y, float z)
           
 void setCamUp(float[] upxyz)
           
 void setCamUp(float x, float y, float z)
           
 void setPlayerStats(JAPlayerStats ps)
          Sets the player performance statistics gatherer for this avatar view.
 void setRenderMode(int mode)
           
 void startAnimation()
          Registers the start of a new animation, that is, the performance of a sequence of (frame generation and) frame display operations.
 void stopAnimation()
          Registers the completion of an animation sequence.
 void terminateView()
          Performs final termination for this avatar view, assuming that an earlier call has been made to #terminateViewDisplay().
 ThreadCompletionChecker terminateViewDisplay()
          Terminates the display for this avatar view, and returns the completion checker for this view's display scheduler thread.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CAM_NONE

public static final int CAM_NONE
See Also:
Constant Field Values

CAM_ROTATING

public static final int CAM_ROTATING
See Also:
Constant Field Values

CAM_ZOOMING

public static final int CAM_ZOOMING
See Also:
Constant Field Values

CAM_PANNING

public static final int CAM_PANNING
See Also:
Constant Field Values

CAM_PANNING_V

public static final int CAM_PANNING_V
See Also:
Constant Field Values

CAM_PANNING_H

public static final int CAM_PANNING_H
See Also:
Constant Field Values
Constructor Detail

View

public View(AvatarEventHandler aehdlr,
            JAOptions jopts,
            JACanvasEmbedder embedder)
Constructor -- creates the GLCanvas, but defers the rest of the work until the init() event.

Method Detail

terminateViewDisplay

public ThreadCompletionChecker terminateViewDisplay()
Terminates the display for this avatar view, and returns the completion checker for this view's display scheduler thread.


terminateView

public void terminateView()
Performs final termination for this avatar view, assuming that an earlier call has been made to #terminateViewDisplay().


requestSwitchAvatar

public void requestSwitchAvatar(java.lang.String avatar,
                                java.lang.String nonstddef)
Requests that this view initiates a switch to the use of the given avatar, by loading its definition from its standard location, or using the given non-standard file if that argument is non-null; the avatar itself maybe null, which is interpreted as a request to unload the current avatar (in which case the second argument is ignored).


init

public void init(javax.media.opengl.GLAutoDrawable gld)
JOGL EventListener method: initialises the newly established GL drawing context for this avatar view.

Specified by:
init in interface javax.media.opengl.GLEventListener

display

public void display(javax.media.opengl.GLAutoDrawable gld)
JOGL EventListener method: renders the current state of this avatar view's character onto its GLCanvas -- which is identical to the given drawable.

Specified by:
display in interface javax.media.opengl.GLEventListener

reshape

public void reshape(javax.media.opengl.GLAutoDrawable gld,
                    int x,
                    int y,
                    int w,
                    int h)
JOGL EventListener method: accepts notification of the given changes to the location and/or dimensions of this avatar view's OpenGL canvas.

Specified by:
reshape in interface javax.media.opengl.GLEventListener

displayChanged

public void displayChanged(javax.media.opengl.GLAutoDrawable drawable,
                           boolean modeChanged,
                           boolean deviceChanged)
JOGL EventListener method: accepts notification of the given changes to the characteristics of the display supporting this avatar view's OpenGL canvas.

Specified by:
displayChanged in interface javax.media.opengl.GLEventListener

setRenderMode

public void setRenderMode(int mode)

saveAvatarIfRequested

public void saveAvatarIfRequested()
Checks whether the conditions for the saving of a newly loaded avatar definition or of its texture are satisifed, and if so performs the appropriate save operations.


setPlayerStats

public void setPlayerStats(JAPlayerStats ps)
Sets the player performance statistics gatherer for this avatar view.


startAnimation

public void startAnimation()
Registers the start of a new animation, that is, the performance of a sequence of (frame generation and) frame display operations.


stopAnimation

public void stopAnimation()
Registers the completion of an animation sequence.


playOneFrame

public void playOneFrame(CASFrame FRAME,
                         int F)
                  throws java.lang.InterruptedException,
                         JAException
Generates and plays one frame, often but not necessarily as part of an animation sequence, given the frame data and its index number.

Throws:
java.lang.InterruptedException
JAException

playOneFrame

public void playOneFrame(CASFrame FRAME,
                         int F,
                         float SPEED_UP,
                         boolean T_DISPLAY)
                  throws java.lang.InterruptedException,
                         JAException
Generates and plays one frame, often but not necessarily as part of an animation sequence, given the frame data, its index number, the current speed-up factor (for use in performance statistics collection), with running performance data logging output controlled by the given flag.

Throws:
java.lang.InterruptedException
JAException

setCamInternal

public void setCamInternal()

setCamExternal

public void setCamExternal(javax.swing.event.MouseInputListener extmil)

onLeftMouseDown

public void onLeftMouseDown(int x,
                            int y)

onRightMouseDown

public void onRightMouseDown(int x,
                             int y)

onMouseMove

public void onMouseMove(int x,
                        int y)

onMouseUp

public void onMouseUp()

setCamLocation

public void setCamLocation(float[] locxyz)

setCamLocation

public void setCamLocation(float x,
                           float y,
                           float z)

setCamFacing

public void setCamFacing(float[] facingxyz)

setCamFacing

public void setCamFacing(float x,
                         float y,
                         float z)

setCamUp

public void setCamUp(float[] upxyz)

setCamUp

public void setCamUp(float x,
                     float y,
                     float z)

setCamClipPlanes

public void setCamClipPlanes(float znear,
                             float zfar)

setCamFOV

public void setCamFOV(float fov)

getCamLocation

public void getCamLocation(float[] locxyz)

getCamFacing

public void getCamFacing(float[] facexyz)

getCamUp

public void getCamUp(float[] upxyz)

getCamClipPlanes

public void getCamClipPlanes(float[] clipnf)

getCamFOV

public float getCamFOV()