Home » Modeling » GMF (Graphical Modeling Framework) » Create a new view for an existing diagram
Create a new view for an existing diagram [message #141374] |
Wed, 04 July 2007 10:50  |
Eclipse User |
|
|
|
Originally posted by: Halimatou.Pouye-Diaw.thomson.net
Dear all,
I have created a plugin diagram, with which I can create simple graphs.
I would like to do navigation for nodes element via a popup menu.
For instance, for a node Node1, an access to a popupMenu allows me to
navigate in this node. That is to say, the node contains others nodes
inside, and I want to visualize only the nodes contained inside the node
Node1 in another view, by replacing the view of Node1.
I created a new menu on the node, and on "run(IAction action)" of the
Action class, I tried to create a new view and replace the old one, but I
didn't get what I want to do.
Does anybody know how to do that simply?
Best regards, and thanks for any hint.
Lima.
|
|
| | | | | |
Re: Create a new view for an existing diagram [message #141917 is a reply to message #141899] |
Tue, 10 July 2007 09:04   |
Eclipse User |
|
|
|
Hi exquisitus,
Take a look at the generated OpenDiagramCommand. It creates a new
diagram instance and associates it with the same underlying model
element that is associated with the notational element the edit policy
is registered for (Actually, this happens only the first time the
diagram for this element is opened, the resulting diagram is reused
afterwards). Thus, instead of opening a diagram for a compartment, it
actually opens a diagram for a diagram (whose underlying element is the
same as the one of the compartment), which is of course a valid operation.
Best regards,
Boris
exquisitus wrote:
> Hi, everybody
>
> I finally use the OpenDiagramCommand to open a new editor from a double
> click action on a compartment. But, the new editor is never opened
> because the compartment (which represents a view, that is to say a
> element of a Diagram) is an instance of my "Component" EObject and a new
> diagram can be opened only if the element is a Diagram; how can I use
> the OpenDiagramCommand on the compartment, even if it is not a Diagram?
>
> Any help will be appreciate.
>
> Thanks.
>
|
|
| |
Re: Create a new view for an existing diagram [message #141936 is a reply to message #141932] |
Tue, 10 July 2007 09:53   |
Eclipse User |
|
|
|
Hi Lima,
Yes, it is correct. Diagram can only be opened for an instance of
org.eclipse.gmf.runtime.notation.Diagram. However, if the new diagram
displays exactly the same elements (and uses the same editing domain as
the original one so that changes to the underlying model that are made
in one are immediately picked up in the other), why would one care that
it is a different instance?
Best regards,
Boris
exquisitus wrote:
> Hi, Boris
> Thank you for your reply.
> Unless I misunderstood what you said, you mean it is not possible to
> retrieve the elements of a compartment in a new editor. All I can do is
> to get an new editor for a diagram. Am I right? If yes, can we customise
> the compartement collapsible property to get only the elements inside (
> without the compartment, I mean)?
>
> Sorry, if my questions seem too obvious. I wedged on it, and I would
> like to achieve this implementation.
>
> Thanks and best regards.
>
> Lima.
>
>
|
|
|
Re: Create a new view for an existing diagram [message #141945 is a reply to message #141936] |
Tue, 10 July 2007 10:03  |
Eclipse User |
|
|
|
Originally posted by: Halimatou.Pouye-Diaw.thomson.net
You're right, Boris. The new diagram should contain the same elements, so
it 's quite not interesting. But I wouldn't like to display the top level.
It is in fact a compartment navigation, without displaying the father
compartment. For example, if two components B and C are linked and are
inside a compartment A, I would like to have in a new editor only B and C
with their links.
Thanks for you help.
Regards,
Lima.
|
|
|
Goto Forum:
Current Time: Thu Sep 18 18:41:36 EDT 2025
Powered by FUDForum. Page generated in 0.05047 seconds
|