Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Controlling selection of invisible rectangle
Controlling selection of invisible rectangle [message #1705334] Thu, 13 August 2015 19:56 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 524
Registered: November 2009
Senior Member
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 20:02]

Report message to a moderator

Re: Controlling selection of invisible rectangle [message #1705556 is a reply to message #1705334] Mon, 17 August 2015 13:20 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1883
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 17:22 Go to previous message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 524
Registered: November 2009
Senior Member
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: Sun Jan 21 02:51:31 GMT 2018

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

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