Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » "Click through" an unfilled RoundedRectangle
"Click through" an unfilled RoundedRectangle [message #1070795] Thu, 18 July 2013 17:35 Go to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi all,

I have a ContainerShape for which I create an unfilled RoundedRectangle. This is used to group other shapes together visually such that when the group shape is moved, any shapes that are completely contained by the group shape are moved along with it. I've also arranged to always keep the group shape at the top of the Z-order so that it can't be obscured by any other shapes (a requirement).

The move feature works, but now I'm unable to "click through" the group shape to any of the contained shapes. Also, the mouse hit test does not find any of the contained shapes because the group shape is the first one it finds, thus none of the context buttons appear for the contained shapes. Is there a way to do this without having to create a PolyLine instead of a RoundedRectangle? Ideally what I'd like is to have the group shape pass all mouse hits down to contained shapes, but not down to the Diagram.

Thanks in advance,
Bob
Re: "Click through" an unfilled RoundedRectangle [message #1070810 is a reply to message #1070795] Thu, 18 July 2013 18:16 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Uhh...never mind, I think I've found the answer:
I just need to implement my own getSelection() in my Tool Behavior Provider - duh Embarrassed

[Updated on: Thu, 18 July 2013 18:21]

Report message to a moderator

Re: "Click through" an unfilled RoundedRectangle [message #1070840 is a reply to message #1070810] Thu, 18 July 2013 20:01 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

OK, this is working Smile but there's one little problem remaining:

The ContextButtonManagerForPad does not do the same translation as the ShapeEditPart does in its getTargetEditPart() method, so the context button pad being displayed is always the one for the group shape, not the contained shapes.

Is it possible to add a call to DefaultToolBehaviorProvider.getSelection() in ContextButtonManagerForPad.showContextButtonsInstantly() (or somewhere in that "mouse entered" listener call chain)?

Please let me know if I should create an enhancement request BZ.

Thanks,
Bob
Re: "Click through" an unfilled RoundedRectangle [message #1073275 is a reply to message #1070840] Wed, 24 July 2013 12:53 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Bob,

you chose a rather unusual way to solve the click-through-issue. I would
recommend to not do it by placing the container shape on top of the inner
shapes, but by making the inner shapes not movable (by disabling the move
feature for them). Then you should not run into the other issues...

Michael
Re: "Click through" an unfilled RoundedRectangle [message #1073710 is a reply to message #1073275] Thu, 25 July 2013 10:46 Go to previous message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Michael,

Thanks for the hint, but I need to be able to move the inner shapes into and out of the Group shape so disabling their Move Feature is not an option. I've also run into a couple of other problems with this solution, unrelated to Graphiti.

I finally decided to use a Polyline GA for the Group shape and changed its Move Feature to adjust the locations of the contained shapes in postMove() by invoking their Move Features.

Bob
Previous Topic:Code Generation for Graphiti
Next Topic:How to gracefully cancel a transaction?
Goto Forum:
  


Current Time: Thu Mar 28 14:30:29 GMT 2024

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

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

Back to the top