Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Has anyone implemented GlassPane functionality
Has anyone implemented GlassPane functionality [message #179596] Thu, 28 April 2005 20:27 Go to next message
Jim Adams is currently offline Jim AdamsFriend
Messages: 160
Registered: July 2009
Senior Member
In Swing I can create a GlassPane which is a transparent container that
stops mouse events. How can I do this in D2D? I tried creating a layer
that had nothing in it and putting mouse listeners on the layer. Since I
contained no child figures I never got a chance to handle the mouse
event. Next I put the listeners on the LayeredPane itself but it still
failed the hittest. I ended up adding a Figure to the Glass layer that
filled the whole layer but always returned true for the containsPoint()
method. This seems the supreme hack so I was hoping I did this wrong and
someone has the real solution.
Re: Has anyone implemented GlassPane functionality [message #179612 is a reply to message #179596] Thu, 28 April 2005 20:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.us.ibm.com

If you want to stop all mouse events from going to the child figures, why
not just override findMouseEventTargetAt(x,y), to always be the container.

Layers are transparent by default, meaning they will not return themselves
as the mouse target. You can also change this function by looking at what
they override.

"Jim Adams" <jim.adams@sas.com> wrote in message
news:d4rh6c$9n4$1@news.eclipse.org...
> In Swing I can create a GlassPane which is a transparent container that
> stops mouse events. How can I do this in D2D? I tried creating a layer
> that had nothing in it and putting mouse listeners on the layer. Since I
> contained no child figures I never got a chance to handle the mouse event.
> Next I put the listeners on the LayeredPane itself but it still failed the
> hittest. I ended up adding a Figure to the Glass layer that filled the
> whole layer but always returned true for the containsPoint() method. This
> seems the supreme hack so I was hoping I did this wrong and someone has
> the real solution.
Re: Has anyone implemented GlassPane functionality [message #180174 is a reply to message #179612] Tue, 03 May 2005 19:51 Go to previous message
Jim Adams is currently offline Jim AdamsFriend
Messages: 160
Registered: July 2009
Senior Member
I guess the point is that there is a Pane in Swing that is always
transparent but doesn't pass its events through. They can be handled at
that level. This is really the only way to allow dragging of nodes around.

Randy Hudson wrote:
> If you want to stop all mouse events from going to the child figures, why
> not just override findMouseEventTargetAt(x,y), to always be the container.
>
> Layers are transparent by default, meaning they will not return themselves
> as the mouse target. You can also change this function by looking at what
> they override.
>
> "Jim Adams" <jim.adams@sas.com> wrote in message
> news:d4rh6c$9n4$1@news.eclipse.org...
>
>>In Swing I can create a GlassPane which is a transparent container that
>>stops mouse events. How can I do this in D2D? I tried creating a layer
>>that had nothing in it and putting mouse listeners on the layer. Since I
>>contained no child figures I never got a chance to handle the mouse event.
>>Next I put the listeners on the LayeredPane itself but it still failed the
>>hittest. I ended up adding a Figure to the Glass layer that filled the
>>whole layer but always returned true for the containsPoint() method. This
>>seems the supreme hack so I was hoping I did this wrong and someone has
>>the real solution.
>
>
>
Previous Topic:Connections and Anchors
Next Topic:Glasspane
Goto Forum:
  


Current Time: Fri Apr 19 22:42:18 GMT 2024

Powered by FUDForum. Page generated in 0.03388 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top