Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » why save failed
icon9.gif  why save failed [message #677676] Thu, 09 June 2011 06:42 Go to next message
xebec Missing name is currently offline xebec Missing nameFriend
Messages: 5
Registered: March 2011
Junior Member
hi,

I use GMF to develope a modeling tool,
i got a trouble that when i adjust the connection Anchor,from p1 index.php/fa/2980/0/to p2index.php/fa/2981/0/
by set the sourceAnchor and targetAnchor

			EllipseAnchor sourceAnchor = new EllipseAnchor((IFigure)sep.getFigure());
			EllipseAnchor targetAnchor = new EllipseAnchor((IFigure)tep.getFigure());
			connectionEditpart.getConnectionFigure().setSourceAnchor(sourceAnchor);
			connectionEditpart.getConnectionFigure().setTargetAnchor(targetAnchor);


it seems worked,but when i save and close the diagram and reopen it,it still not changed(as p1),
i examed the diagram file with UltraEdit,i see it has not been changed

so,why it obviously changed successfully in the canvas,but in the file,it was not changed at all?

(i tried 2 ways to save ,but it does'not work:
1 currentDiagramEditor.doSave
2 ctrl+s in the editer UI
and i failed)

thanks.
  • Attachment: 1.jpg
    (Size: 4.40KB, Downloaded 222 times)
  • Attachment: 2.jpg
    (Size: 4.04KB, Downloaded 224 times)
Re: why save failed [message #677748 is a reply to message #677676] Thu, 09 June 2011 09:25 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 771
Registered: July 2009
Location: Grenoble, France
Senior Member
Hi,

If you modify directly the figures, there state is not persisted in the diagram file. You have to use a SetConnectionAnchorCommand to perform this operation. It will apply changes on both diagram editor and underlying diagram model.

HTH

--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Eclipse Community Award 2011: Best Modeling Tool
Re: why save failed [message #681896 is a reply to message #677748] Fri, 10 June 2011 03:06 Go to previous messageGo to next message
xebec Missing name is currently offline xebec Missing nameFriend
Messages: 5
Registered: March 2011
Junior Member
thank you,Mickael.

um.."there state is not persisted in the diagram file",thanks for advice and it seems accurate and right.
but,when I tried to use "SetConnectionAnchorCommand" ,i found seems there is no such method or "ChangeConnectionAnchorCommand" in this framework


then i think maybe I should use "ChangePropertyValueRequest" but it seems it can change some infomation but not ConnectionAnchor,so I am confused again.
Re: why save failed [message #682065 is a reply to message #681896] Fri, 10 June 2011 10:03 Go to previous messageGo to next message
Mickael Istria is currently offline Mickael IstriaFriend
Messages: 771
Registered: July 2009
Location: Grenoble, France
Senior Member
Sorry, I should have written SetConnectionAnchorsCommand (with a S after Anchor).

Le 10/06/2011 05:06, xebec a écrit :
> thank you,Mickael.
> um.."there state is not persisted in the diagram file",thanks for advice and it seems accurate and right.
> but,when I tried to use "SetConnectionAnchorCommand" ,i found seems there is no such method or "ChangeConnectionAnchorCommand" in this framework
>
> then i think maybe I should use "ChangePropertyValueRequest" but it seems it can change some infomation but not ConnectionAnchor,so I am confused again.


--
Mickael Istria -- BonitaSoft S.A.
http://www.bonitasoft.com/products/BPM_download.php
Eclipse Community Award 2011: Best Modeling Tool
icon14.gif  Re: why save failed [message #683219 is a reply to message #682065] Mon, 13 June 2011 09:07 Go to previous message
xebec Missing name is currently offline xebec Missing nameFriend
Messages: 5
Registered: March 2011
Junior Member
"SetConnectionAnchorsCommand"
cool..it worked!I confused in this problem for several days until your instruct helped me Razz
thank you,very much,Mickael
Previous Topic:Extend / Inherit Diagrams
Next Topic:Hiding and unhiding elements / editparts
Goto Forum:
  


Current Time: Sat Dec 20 01:34:31 GMT 2014

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

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