|
Re: GEF & EMF representing AbsoluteBendpoint in EMF [message #194261 is a reply to message #194228] |
Wed, 31 August 2005 18:52 |
Eclipse User |
|
|
|
Originally posted by: zx.us.ibm.com
This is an EMF question, not a GEF question.
You have two strategies in persisting a Point in EMF.
1) You can either use two int values representing x,y and build a point
from them when you load the file.
2) You can use a attribute Point, and create the proper createFromString
method so it builds a Point from the persisted "(x,y)" string. If you
have the EMF book, this is discussed with the Date example.
Cheers,
~ Chris
Drew wrote:
> I have seen a number of examples in representing points in EMF by using a
> type defined in GEF that corresponds to a GEF type ie.
> org.eclipse.draw2d.AbsoluteBendpoint.
>
> The problem is that when i persist these they look like so in the persisted
> file.
> <bendpoints>Point(46, 255)</bendpoints>
> During file load i get an exception when the file loads.
> The value 'Point(283, 203)' is invalid.
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLo adHelper(Resourc
> eSetImpl.java:268)
>
> at
> org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResou rce(ResourceSetI
> mpl.java:349)
>
>
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03923 seconds