Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » ViewService diagram creation issue
ViewService diagram creation issue [message #186048] Fri, 09 May 2008 14:11 Go to next message
Kristian O'Connor is currently offline Kristian O'ConnorFriend
Messages: 29
Registered: July 2009
Junior Member
Hi all

I was hoping someone could explain the following...

I edited the Mindmap example to initialise the diagram with a simple topic..
by editing the MindmapDiagramEditorUtil#createInitialModel() method as
follows -

/**
* Create a new instance of domain element associated with canvas.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated NOT
*/
private static org.eclipse.gmf.examples.mindmap.Map createInitialModel() {
org.eclipse.gmf.examples.mindmap.Map map = MindmapFactory.eINSTANCE
.createMap();
Topic topic = MindmapFactory.eINSTANCE.createTopic();

topic.setName("View Service Issue");
topic.setPercentComplete(50.0f);

map.getRootTopics().add(topic);

return map;
}


I noticed that when the resources were saved...
try {

modelResource

..save(org.eclipse.gmf.examples.mindmap.diagram.part.Mindmap DiagramEditorUtil

..getSaveOptions());

diagramResource

..save(org.eclipse.gmf.examples.mindmap.diagram.part.Mindmap DiagramEditorUtil

..getSaveOptions());

} catch (IOException e) {


MindmapDiagramEditorPlugin.getInstance().logError(

"Unable to store model and diagram resources", e); //$NON-NLS-1$

}

I had...

For the semantic ->

<?xml version="1.0" encoding="UTF-8"?>
<mindmap:map xmlns:mindmap="http://www.example.org/mindmap">
<rootTopics name="View Service Issue" percentComplete="50.0"/>
</mindmap:map>

and for the Notational ->

<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:mindmap="http://www.example.org/mindmap"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
xmi:id="_W-UKEB3GEd2dfa0MC-ybSQ" type="Mindmap" name="default.mmd"
measurementUnit="Pixel">
<styles xmi:type="notation:DiagramStyle"
xmi:id="_W-UKER3GEd2dfa0MC-ybSQ"/>
<element xmi:type="mindmap:Map" href="default.mindmap#//@map"/>
</notation:Diagram>


But this seems wrong!!!... surely the notational should have a reference to
the topic... but it does not...

For example - A notational resource referencing the topic...

<?xml version="1.0" encoding="UTF-8"?>
<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:mindmap="http://www.example.org/mindmap"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation"
xmi:id="_W-UKEB3GEd2dfa0MC-ybSQ" type="Mindmap" name="default.mmd"
measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_XhV-oB3GEd2dfa0MC-ybSQ"
type="2001">
<children xmi:type="notation:Node" xmi:id="_XhpgoB3GEd2dfa0MC-ybSQ"
type="5002"/>
<children xmi:type="notation:Node" xmi:id="_XhpgoR3GEd2dfa0MC-ybSQ"
type="7001">
<styles xmi:type="notation:DrawerStyle"
xmi:id="_Xhpgoh3GEd2dfa0MC-ybSQ"/>
<styles xmi:type="notation:SortingStyle"
xmi:id="_Xhpgox3GEd2dfa0MC-ybSQ"/>
<styles xmi:type="notation:FilteringStyle"
xmi:id="_XhpgpB3GEd2dfa0MC-ybSQ"/>
</children>
<styles xmi:type="notation:ShapeStyle"
xmi:id="_XhV-oR3GEd2dfa0MC-ybSQ"/>
<element xmi:type="mindmap:Topic"
href="default.mindmap#//@map/@rootTopics.0"/>
<layoutConstraint xmi:type="notation:Bounds"
xmi:id="_XhV-oh3GEd2dfa0MC-ybSQ"/>
</children>
<styles xmi:type="notation:DiagramStyle"
xmi:id="_W-UKER3GEd2dfa0MC-ybSQ"/>
<element xmi:type="mindmap:Map" href="default.mindmap#//@map"/>
</notation:Diagram>


So what gives? why does the ViewService not create the notational resource
fully? is it even supposed to...

Thanks in advance,
Kristian O'Connor

--
Re: ViewService diagram creation issue [message #186276 is a reply to message #186048] Mon, 12 May 2008 10:57 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Kristian O'Connor,

> So what gives? why does the ViewService not create the notational
> resource fully? is it even supposed to...
Corresponding topic element will be created automatically on diagram openning.
This diagram node will be marked as "transient" till the moment then user
modify it (move/set any view properties). Transient nodes should not be stored
in diagram files - they rather should be re-created on next diagram openning.

-----------------
Alex Shatalin
Re: ViewService diagram creation issue [message #187209 is a reply to message #186276] Thu, 15 May 2008 10:29 Go to previous message
Kristian O'Connor is currently offline Kristian O'ConnorFriend
Messages: 29
Registered: July 2009
Junior Member
Hi Alex,

Thanks, that explanation has helped me solve the issue that I was having...

Regards-
Kristian.


"Alex Shatalin" <vano@borland.com> wrote in message
news:3c3172e6220db8ca8246ee631070@news.eclipse.org...
> Hello Kristian O'Connor,
>
>> So what gives? why does the ViewService not create the notational
>> resource fully? is it even supposed to...
> Corresponding topic element will be created automatically on diagram
> openning. This diagram node will be marked as "transient" till the moment
> then user modify it (move/set any view properties). Transient nodes should
> not be stored in diagram files - they rather should be re-created on next
> diagram openning.
>
> -----------------
> Alex Shatalin
>
>
Previous Topic:Initializing the diagram file
Next Topic:How to add Attributes on runtime?
Goto Forum:
  


Current Time: Fri Apr 26 20:04:33 GMT 2024

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

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

Back to the top