Skip to main content



      Home
Home » Modeling » Graphiti » Controlling selection of invisible rectangle
Controlling selection of invisible rectangle [message #1705334] Thu, 13 August 2015 15:56 Go to next message
Eclipse UserFriend
I use ICreateService.createInvisibleRectangle() to house shapes of my diagram and more specifically to put anchors on this rectangle. In doing so these rectangles become part of the diagram and thus can be selected. Is there a way to make them behave like regular rectangles but still be inactive? More specifically they participate in layout, but cannot be selected. If I set PE for this rectangle as inactive, then it does not participate in layout and thus my shapes are not positioned correctly.

http://s14.postimg.org/j5flnr9jz/channel.png

Perhaps I am not aware of some implementation that already exists. My end goal is to be able to put anchors where they appear now - relative to the outer shape, but I haven't found a way to do it without using invisible rectangles. If I set anchor's parent the immediate outer shape, then anchor cuts off when it's positioned at the center of the outer shape's border.

[Updated on: Thu, 13 August 2015 16:02] by Moderator

Re: Controlling selection of invisible rectangle [message #1705556 is a reply to message #1705334] Mon, 17 August 2015 09:20 Go to previous messageGo to next message
Eclipse UserFriend
Alex,

you can influence what is being makred as selected when you click on a
shape/graphics algorithm. Override getSelection in your tool behavior
provider and return the root rectangle (or whatever you like) when the user
clicks in the invible rectangle for the anchor.

Michael
Re: Controlling selection of invisible rectangle [message #1705599 is a reply to message #1705556] Mon, 17 August 2015 13:22 Go to previous message
Eclipse UserFriend
Thanks Michael, this works perfectly. I was even able to hide the label with context buttons by overriding setGenericContextButtons(...) method. Neat.

Regards,
Alex
Previous Topic:Creating a Pictogram link triggers refresh of entire diagram (bug?)
Next Topic:Multiple DomainObjects per Pictogram
Goto Forum:
  


Current Time: Sat Apr 19 04:24:41 EDT 2025

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

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

Back to the top