Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to open a diagram in patir of a drawn element?2
How to open a diagram in patir of a drawn element?2 [message #222169] Sat, 21 March 2009 13:42 Go to next message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Hello
Other time I asked question of How when we make double click on an element
drawn in the diagram a new diagram opens.
And Bary gave me this link:
http://wiki.eclipse.org/GMF_Archived_Newsgroup_Q_and_A#How_c an_I_open_an_editor_by_double-clicking_a_compartment.3F
but where it is necessary to write these two portions of codes and is that
it is necessary to modify some properties of the concerned element
Somebody explains me this method
please
Re: How to open a diagram in patir of a drawn element?2 [message #222426 is a reply to message #222169] Mon, 23 March 2009 21:15 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Arij,

> but where it is necessary to write these two portions of codes and is
A: Starting from GMF 2.0 M2 you can use basic support for diagram partitioning
feature
So, looks like you should not modify generated code anymore.. Or did I misunderstand
you?

> it is necessary to modify some properties of the concerned element
You just have to modify .gnfgen model and regenerate code..

-----------------
Alex Shatalin
Re: How to open a diagram in patir of a drawn element?2 [message #222510 is a reply to message #222426] Wed, 25 March 2009 01:00 Go to previous messageGo to next message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Thanks Mr.Alex
but what is the basic support for diagram partitioning feature and how i
can use.
Sorry but i'm novice in GMF.
Re: How to open a diagram in patir of a drawn element?2 [message #222713 is a reply to message #222510] Wed, 25 March 2009 09:02 Go to previous messageGo to next message
Salva is currently offline SalvaFriend
Messages: 29
Registered: July 2009
Junior Member
Hi,

You have to modify the gmfgen model. Under GenDiagram you can choose the
element (Edit part) for what you want to feature the double-click.
Right-Click in that element --> New Child --> OpenDiagramBehaviour.

(Well, you can do it also through gmfmap model. In nodeMapping set
relatedDiagrams under Misc and regenerate gmfGen)

There you have to fill two propeties: Diagram Kind and Editor Id.

(You can left they empty. Doing so performing doble-click will open a
diagram of the same type)

Then you have to regenerate. Now in your edit part an
openDiagramEditPolicy featuring the Open_ROle has been installed for the
selected edit part. When you perform double-click over that edit part in
the diagram that editPolicy will be called opening a new editor with the
semantic element of the right-clicked editPart as canvas.

Cheers!

Salva.
Re: How to open a diagram in patir of a drawn element?2 [message #223114 is a reply to message #222713] Sat, 28 March 2009 12:15 Go to previous messageGo to next message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Thanks Salva
I modify the gmfgen model,i choose the element (Edit part) for what i want
to feature the double-click. Right-Click in that element --> New Child -->
OpenDiagramBehaviour.
And I also tried with gmfmap: i set relatedDiagrams property,but I do not
arrive to result

Can you help me
Re: How to open a diagram in patir of a drawn element?2 [message #223178 is a reply to message #223114] Mon, 30 March 2009 11:17 Go to previous messageGo to next message
Salva is currently offline SalvaFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Arij,

First we need to check that all the required stuff has been generated
properly. There have to be a class named OpenDiagramEditPolicy under
edit.policies and the view factory for the edit part must install in
CreateStyles the style HintedDiagramLinkStyle. Is all right? Then you can
try to set a breakpoint in OpenDiagramEditPolicy and see what happens when
double click is performed.

(You have also to check the values of properties Diagram Kind and Editor
ID)

Cheers!

Salva.
Re: How to open a diagram in patir of a drawn element?2 [message #223194 is a reply to message #223178] Mon, 30 March 2009 12:06 Go to previous messageGo to next message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Thank you very much

I want verify that
Re: How to open a diagram in patir of a drawn element?2 [message #223250 is a reply to message #222510] Mon, 30 March 2009 14:41 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Arij,

> but what is the basic support for diagram partitioning feature and
> how i can use.
I googled and found: http://wiki.eclipse.org/Diagram_Partitioning

In general, you have to select NodeMapping representing diagram node with
associated sub-diagram and specify "related diagrams" for this node mapping.
This means - you have to point to the CanvasMapping representing sub-diagram
of this domain model element there. Then transform .gmfmap -> .gmfgen and
generate code.

-----------------
Alex Shatalin
Re: How to open a diagram in patir of a drawn element?2 [message #223450 is a reply to message #223250] Mon, 30 March 2009 22:47 Go to previous message
Arij is currently offline ArijFriend
Messages: 40
Registered: July 2009
Member
Thank Sir
Previous Topic:re-evaluate constraint
Next Topic:Graphic representation of an element with regard to the value of its attribute
Goto Forum:
  


Current Time: Fri Apr 26 07:02:20 GMT 2024

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

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

Back to the top