Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 09:11 Go to next message
Nicolas Buezas is currently offline Nicolas BuezasFriend
Messages: 5
Registered: January 2012
Junior Member
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 566 times)

[Updated on: Fri, 13 January 2012 10:49]

Report message to a moderator

Re: Import or re-use Diagram? [message #780227 is a reply to message #778556] Tue, 17 January 2012 12:06 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
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 15:01 Go to previous messageGo to next message
Nicolas Buezas is currently offline Nicolas BuezasFriend
Messages: 5
Registered: January 2012
Junior Member
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 15:53 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
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 15:55 Go to previous messageGo to next message
Andreas Graf is currently offline Andreas GrafFriend
Messages: 211
Registered: July 2009
Senior Member
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 14:25 Go to previous message
Nicolas Buezas is currently offline Nicolas BuezasFriend
Messages: 5
Registered: January 2012
Junior Member
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 09:56]

Report message to a moderator

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


Current Time: Thu Apr 25 13:37:30 GMT 2024

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

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

Back to the top