iicm.vrml.vrwave
Class SceneCanvas

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--iicm.ge3d.OGLCanvas
                    |
                    +--iicm.vrml.vrwave.SceneCanvas

public class SceneCanvas
extends OGLCanvas
implements java.awt.event.MouseMotionListener, java.awt.event.MouseListener, java.awt.event.KeyListener

SceneCanvas - Canvas for the Scene. Copyright 1998 IICM, Graz University of Technology.

See Also:
Serialized Form

Fields inherited from class iicm.ge3d.OGLCanvas
cheight, cwidth, loadedlib, mesa_backbuf, verbose
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
SceneCanvas(java.lang.String title, Scene s, SceneFrame frame)
          constructor: window title, scene
 
Method Summary
 void keyPressed(java.awt.event.KeyEvent e)
          key stroke (down)
 void keyReleased(java.awt.event.KeyEvent evt)
           
 void keyTyped(java.awt.event.KeyEvent evt)
           
 void mouseDragged(java.awt.event.MouseEvent e)
          Handles the mouse drag event.
 void mouseEntered(java.awt.event.MouseEvent e)
          request keyboard focus when mouse enters window
 void mouseMoved(java.awt.event.MouseEvent e)
          looks for interaction-capable objects if mouse is over
 void mousePressed(java.awt.event.MouseEvent e)
          Handles the mouse button pressed down event.
 void mouseReleased(java.awt.event.MouseEvent e)
          Handles the mouse button up event.
 void paint(java.awt.Graphics gc)
          draw the scene (paint sounds too slow :-)
 void reset()
          reset state on loading a new scene
 void setViewpoints(java.util.Vector vp)
           
 void updateCanvas()
          repaint the canvas
 
Methods inherited from class iicm.ge3d.OGLCanvas
hasContext, minimumSize, mouseClicked, mouseExited, preferredSize, setContext, swapBuffers, update
 
Methods inherited from class java.awt.Canvas
addNotify
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SceneCanvas

public SceneCanvas(java.lang.String title,
                   Scene s,
                   SceneFrame frame)
constructor: window title, scene
Method Detail

reset

public void reset()
reset state on loading a new scene

paint

public void paint(java.awt.Graphics gc)
draw the scene (paint sounds too slow :-)
Overrides:
paint in class OGLCanvas

updateCanvas

public void updateCanvas()
repaint the canvas

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
looks for interaction-capable objects if mouse is over
Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
e - the event

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
request keyboard focus when mouse enters window
Specified by:
mouseEntered in interface java.awt.event.MouseListener
Overrides:
mouseEntered in class OGLCanvas
Parameters:
e - the event

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Handles the mouse button pressed down event.
Specified by:
mousePressed in interface java.awt.event.MouseListener
Overrides:
mousePressed in class OGLCanvas
Parameters:
e - the event

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
Handles the mouse drag event. This means to do the camera operations.
Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
Parameters:
e - the event

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Handles the mouse button up event. If interaction mode is enabled the drawing mode will be reseted to the current drawing mode. If the mouse click was a normal (i.e. without drag) one, the picking-algorithm searches for the picked 3D object. if one is found it displays the name of the document and highlights the edges of the bounding box of the 3d object. selected document .
Specified by:
mouseReleased in interface java.awt.event.MouseListener
Overrides:
mouseReleased in class OGLCanvas
Parameters:
e - the event

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
key stroke (down)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent evt)
Specified by:
keyTyped in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent evt)
Specified by:
keyReleased in interface java.awt.event.KeyListener

setViewpoints

public void setViewpoints(java.util.Vector vp)