lets suppose that a have created an element (by choosing a tool from palette) on the diagram. That element should contain two different child container shapes, lets call them left and right container shape, and they must be programmatically created. Also they must be linked to different business objects. Next thing is that i want to add some other element (by choosing a tool from palette) inside left or right CS and I must know in which one I've added it in order to make this new object a child of right business object.
So my question is: Is there any easy way of doing this? (I've added a picture as an attachment to show you how this should look like).
I've done this by adding new container shapes inside the add method of parent shape (the first one that is added to diagram). There, I have also created new BOs and linked them to those picture elements (which I don't like because I shouldn't mix those two in the same method).
But some problems arise from this approach: when I now try to add new element (from pallete, to left or right CS), target container is always the parent, not the left and right CS. Even when i add the element to appropriate CS (through some foreach loops and a lot of if statements ) i end up with a picture element that is not refreshing properly.
Any thoughts on those problems if there is no easier solution?
thank you very much. That solved a lot of my problems.
The problem that remains now, is how to disable all operations on those left and right panels (deletion, movement, resizing, etc)? I want them do delete only when I delete their parent shape... Also if I add a text shape to those LR CS parent, parent only sees those text shapes as a children, but not the container shape itself. This is a problem to me as I want to properly do the layouting.
Michael Wenz Messages: 1488 Registered: July 2009 Location: Walldorf, Germany
that is best done by disabling the delete, move etc. features for those
shapes in the feature provider. Probably the easiest way would be to return
a delete feature only for the out container shape (the one that is linked
with your outer domain object) and return null for all other shapes.