Active Shapes problem [message #937138] |
Mon, 08 October 2012 13:56  |
Eclipse User |
|
|
|
I have a situation where I have a number of nested shapes (all rectangles in this case).
The top rectangle is active and therefore selectable.
In the deepest nested rectangle I want to be able to create other shapes through the palette.
To be able to do this, the deepest nested shape needs to be 'active', otherwise I cannot drop a new shape on it. The problem now is that this deepest nested shape also becomes selectable by the user, but that is not what I need. This shape just defines an area to create other shapes from the palette, it has no further semantics and should remain unselectable. Is there a way to make a shape accessible for dragging new shapes from the palette, and keeping it not selectable by the user?
Jos
|
|
|
|
|
|
|
|
Re: Active Shapes problem [message #1222022 is a reply to message #1221884] |
Thu, 19 December 2013 07:51  |
Eclipse User |
|
|
|
Dear Michael,
I already tried setting s2 to inactive, but that also disables the rendering of its GraphicsAlgorithm. Adding the GraphicsAlgorithm of s2 as a child to the GraphicsAlgorithm of cs is also not possible, because cs is inactive, too.
I finally decided to introduce a "disabled" boolean property that I set for every decoration shape and check in every other feature first. If a PictogramElement has this property set to true, the features that are considered user interaction (move, resize, remove, delete...) simply do nothing. Since the "disabled" shapes are handled programmatically once other shapes are manipulated, the user can still move, resize or remove them.
First I tried returning false in the can*() method of these features, but that caused another problem. If the user selects multiple PictogramElements with the marquee tool and then tries to move all of them, the mouse cursor turns into the red forbidden symbol once the respective move feature returns false for at least one of the selected PictogramElements.
Even if your suggestions didn't solve this particular problem, pointing out the possibility to nest GraphicsAlgorithms into each other helped me at some other points, so thanks for that 
Best regards,
Martin
[Updated on: Thu, 19 December 2013 07:52] by Moderator
|
|
|
Powered by
FUDForum. Page generated in 0.05832 seconds