I believe my 2D Overlay solution will work for your situation, although I didn't have 
time to look at your code.

I think by setting the OverlayPanel as the GlassPane of the parent JFrame (see 
setGlassPane), then setting the OverlayPanel visible, the OverlayPanel will intercept 
the mouse behaviors (don't forget to add the OverlayPanel as a mouse listener to the 
JFrame). (Look at the Java Sun Tutorials on Containers/GlassPanes/etc for more 
information about GlassPanes.) The OverlayGraphics is passed into the OverlayCanvas3D 
to display the 2D graphics (in my solution, the OverlayGraphics and OverlayPanel are 
one class) by drawing into the J3DGraphics2D context in the postRender method.

Let me know if this works for you or if you have any more questions.

Sean



> -----Original Message-----
> From: Ian Nieves [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 13, 2002 10:42 AM
> To: [EMAIL PROTECTED]
> Subject: Re: [JAVA3D] New 2D Overlay Approach
> 
> 
> Bob,
> 
> 
> > As for the problem...  Are you simply looking to
> > re-dispatch the event from the canvas to the overlay
> > panel, and then re-dispatch again to the canvas if the
> > panel doesn't make use of it?
> Yes!  This is essentially what I am trying to do.  I am using
> "dispatch(overlayPanel)", but my overlay panel doesnt seem to 
> forward those
> events to things such as scrollbars.  So I can intercept all 
> the events
> that I would like, but I dont know what to do with them.
> 
> > If you want to share the code early I'd be happy to
> > help try to figure it out (assuming the gurus on this
> > list don't have the answer for you already).
> I would really REALLY appreciate your help.  I havent heard back from
> anyone else yet, though I know lots of people would like this code.
> 
> I have attached the 3 critical files.  (you will need to change their
> package based on where you put them in your project)
> 
> 1) OverlayGraphics
> You should not need to play with this.  The other 2 files 
> simply need to
> know where it is.  It is essentially a graphics context, that 
> can safely be
> replicated via create(), that forwards all legal graphics 
> operations on it
> to its J3DGraphics3D reference.
> 
> 2) OverlayPanel
> This is where you add your components you want to be 
> overlayed.  Use it as
> any other JPanel.  If using forte/netbeans, you can layout a regular
> JPanel, but then instruct the IDE to initialize the object as an
> OverlayPanel.  This is the Custom Creation Code field in the Code
> Generation tab of the component inspector.  For simplicity 
> sake, make sure
> your overlayPanel is within your OverlayCanvas3D (see below).
> 
> 3) OverlayCanvas3D
> Use this as you would your normal Canvas3D.  It needs a 
> reference to your
> OverlayPanel.e
> 
> What I did was add an Overlay Panel to a JFrame with an 
> AbsoluteLayout.  I
> also added a regular JPanel to the JFrame with an Absolute 
> Layout.  I then
> added my OverlayCanvas3D to the regular JPanel.
> 
> I think that the code that needs to be played with is the 
> commented out
> section of the OverlayCanvas3D.  I dont know how to take 
> those events and
> then get them to the OverlayPanel such that whatever is in 
> the OverlayPanel
> can deal with them.
> 
> Please let me know if you have any questions or issues!
> I hope you can help! :)
> 
> Sincerely,
> Ian Nieves
> 

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