Skip to main content



      Home
Home » Eclipse Projects » GEF » Has anyone implemented GlassPane functionality
Has anyone implemented GlassPane functionality [message #179596] Thu, 28 April 2005 16:27 Go to next message
Eclipse UserFriend
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 16: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 15:51 Go to previous message
Eclipse UserFriend
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: Wed Jul 23 13:38:31 EDT 2025

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

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

Back to the top