Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Identifying diagram elements?
Identifying diagram elements? [message #646900] Sun, 02 January 2011 20:22 Go to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 169
Registered: July 2009
Senior Member
Hello,

I'm wondering whether there is a smarter way to do this... When updating or
layouting my (sometimes very complex) diagram elements, I have to somehow
iterate through the existing elements and identify them - which of the 15
Shapes or Texts is the one I want to update? The link to a business object is
not enough, because most of the time I've got multiple diagram elements for a
single business object. Right now, I've resorted to using the
PropertyContainer methods - I'm simply 'tagging' every diagram element with a
string to identify it by later on. This looks a bit clumsy to me - is there a
better way?

Thanks
Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
141 Reasons why you can't find your system administrator: 131. They have found
the exit.
Re: Identifying diagram elements? [message #646924 is a reply to message #646900] Mon, 03 January 2011 08:38 Go to previous messageGo to next message
Jos Warmer is currently offline Jos WarmerFriend
Messages: 108
Registered: October 2010
Senior Member
Volker,

I assume you are using:
            Graphiti.getPeService().setPropertyValue(mainShape, "id" , "TopContainer");

I am using this for some time now. Works well, and I have not found a better way yet.

Jos
Re: Identifying diagram elements? [message #647378 is a reply to message #646924] Wed, 05 January 2011 20:56 Go to previous messageGo to next message
Volker Wegert is currently offline Volker WegertFriend
Messages: 169
Registered: July 2009
Senior Member
Jos,

Jos Warmer <jos.warmer@openmodeling.nl> writes:
> I assume you are using:
> Graphiti.getPeService().setPropertyValue(mainShape, "id" , "TopContainer");

Yes, exactly.

> I am using this for some time now. Works well, and I have not found a
> better way yet.

It works, yes, but it feels so - GMF-y ;-)

Volker

--
* Volker Wegert * http://www.volker-wegert.de/contact *
>> Irgendwie scheint man in den 90ern, als noch Geld da war, auch nicht
>> wirklich Wert auf Qualit├Ąt gelegt zu haben.
>Man wird halt Wert auf Geld gelegt haben.
<fq4cvh$opu$02$1@news.t-online.com>
Re: Identifying diagram elements? [message #647898 is a reply to message #647378] Mon, 10 January 2011 11:30 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1635
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Volker,

I also can't think of a better way. For identification Graphiti offers the
linking and properties mechanisms, depending on your scenario you might also
use the type of the diagram object for identification (if the types
differ...), but that's it...

Properties are the most generic thing you probably can think of (that's
maybe also the reason why they feel so GMF-y... ;-) ), so they hopefully
help to solve all kinds of identifications issues; the downside is of course
their handling. If you have any idea how to better solve this let me know,
it could end up as an enhancement.

Michael


"Volker Wegert" <mail@volker-wegert.de> wrote in message
news:84k4ijvzl8.fsf@zak.home.volker-wegert.de...
> Jos,
>
> Jos Warmer <jos.warmer@openmodeling.nl> writes:
>> I assume you are using:
>> Graphiti.getPeService().setPropertyValue(mainShape, "id" ,
>> "TopContainer");
>
> Yes, exactly.
>
>> I am using this for some time now. Works well, and I have not found a
>> better way yet.
>
> It works, yes, but it feels so - GMF-y ;-)
>
> Volker
>
> --
> * Volker Wegert * http://www.volker-wegert.de/contact *
>>> Irgendwie scheint man in den 90ern, als noch Geld da war, auch nicht
>>> wirklich Wert auf Qualit
Previous Topic:Does container shape have to have a GA?
Next Topic:Tutorial License
Goto Forum:
  


Current Time: Thu Nov 27 08:40:21 GMT 2014

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

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