Just another idea :

- Create your own MouseBehavior to get acces to buttonPress and wakeUp
variables. (the same code as MouseBehavior). This step is not necessary if your
MouseXXXBehavior is in the package com.sun.j3d.utils.behaviors.mouse.

- Overwrite processMouseEvent in your own MouseXXXBehaviors  (the rest the same)

Example:

public class MyMouseRotate extends MyMouseBehavior {
// or extends MouseRotate if the code is in the package
com.sun.j3d.utils.behaviors.mouse

    Canvas3D canvas;

    public MyMouseRotate(Canvas3D canvas, TransformGroup tg) {
        super(tg);
        this.canvas = canvas;
    }

    public void processMouseEvent(MouseEvent evt) {
        if (evt.getComponent() != canvas) {
            buttonPress = false;
            wakeUp = false;
            return;
        }
        :
        : // the same code
    }
}


regards,
Daniel del Rio

> Thanks Scott , that's what I did.
>
>  -----Mensagem original-----
> De:     Decker, Scott D [mailto:[EMAIL PROTECTED]]
> Enviada:        Terça-feira, 8 de Fevereiro de 2000 16:07
> Para:   [EMAIL PROTECTED]
> Assunto:        Re: [JAVA3D] Multiple Views / Behaviors ??? - EXAMPLE
>
> I posted something about this about a month ago.
> Since all of your viewplatforms and views are part of the same scenegraph,
> when
> you use the
> mouseBehaviors from SUN, they will capture for that scenegraph.
> You will notice that in the Behaviors, they capture a AWTEvent.  Well, since
> your moving your
> mouse on one canvas, that creates a MouseEvent.  That MouseEvent gets sent
> to
> the behavior scheduler, that is then sent to all behaviors that are
> listening
> for that scene graph. Or, in your case, all of your mouse behaviors.
>
> Again, this is considered more of a feature.  Let us say that you have a
> front,side, and rear view for your avatar. Moving in any of the canvases
> could
> move your view. Kind of cool.
>
> I posted how you could fix this in my stuff last month, but here it is
> again.
> Create your own mouseListener for each Canvas.
> Create a Behavior that you can wake up manually.
> for each canvas, you trap mouse movement.
> once that mouse movement is trapped, you send it to your manual behavior
> wakeup
> so that you can do your transforms within frame refreshes.
>
> Scott
>
> Scott Decker
> Research Scientist
> Pacific Northwest National Labs
> [EMAIL PROTECTED]
> please feed the squirrels
>
> ===========================================================================
> 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".
>
> ===========================================================================
> 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".

===========================================================================
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