Skip to main content



      Home
Home » Modeling » Graphiti » Import or re-use Diagram?(diagram into "external container shape")
Import or re-use Diagram? [message #778556] Fri, 13 January 2012 04:11 Go to next message
Eclipse UserFriend
Hi,

I've been working with Graphiti for a few months and the answers given in this forum have been really helpful; but I haven´t found any solution for my current problem.
I'm trying to import a diagram in a containerShape that is in another diagram. In this new diagram it shows me the states and the connections, but for these connections it only shows the ArrowDecorator but not the textDecorator.

What I want to do is to re-use a source diagram in a containerShape belonging to other diagrams, so that if you change something in the source diagram it changes as well in the others.

The fragment code I have written is:

ContainerShape containerShape = (ContainerShape)getFeatureProvider().getPictogramElementForBusinessObject(newCompositeState).getGraphicsAlgorithm().eContainer();
diagram.setContainer(containerShape);


This code executes when the user creates a new state (called newCompositeState).I want the content of the new state to be the other diagram.
I attach an example image for more explicitness.
index.php/fa/6731/0/

I would appreciate any suggestion you can give me.
Thanks.
Nicolás.
  • Attachment: example.png
    (Size: 43.39KB, Downloaded 626 times)

[Updated on: Fri, 13 January 2012 05:49] by Moderator

Re: Import or re-use Diagram? [message #780227 is a reply to message #778556] Tue, 17 January 2012 07:06 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

not sure, but I would expect that the text decorators are simply hidden
behind the "source diagram" container. Connections are always drawn directly
on the root diagram, so I would suspect the text decorator to be on the root
diagram as well.

Michael
Re: Import or re-use Diagram? [message #780299 is a reply to message #780227] Tue, 17 January 2012 10:01 Go to previous messageGo to next message
Eclipse UserFriend
Hi Michael,
Thanks for your quickly response.
I'm not sure if I have understood you. If the Arrow Decorator is also a connection decorator, why it isn't also hidden behind the "source diagram" container?
In any case, how can I bring to the front the text decorator?

I don't understand what you mean with "root diagram". If, for example, I do this as a test (just for testing):

diagram.setContainer(getDiagram());


it doesn't shows either, but I'm indicating that the "source diagram" is included in the other diagram and not in a container shape.


Thank you very much for your help.
Regards,
Nicolás.
Re: Import or re-use Diagram? [message #780319 is a reply to message #780227] Tue, 17 January 2012 10:53 Go to previous messageGo to next message
Eclipse UserFriend
I seem to remember that connections are drawn on a "layer" of their own (that's why clipping does not really work for them). Could it be that connections are on their own layer and decorators are simply clipped?
Re: Import or re-use Diagram? [message #780321 is a reply to message #780319] Tue, 17 January 2012 10:55 Go to previous messageGo to next message
Eclipse UserFriend
By the way, does this really work? Doesn't that mean that the diagram would have more than one container?
Re: Import or re-use Diagram? [message #794634 is a reply to message #780321] Thu, 09 February 2012 09:25 Go to previous message
Eclipse UserFriend
Hi Andreas,
I apologize for my late response.
It might be because of what you have told me but I don't have any other idea to solve the problem. You are right, that would mean that the diagram has more than one container.
Do you have any idea for re-using a diagram in container shapes from other diagrams?

I would appreciate any suggestion you can give me.
Thanks.
Nicolás.

[Updated on: Fri, 10 February 2012 04:56] by Moderator

Previous Topic:Create Polyline tool
Next Topic:DiagramEditor default behaviour
Goto Forum:
  


Current Time: Wed Jul 23 12:16:33 EDT 2025

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

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

Back to the top