Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » GEF & EMF representing AbsoluteBendpoint in EMF
GEF & EMF representing AbsoluteBendpoint in EMF [message #194228] Wed, 31 August 2005 17:03 Go to next message
drew frantz is currently offline drew frantzFriend
Messages: 340
Registered: July 2009
Senior Member
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)
Re: GEF & EMF representing AbsoluteBendpoint in EMF [message #194261 is a reply to message #194228] Wed, 31 August 2005 18:52 Go to previous messageGo to next message
Eclipse UserFriend
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)
>
>
>
>
Re: GEF & EMF representing AbsoluteBendpoint in EMF [message #194317 is a reply to message #194228] Thu, 01 September 2005 05:38 Go to previous message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
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.

You must provide custom implementations of the YyyFactoryImpl.createZzzFromString
and YyyFactoryImpl.convertZzzFromString methods. See p270-3 of the EMF book, and/or
org.eclipse.gef.examples.ediagram.model.impl.ModelFactoryImp l.
Previous Topic:Adding connections with custom layers
Next Topic:Copy/Cut and Paste Facility
Goto Forum:
  


Current Time: Fri Apr 26 02:53:50 GMT 2024

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

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

Back to the top