|
Re: Active Shapes problem [message #937444 is a reply to message #937138] |
Tue, 09 October 2012 01:17 |
|
Jos Warmer wrote on Tue, 09 October 2012 02:56I 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
What if you have only 1 content pane (you said it as deepest nested shape)
1. Let contentPane as inactive.
2. Let AddSomethingFeature works clever.
Inactive PE delegate drop target to it's parent(active one)
So you can create am add feature using root shape, then add child PE into place you want.
What if you have multiple content panes, It needs some hacky trick
since Graphiti doesn't provide search API with given location.
You can search target pe with API from PE and GA EMF model using location which is given by add context.
It reduces benefit of graphiti's easiness I think.
|
|
|
|
|
|
|
Re: Active Shapes problem [message #1222022 is a reply to message #1221884] |
Thu, 19 December 2013 12:51 |
Martin Hanysz Messages: 30 Registered: November 2013 |
Member |
|
|
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 12:52] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.03354 seconds