Skip to main content



      Home
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 Go to next message
Eclipse UserFriend
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 #141555 is a reply to message #141374] Thu, 05 July 2007 11:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Halimatou.Pouye-Diaw.thomson.net

Hi, everybody
Any hint for this topic?

Thanks.

Lima.
Re: Create a new view for an existing diagram [message #141668 is a reply to message #141374] Sun, 08 July 2007 08:03 Go to previous messageGo to next message
Eclipse UserFriend
Hello exquisitus,

AFAIU you are trying to implement something similar to Diagram Partitioning
( http://wiki.eclipse.org/GMF_New_and_Noteworthy#Basic_support _for_diagram_partitioning).


-----------------
Alex Shatalin
Re: Create a new view for an existing diagram [message #141716 is a reply to message #141668] Mon, 09 July 2007 04:05 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Halimatou.Pouye-Diaw.thomson.net

Hello Alex,
Thank you for the hint, I will investigate the diagram partitioning. Hope
it
correspon,ds to what I want to implement.

Best regards,

Lima.
Re: Create a new view for an existing diagram [message #141844 is a reply to message #141716] Mon, 09 July 2007 11:28 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Halimatou.Pouye-Diaw.thomson.net

Hi, everybody

I finally use the OpenEditPolicy to open a new editor, after double
clicking on a compartment, as explained on
http://dev.eclipse.org/newslists/news.eclipse.technology.gmf /msg03693.html.

But, the "getOpenCommand" is never called, so I have no action after
double-clicking on a compartment, even if the OpenEditorEditPolicy is
installed for the compartment edit part.

I think, I miss something but i don't know why.

Could anyone give me any hint, to resolve this problem?

Thank you.
Re: Create a new view for an existing diagram [message #141899 is a reply to message #141668] Tue, 10 July 2007 05:49 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Halimatou.Pouye-Diaw.thomson.net

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 #141917 is a reply to message #141899] Tue, 10 July 2007 09:04 Go to previous messageGo to next message
Eclipse UserFriend
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 #141932 is a reply to message #141917] Tue, 10 July 2007 09:38 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: Halimatou.Pouye-Diaw.thomson.net

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 #141936 is a reply to message #141932] Tue, 10 July 2007 09:53 Go to previous messageGo to next message
Eclipse UserFriend
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 Go to previous message
Eclipse UserFriend
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.
Previous Topic:With double click on element...
Next Topic:why is the GMF diagram in the New/Example section
Goto Forum:
  


Current Time: Thu Sep 18 18:41:36 EDT 2025

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

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

Back to the top