Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.gui > #5238
| Path | csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!news.swapon.de!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail |
|---|---|
| From | Jeff Higgins <jeff@invalid.invalid> |
| Newsgroups | comp.lang.java.gui |
| Subject | Re: How to grab pointer |
| Date | Wed, 15 Aug 2012 21:34:06 -0400 |
| Organization | A noiseless patient Spider |
| Lines | 64 |
| Message-ID | <k0hie8$gc2$1@dont-email.me> (permalink) |
| References | <6d596f35-fd58-4593-b40c-7cd54dbe23f1@googlegroups.com> <k0gs4r$8lc$1@dont-email.me> <cf249382-ad5a-4eda-b348-d4ca19ce93fb@googlegroups.com> <k0h0oh$bik$1@dont-email.me> <1b554d4b-ca3a-459d-993e-5225c479b277@googlegroups.com> <k0h570$83o$1@dont-email.me> <k0h6v7$i3n$1@dont-email.me> <k0hc93$ivi$1@dont-email.me> <k0hd3h$n0j$1@dont-email.me> <k0hdtd$qfq$1@dont-email.me> <k0hgbv$6mi$1@dont-email.me> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=ISO-8859-1; format=flowed |
| Content-Transfer-Encoding | 7bit |
| Injection-Date | Thu, 16 Aug 2012 01:29:44 +0000 (UTC) |
| Injection-Info | mx04.eternal-september.org; posting-host="6a6a291fa7e9c0bd872c1a9cbe2b371d"; logging-data="16770"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/9N2p+h+cT8zcd4BCS51kQY8OiUytWwe4=" |
| User-Agent | Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120726 Icedove/3.0.11 |
| In-Reply-To | <k0hgbv$6mi$1@dont-email.me> |
| Cancel-Lock | sha1:b+wSTyJjJdrdeM93yBbxlPNuo8c= |
| Xref | csiph.com comp.lang.java.gui:5238 |
Show key headers only | View raw
On 08/15/2012 08:58 PM, Jeff Higgins wrote: > On 08/15/2012 08:16 PM, Jeff Higgins wrote: >> On 08/15/2012 08:03 PM, Jeff Higgins wrote: >>> On 08/15/2012 07:48 PM, Jeff Higgins wrote: >>>> On 08/15/2012 06:18 PM, Jeff Higgins wrote: >>>>> On 08/15/2012 05:48 PM, Jeff Higgins wrote: >>>>>> On 08/15/2012 04:40 PM, FredK wrote: >>>>>>> >>>>>>> I generate a tree showing all of the GUI components of the app. I >>>>>>> want the user to be able to point to a component in the app, then >>>>>>> that item will be displayed as selected in the tree. So when the >>>>>>> user >>>>>>> presses the "Select" button, the cursor changes (say, to "hand"), my >>>>>>> comnponent grabs the mouse so only it gets events; >>>> >>>> There's really no such thing as "grabbing the mouse". Events are fired >>>> (put on the event queue) and consumed (how you do that is up to you). >>>> >>>> If your application has a mode of operation called >>>> componentSelectorToolActive and you want all of certain events to be >>>> processed by your ComponentSelectorTool then you will need to arrange >>>> that. >>>> >>>> then thye user >>>>>>> moves the cursor until is over some component anywhere on the >>>>>>> screen, >>>>>>> and clicks there. > > If this "component" is within your application containment hierarchies > fine, if you are thinking of some random visual item on your platform > desktop not associated with the AWT containment hierarchy you're out of > luck with the Java APIs. Also keep in mind that there is no central AWT Window Server that keeps track of and communicates with AWT clients like in the X windowing system. > >>>>>> >>>>>> Each top level window that your application creates will >>>>>> generate mousein/mouseout, focusin/focusout events. >>>>>> Whats the problem? >>>>>> >>>>> >>>>> You could even (and I just learned this, thanks) >>>>> Toolkit.getDefaultToolkit().addAWTEventListener(l); >>>>> plus >>>>> see Window.getWindows(). >>>>> >>>>>> My component receives the press event and figures >>>>>>> out what component it is over and highlights the tree node that >>>>>>> represents that component. I do not want the press event to be sent >>>>>>> to the component under the click. >>> You should probably be thinking in terms of "when my >>> ComponentSelectorTool receives the press event it notifies my >>> ComponentTreeDisplayWidget ...". >>> >> Just remember that events are placed on the queue in the order that >> they are received but that event listeners can be notified in any order. >> >> Hope it helps. over >> >
Back to comp.lang.java.gui | Previous | Next — Previous in thread | Next in thread | Find similar
How to grab pointer FredK <fred.l.kleinschmidt@gmail.com> - 2012-08-15 10:45 -0700
Re: How to grab pointer Knute Johnson <nospam@knutejohnson.com> - 2012-08-15 12:09 -0700
Re: How to grab pointer FredK <fred.l.kleinschmidt@gmail.com> - 2012-08-15 12:45 -0700
Re: How to grab pointer markspace <-@.> - 2012-08-15 13:28 -0700
Re: How to grab pointer FredK <fred.l.kleinschmidt@gmail.com> - 2012-08-15 13:40 -0700
Re: How to grab pointer markspace <-@.> - 2012-08-15 14:30 -0700
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 17:48 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 18:18 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 19:48 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 20:03 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 20:16 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 20:58 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-15 21:34 -0400
Re: How to grab pointer FredK <fred.l.kleinschmidt@gmail.com> - 2012-08-16 11:03 -0700
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-16 16:54 -0400
Re: How to grab pointer FredK <fred.l.kleinschmidt@gmail.com> - 2012-08-16 15:10 -0700
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-16 21:17 -0400
Re: How to grab pointer "John B. Matthews" <nospam@nospam.invalid> - 2012-08-16 20:40 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-16 21:11 -0400
Re: How to grab pointer Knute Johnson <nospam@knutejohnson.com> - 2012-08-15 15:05 -0700
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-22 19:54 -0400
Re: How to grab pointer Jeff Higgins <jeff@invalid.invalid> - 2012-08-22 20:45 -0400
csiph-web