j3d.org Code

org.j3d.renderer.java3d.overlay
Class MouseOverlay

java.lang.Object
  extended byorg.j3d.renderer.java3d.overlay.OverlayBase
      extended byorg.j3d.renderer.java3d.overlay.InteractiveOverlayBase
          extended byorg.j3d.renderer.java3d.overlay.MouseOverlay
All Implemented Interfaces:
java.awt.event.ComponentListener, java.util.EventListener, InteractiveOverlay, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, Overlay, ScreenComponent, UpdatableEntity
Direct Known Subclasses:
ImageButtonOverlay, ScribbleOverlay

public abstract class MouseOverlay
extends 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.1 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.renderer.java3d.overlay.OverlayBase
activeBuffer, backgroundColor, backgroundMode, bottomInset, canvas, componentSize, consoleBG, consoleTG, DEFAULT_INSET, DIRTY_ACTIVE_BUFFER, DIRTY_POSITION, DIRTY_SIZE, DIRTY_VISIBLE, fieldOfView, fixedSize, leftInset, overlayBounds, overlayTexGrp, rightInset, subOverlay, topInset
 
Fields inherited from interface org.j3d.renderer.java3d.overlay.Overlay
BACKGROUND_COPY, BACKGROUND_NONE
 
Constructor Summary
protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D, java.awt.Dimension size)
          Creates a new overlay covering the given canvas bounds.
protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D, java.awt.Dimension size, boolean clipAlpha, boolean blendAlpha)
          Constructs an overlay window that can have alpha capabilities.
protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D, java.awt.Dimension size, boolean clipAlpha, boolean blendAlpha, UpdateManager updateManager, boolean hasButtonEvents)
          Constructs an overlay window.
protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D, java.awt.Dimension size, boolean clipAlpha, boolean blendAlpha, UpdateManager updateManager, int numBuffers)
          Constructs an overlay window.
protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D, java.awt.Dimension size, UpdateManager updateManager)
          Constructs an overlay window with an update manager.
 
Method Summary
 void mouseClicked(java.awt.event.MouseEvent evt)
          Process a mouse click event.
 void mouseDragged(java.awt.event.MouseEvent evt)
          Process a mouse drag event
 void mouseEntered(java.awt.event.MouseEvent evt)
          Process a mouse enter event.
 void mouseExited(java.awt.event.MouseEvent evt)
          Process a mouse exited event.
 void mouseMoved(java.awt.event.MouseEvent evt)
          Process a mouse movement event.
 void mousePressed(java.awt.event.MouseEvent evt)
          Process a mouse press event.
 void mouseReleased(java.awt.event.MouseEvent evt)
          Process a mouse release event.
 
Methods inherited from class org.j3d.renderer.java3d.overlay.InteractiveOverlayBase
addKeyListener, addMouseListener, addMouseMotionListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, requestFocus, setInputRequester
 
Methods inherited from class org.j3d.renderer.java3d.overlay.OverlayBase
componentHidden, componentMoved, componentResized, componentShown, contains, dirty, getBackgroundImage, getBounds, getGraphics, getRoot, getUpdateManager, initialize, isAntialiased, isVisible, paint, repaint, setActiveBuffer, setAntialiased, setBackgroundColor, setBackgroundImage, setBackgroundMode, setComponentDetails, setInsets, setInsets, setLocation, setSize, setUpdateManager, setVisible, update, updateBuffer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.j3d.renderer.java3d.overlay.Overlay
contains, getBounds, getRoot, getUpdateManager, initialize, isAntialiased, isVisible, setAntialiased, setComponentDetails, setLocation, setSize, setUpdateManager, setVisible
 
Methods inherited from interface org.j3d.renderer.java3d.overlay.UpdatableEntity
update
 

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,
                       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 < 1

MouseOverlay

protected MouseOverlay(javax.media.j3d.Canvas3D canvas3D,
                       java.awt.Dimension size,
                       boolean clipAlpha,
                       boolean blendAlpha,
                       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 < 1
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,
                       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 < 1
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.

Specified by:
mousePressed in interface java.awt.event.MouseListener
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.

Specified by:
mouseReleased in interface java.awt.event.MouseListener
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.

Specified by:
mouseClicked in interface java.awt.event.MouseListener
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.

Specified by:
mouseEntered in interface java.awt.event.MouseListener
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.

Specified by:
mouseExited in interface java.awt.event.MouseListener
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

Specified by:
mouseDragged in interface java.awt.event.MouseMotionListener
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.

Specified by:
mouseMoved in interface java.awt.event.MouseMotionListener
Parameters:
evt - The event that caused this method to be called

j3d.org Code

Latest Info from http://code.j3d.org/
Copyright © 2001 - j3d.org