|
|
|
|
|
Re: Prevent selection of (background) image [message #654900 is a reply to message #654400] |
Thu, 17 February 2011 14:50 |
Harald Stangl Messages: 7 Registered: February 2011 |
Junior Member |
|
|
Ok, so here is my use case: I need users to be able to load an image in the background that serves as a kind of blueprint for them. They are then going to create "marker" elements on top of that image to mark certain regions in the image.
As my users don't need to select the background image, I'd prefer the inactive way. I did some tests and came to the following findings:
-Inactive container shapes are never drawn
-If there is a container shape that contains another shape, the following happens to the (child) shape:
-Container shape active and child shape active: shape is drawn
-Container shape active and child shape inactive: shape is drawn
-Container shape inactive and child shape inactive: shape is not drawn
-Container shape inactive and child shape active: shape is drawn but drag and resize behavior is buggy: if the child shape is dragged or resized, this is reflected but the diagram is not updated so it appears as if the move did not work. Only after the diagram has been closed and opened again, the shape appears at the right position.
The code for my tests is quite simple:
Diagram diagram = getDiagram();
ContainerShape container = Graphiti.getPeCreateService().createContainerShape(diagram, false);
Rectangle rect = Graphiti.getGaCreateService().createRectangle(container);
Graphiti.getGaLayoutService().setLocationAndSize(rect, 0, 0,diagram.getGraphicsAlgorithm().getWidth(), diagram.getGraphicsAlgorithm().getWidth());
[...]
RoundedRectangle rect = Graphiti.getGaCreateService().createRoundedRectangle(contain er, 5, 5);
Graphiti.getGaLayoutService().setLocationAndSize(rect, context.getX(), context.getY(), context.getWidth(),
context.getHeight());
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04382 seconds