Linking Domain Models to Diagram [message #642862] |
Thu, 02 December 2010 23:19  |
Eclipse User |
|
|
|
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 #644563 is a reply to message #643480] |
Mon, 13 December 2010 04:40  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.35275 seconds