Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Store a map in the properties of a pictogramelement
Store a map in the properties of a pictogramelement [message #896271] Tue, 17 July 2012 20:02 Go to next message
Patrick Rütz is currently offline Patrick Rütz
Messages: 11
Registered: June 2012
Junior Member
Hi, I have to store a map in the properties of a pictogramelement. Because this map have to be persistent. But I only can store properties. Is there a way to store the map in or as a property?

Thanks a lot

Patrick
Re: Store a map in the properties of a pictogramelement [message #896474 is a reply to message #896271] Wed, 18 July 2012 13:26 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Patrick,

properties can store any kind of String values; you could serialize your map
(rather its content) and store it that way.

Michael
Re: Store a map in the properties of a pictogramelement [message #896502 is a reply to message #896474] Wed, 18 July 2012 14:59 Go to previous messageGo to next message
Patrick Rütz is currently offline Patrick Rütz
Messages: 11
Registered: June 2012
Junior Member
Hi Michael,

i have tried to serialize it, but in this map is a freeformconnectionimpl and this object ist not serializable. Maybe you could helo me?

Thanks a lot.
Re: Store a map in the properties of a pictogramelement [message #896543 is a reply to message #896502] Wed, 18 July 2012 19:13 Go to previous messageGo to next message
Erdal Karaca is currently offline Erdal Karaca
Messages: 747
Registered: July 2009
Senior Member
Why do you want to serialize an EObject (FreeFormConnection) using java's serialization methods?

If the FreeFormConnection is part of your Diagram, then it will be serialized by graphiti.

If you really need to serialize EObjects manually, then you should have a look at EMF's serialization methods (dont confuse with java's serialization):

http://wiki.eclipse.org/EMF/FAQ#How_do_I_serialize_a_resource_to_a_String_instead_of_a_file.3F


Patrick Rütz wrote on Wed, 18 July 2012 10:59
Hi Michael,

i have tried to serialize it, but in this map is a freeformconnectionimpl and this object ist not serializable. Maybe you could helo me?

Thanks a lot.

Re: Store a map in the properties of a pictogramelement [message #896588 is a reply to message #896543] Thu, 19 July 2012 03:18 Go to previous messageGo to next message
Patrick Rütz is currently offline Patrick Rütz
Messages: 11
Registered: June 2012
Junior Member
Hi Erdal,

i have a map mit map<connection, List<Anchor>>, because I had a collapsefeature, but when I close the eclispe Plugin, the Map is set to null and uncollapse. So I have to made my map persistent.

Patrick
Re: Store a map in the properties of a pictogramelement [message #896891 is a reply to message #896588] Fri, 20 July 2012 10:22 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1603
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Patrick,

I think it would be best not to store the connection directly in the
property, but instead to use a property like Name to identify a connection:
the property Name would be attached to the connection and the name value
could be used as the key in the map.

Michael

"Patrick Rütz" schrieb im Newsbeitrag news:ju7uab$9rj$1@xxxxxxxxe.org...

Hi Erdal,

i have a map mit map<connection, List<Anchor>>, because I had a
collapsefeature, but when I close the eclispe Plugin, the Map is set to
null and uncollapse. So I have to made my map persistent.

Patrick
Previous Topic:Gerrit enabled for Graphiti Git repository
Next Topic:programmatic connection creation
Goto Forum:
  


Current Time: Thu Oct 02 08:30:56 GMT 2014

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

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