Rob Bosman wrote:

Hi all,

I have a question: does class WakeupOnAWTEvent support event id java.awt.event.MouseEvent.MOUSE_WHEEL?

I created a simple MouseWheelBehavior class and added it both as a Behavior and as a EventListener, like this:

MouseWheelBehavior mouseWheelBehavior = new MouseWheelBehavior();
mouseWheelBehavior.setSchedulingBounds(
  new BoundingSphere( new Point3d(), 1000.0 ) );
objRoot.addChild( mouseWheelBehavior );
canvas3D.addMouseWheelListener( mouseWheelBehavior );

Here is the class definition:

public class MouseWheelBehavior extends Behavior
  implements MouseWheelListener
{
  private WakeupCriterion mouseWheelCriterion
    = new WakeupOnAWTEvent( MouseEvent.MOUSE_WHEEL );
  public void initialize()
  {
    wakeupOn( mouseWheelCriterion );
  }
  public void processStimulus( Enumeration criteria )
  {
    System.out.println( "MouseWheelBehavior.processStimulus()" );
    wakeupOn( mouseWheelCriterion );
  }
  public void mouseWheelMoved( MouseWheelEvent aMouseWheelEvent )
  {
    System.out.println( "MouseWheelBehavior.mouseWheelMoved()" );
  }
}

My problem is that only the mouseWheelMoved() method is called on mouse wheel events, while I expected processStimulus() to be invoked too.
After changing MouseEvent.MOUSE_WHEEL into MouseEvent.MOUSE_MOVED the method processStimulus() is invoked correctly when moving the mouse over the Canvas3D.

I use JDK 1.4.1_02 and Java3D 1.3.1-beta (OpenGL) SDK.
Any clue?


This is bug 4783638 - WakeupOnAWTEvent does not support MouseWheelEvent

- Kelvin
-----------
Java 3D Team
Sun Microsystems Inc.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to