j3d.org Code

org.j3d.renderer.java3d.overlay
Class InteractiveTextureOverlay

java.lang.Object
  extended byorg.j3d.renderer.java3d.overlay.TextureOverlay
      extended byorg.j3d.renderer.java3d.overlay.InteractiveTextureOverlay
All Implemented Interfaces:
java.awt.event.ComponentListener, java.util.EventListener, InteractiveOverlay, Overlay, UpdatableEntity

public class InteractiveTextureOverlay
extends TextureOverlay
implements InteractiveOverlay

An texture overlay extension that allows input events to be captured.

This class extends the standard texture with the InteractiveOverlay interface so that it may handle mouse and keyboard information. Typically this would be used to place an image on screen like a map and then get the mouse feedback to put the user in that position.

Version:
$Revision: 1.1 $
Author:
Justin Couch

Field Summary
 
Fields inherited from class org.j3d.renderer.java3d.overlay.TextureOverlay
consoleBG, DIRTY_ACTIVE_BUFFER, DIRTY_POSITION, DIRTY_SIZE, DIRTY_VISIBLE
 
Fields inherited from interface org.j3d.renderer.java3d.overlay.Overlay
BACKGROUND_COPY, BACKGROUND_NONE
 
Constructor Summary
InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas, java.awt.Dimension size)
          Constructs an overlay window.
InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas, java.awt.Dimension size, boolean hasAlpha, UpdateManager updateManager, javax.media.j3d.Texture2D texture)
          Constructs an overlay window.
InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas, java.awt.Dimension size, javax.media.j3d.Texture2D texture)
          Constructs an overlay window.
 
Method Summary
 void addKeyListener(java.awt.event.KeyListener l)
          Request that the given listener enable key events being sent.
 void addMouseListener(java.awt.event.MouseListener l)
          Request that the given listener enable mouse events being sent.
 void addMouseMotionListener(java.awt.event.MouseMotionListener l)
          Request that the given listener enable mouse motion events being sent.
 void removeKeyListener(java.awt.event.KeyListener l)
          Request that the given listener disable key events being sent.
 void removeMouseListener(java.awt.event.MouseListener l)
          Request that the given listener disable mouse events being sent.
 void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
          Request that the given listener disable mouse motion events being sent.
 void requestFocus()
          Request that keyboard focus be sent to this listener object now.
 void setInputRequester(InputRequester req)
          Set the input requestor so that the overlay may manage when it requires input events.
 
Methods inherited from class org.j3d.renderer.java3d.overlay.TextureOverlay
componentHidden, componentMoved, componentResized, componentShown, contains, getBounds, getRoot, getUpdateManager, initialize, isAntialiased, isVisible, setAntialiased, setComponentDetails, setLocation, setSize, setTexture, setUpdateManager, setVisible, update
 
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

InteractiveTextureOverlay

public InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas,
                                 java.awt.Dimension size)
Constructs an overlay window. This window will not be visible unless it is added to the scene under the view platform transform If the bounds are null, then resize the overlay to fit the canvas and then track the size of the canvas.

Parameters:
canvas - The canvas the overlay is drawn on
size - The size of the overlay in pixels
Throws:
java.lang.IllegalArgumentException - Both the canvas and bounds are null

InteractiveTextureOverlay

public InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas,
                                 java.awt.Dimension size,
                                 javax.media.j3d.Texture2D texture)
Constructs an overlay window. This window will not be visible unless it is added to the scene under the view platform transform If the bounds are null, then resize the overlay to fit the canvas and then track the size of the canvas.

Parameters:
canvas - The canvas the overlay is drawn on
size - The size of the overlay in pixels
Throws:
java.lang.IllegalArgumentException - Both the canvas and bounds are null

InteractiveTextureOverlay

public InteractiveTextureOverlay(javax.media.j3d.Canvas3D canvas,
                                 java.awt.Dimension size,
                                 boolean hasAlpha,
                                 UpdateManager updateManager,
                                 javax.media.j3d.Texture2D texture)
Constructs an overlay window. This window will not be visible unless it is added to the scene under the view platform transform If the bounds are null, then resize the overlay to fit the canvas and then track the size of the canvas.

Parameters:
canvas - The canvas the overlay is drawn on
size - The size of the overlay in pixels
hasAlpha - True if the texture has an alpha component
updateManager - Responsible for allowing the Overlay to update between renders. If this is null a default manager is created
Throws:
java.lang.IllegalArgumentException - Both the canvas and bounds are null
Method Detail

setInputRequester

public void setInputRequester(InputRequester req)
Set the input requestor so that the overlay may manage when it requires input events. If the system is shutting down or the overlay is being removed, the parameter value may be null to clear a previously held instance.

Specified by:
setInputRequester in interface InteractiveOverlay
Parameters:
req - The requestor instance to use or null

requestFocus

public void requestFocus()
Request that keyboard focus be sent to this listener object now.


addMouseListener

public void addMouseListener(java.awt.event.MouseListener l)
Request that the given listener enable mouse events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

removeMouseListener

public void removeMouseListener(java.awt.event.MouseListener l)
Request that the given listener disable mouse events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

addMouseMotionListener

public void addMouseMotionListener(java.awt.event.MouseMotionListener l)
Request that the given listener enable mouse motion events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

removeMouseMotionListener

public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
Request that the given listener disable mouse motion events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

addKeyListener

public void addKeyListener(java.awt.event.KeyListener l)
Request that the given listener enable key events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

removeKeyListener

public void removeKeyListener(java.awt.event.KeyListener l)
Request that the given listener disable key events being sent. If the listener instance is null, this request is ignored.

Parameters:
l - The listener to manage events for

j3d.org Code

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