Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Linking Domain Models to Diagram
Linking Domain Models to Diagram [message #642862] Fri, 03 December 2010 04:19 Go to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello,

Following the Graphiti tutorial, I was able to create a diagram editor for adding a class and connection between classes. However I am trying out a couple of modifications to be done to the editor :

I have to assign/link a root element from the domain model as the parent to the main diagram. I tried changing the editing domain in the "CreateDiagramWizard" from the example, but without success. [I also tried out defining a custom editor extending the graphiti diagram editor and overriding the setInput() method]

Also I wanted a step in feature like in a workflow diagram having a sub-workflow within. [I guess I have to override the performRequest method from the respective edit part, but in that case I will have to override all of the GEF parts like the editpartfactory,edit parts, children, connection, etc]

I am stuck at this point for sometime now and could use some help. Could someone please help me out here. Thanks in advance for help

Regards,
Murthy

Re: Linking Domain Models to Diagram [message #642938 is a reply to message #642862] Fri, 03 December 2010 12:43 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello,

I guess I have figured a part of my problem right. The resource file contains two parts, one for the graphical representation and another for the domain related model information.

So I was able to add my newly created root domain element to the newly created resource in the 'FileService.java' of the example. I could then access my model everywhere as it is then bound to the Diagram. Hope I am not completely wrong here.

However I am still trying to get the perform request and adding sub elements thing working. Could someone please let me know if overriding the 'performRequest ' the only option ?

Thanks,
Murthy

Re: Linking Domain Models to Diagram [message #643372 is a reply to message #642938] Mon, 06 December 2010 16:43 Go to previous messageGo to next message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi Murthy,

could you specify your problem in more detail?
If you want to use nested shapes that should be straight-forward;
just write the respective create and add feature (the add feature should
accept
your container shape as parent, it is provided by the AddContext).

Best regards, Tim


"Murthy" <murthybhat@gmail.com> wrote in message
news:idaodq$n16$1@news.eclipse.org...
> Hello,
>
> I guess I have figured a part of my problem right. The resource file
> contains two parts, one for the graphical representation and another for
> the domain related model information.
>
> So I was able to add my newly created root domain element to the newly
> created resource in the 'FileService.java' of the example. I could then
> access my model everywhere as it is then bound to the Diagram. Hope I am
> not completely wrong here.
>
> However I am still trying to get the perform request and adding sub
> elements thing working. Could someone please let me know if overriding the
> 'performRequest ' the only option ?
>
> Thanks,
> Murthy
>
>
Re: Linking Domain Models to Diagram [message #643480 is a reply to message #643372] Tue, 07 December 2010 03:42 Go to previous messageGo to next message
Murthy Bhat is currently offline Murthy BhatFriend
Messages: 159
Registered: July 2009
Senior Member
Hello Tim,

I should have put my question in a better way. There are two parts in my question here.

1. How and where do I link my root domain model [e.g : 'package' in a class diagram] element to my main diagram.
{I have tried to add my domain root to the resourceset, but I am unable to link it to diagram}

2. I have a drill down feature for my domain objects. By following the tutorial, I was able to associate another diagram to this domain model.
But I do not want to create another diagram file, but use the main diagram file to contain all the diagrams and domain models and their links.

Thanks,
Murthy
Re: Linking Domain Models to Diagram [message #644563 is a reply to message #643480] Mon, 13 December 2010 09:40 Go to previous message
Tim Kaiser is currently offline Tim KaiserFriend
Messages: 118
Registered: July 2009
Senior Member
Hi Murhty,

1. It should be sufficient if you add your domain root to the contents of
the resource
the diagram is located in. Have a look at the CreateEClassFeature in the
Tutorial:
getDiagram().eResource().getContents().add(newClass);

Any domain model elements contained in your model root automatically
will be saved to the file of the diagram

You may construct the model root when the user creates the first model
element.
If the model root is already existing you may add it to the diagrams
resource when the user creates
the first model element.

2. Just add the new model root to the contents of the Resource which
conatins the diagram.

Does it help?

Best, Tim



"Murthy" <murthybhat@gmail.com> wrote in message
news:idka7c$rhk$1@news.eclipse.org...
> Hello Tim,
>
> I should have put my question in a better way. There are two parts in my
> question here.
>
> 1. How and where do I link my root domain model [e.g : 'package' in a
> class diagram] element to my main diagram.
> {I have tried to add my domain root to the resourceset, but I am unable to
> link it to diagram}
>
> 2. I have a drill down feature for my domain objects. By following the
> tutorial, I was able to associate another diagram to this domain model.
> But I do not want to create another diagram file, but use the main diagram
> file to contain all the diagrams and domain models and their links.
>
> Thanks,
> Murthy
Previous Topic:Hide individual resize handles?
Next Topic:Image provider supporting images from different plugins
Goto Forum:
  


Current Time: Fri Mar 29 05:53:29 GMT 2024

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

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

Back to the top