Hi Ian, I've done some work redispatching events. The process is fuzzy to me now but I remember that it worked for most mouse events. MouseEnter, MouseExit and MouseMoved were harder to deal with because you are relying on the "front" component to generate the event but its bounds don't necessarily match the bounds of the component to which you want to send the event. I remember fiddling with MouseMoved in an effort to calculate when a MouseExited or MouseEntered event should be triggered but there was something buggy or unreliable in this approach. Anyway, here is a link to the page in the Java Tutorial that set me on the correct footing.
http://java.sun.com/docs/books/tutorial/uiswing/components/rootpane.html -Raffi -----Original Message----- From: Ian Nieves [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 13, 2002 12:42 PM 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".
