org.j3d.geom.overlay
Class MouseOverlay

public abstract class MouseOverlay
extends org.j3d.geom.overlay.InteractiveOverlayBase
implements java.awt.event.MouseListener, java.awt.event.MouseMotionListener
An overlay that is used like an ordinary drawing canvas that interacts with the mouse.

The class does not automatically register itself for mouse input. That is up to the derived class to make sure it properly registers itself for the right events.

Note: This class does not call the repaint() method after each mouse event. It is the responsibility of the derived class to make sure the screen gets updated with any information regarding the mouse event.

Version:
$Revision: 1.4 $
Author:
Justin Couch
Constructor Detail

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size)
Creates a new overlay covering the given canvas bounds. It has two buffers. Updates are managed automatically. This Overlay is not usable until you attach it to the view platform transform.
Parameters:
canvas3D - Canvas being drawn onto
size - The size of the overlay in pixels

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size,
                       org.j3d.geom.overlay.UpdateManager updateManager)
Constructs an overlay window with an update manager. It has two buffers. This window will not be visible unless it is added to the scene under the view platform transform.
Parameters:
canvas3D - The canvas the overlay is drawn on
size - The size of the overlay in pixels
updateManager - Responsible for allowing the Overlay to update between renders. If this is null a default manager is created

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size,
                       boolean clipAlpha,
                       boolean blendAlpha)
Constructs an overlay window that can have alpha capabilities. This window will not be visible unless it is added to the scene under the view platform transform.
Parameters:
canvas3D - The canvas the overlay is drawn on
size - The size of the overlay in pixels
clipAlpha - Should the polygon clip where alpha is zero
blendAlpha - Should we blend to background where alpha is <
hasButtonEvents - true to recieve mouse button events
hasMotionEvents - true to recieve mouse motion events
processAll - true to process all events from the behaviour, or false to use just the last one

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size,
                       boolean clipAlpha,
                       boolean blendAlpha,
                       org.j3d.geom.overlay.UpdateManager updateManager,
                       boolean hasButtonEvents)
Constructs an overlay window. This window will not be visible unless it is added to the scene under the view platform transform
Parameters:
canvas3D - The canvas the overlay is drawn on
size - The size of the overlay in pixels
clipAlpha - Should the polygon clip where alpha is zero
blendAlpha - Should we blend to background where alpha is <
updateManager - Responsible for allowing the Overlay to update between renders. If this is null a default manager is created

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size,
                       boolean clipAlpha,
                       boolean blendAlpha,
                       org.j3d.geom.overlay.UpdateManager updateManager,
                       int numBuffers)
Constructs an overlay window. This window will not be visible unless it is added to the scene under the view platform transform
Parameters:
canvas3D - The canvas the overlay is drawn on
size - The size of the overlay in pixels
clipAlpha - Should the polygon clip where alpha is zero
blendAlpha - Should we blend to background where alpha is <
updateManager - Responsible for allowing the Overlay to update between renders. If this is null a default manager is created
numBuffers - The number of buffers to generate, the default is two

Method Detail

mousePressed

public void mousePressed(java.awt.event.MouseEvent evt)
Process a mouse press event.
Parameters:
evt - The event that caused this method to be called

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent evt)
Process a mouse release event.
Parameters:
evt - The event that caused this method to be called

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent evt)
Process a mouse click event.
Parameters:
evt - The event that caused this method to be called

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent evt)
Process a mouse enter event.
Parameters:
evt - The event that caused this method to be called

mouseExited

public void mouseExited(java.awt.event.MouseEvent evt)
Process a mouse exited event.
Parameters:
evt - The event that caused this method to be called

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent evt)
Process a mouse drag event
Parameters:
evt - The event that caused this method to be called

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent evt)
Process a mouse movement event.
Parameters:
evt - The event that caused this method to be called