Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Newbie Question - Incremental Development - Updating GA's and Styles
Newbie Question - Incremental Development - Updating GA's and Styles [message #1065146] Mon, 24 June 2013 13:50 Go to next message
Philip Alldredge is currently offline Philip AlldredgeFriend
Messages: 20
Registered: February 2013
Junior Member
I am working on an editor and so far it is going well. So far, Graphiti is making things simple. My editor is using an existing model that contains main different types of elements. For now, I would like to represent all the elements as rectangles with simple styles and then refine things as time goes on. For example, I would like to replace some of the rectangles with polygons later in the process. Also, I would like to adjust the style definitions. What is the recommended way for updating such things at editors are refined. For the styles, I am currently replacing the entire style definition whenever the editor is loaded, but I was hoping there was more elegant way. Would I need to do similar for the shapes in an update feature? Other recommendations?

Thank you
Re: Newbie Question - Incremental Development - Updating GA's and Styles [message #1065176 is a reply to message #1065146] Mon, 24 June 2013 15:25 Go to previous messageGo to next message
Robert Brodt is currently offline Robert BrodtFriend
Messages: 811
Registered: August 2010
Location: Colorado Springs, CO
Senior Member

Hi Philip,

Not sure if this is relevant, but you may want to allow your users to customize styles (colors, fonts, linestyles, etc.) so you may want to think about storing & fetching style attributes from a Preference Store.

Bob
Re: Newbie Question - Incremental Development - Updating GA's and Styles [message #1065195 is a reply to message #1065176] Mon, 24 June 2013 17:43 Go to previous messageGo to next message
Philip Alldredge is currently offline Philip AlldredgeFriend
Messages: 20
Registered: February 2013
Junior Member
Being able to store style information in a preference store or other location external to diagram would solve the style issues as long as they are not serialized with the diagram. Is that possible? How? Storing the style information in the diagram requires that the diagram be updated anytime the styles change. If it was customizable by the user that would result in a change anytime a user with a different preference open the file. Obviously that would be a version control mess.

I see a couple ways to solve my shapes\grpahical algorithm issue. One would be to recreate all the shapes when a user opens a diagram to make sure the proper structure is being used. The other would be to store a version number and only perform the update if the diagram was made with an older version. If there is a recommended or better way to do it, I am open to it. I would prefer to do things "the right way".
Re: Newbie Question - Incremental Development - Updating GA's and Styles [message #1065283 is a reply to message #1065195] Tue, 25 June 2013 08:47 Go to previous messageGo to next message
Albert Hofkamp is currently offline Albert HofkampFriend
Messages: 41
Registered: August 2009
Member
I have been using Graphiti for a couple of days now, and have been wondering about this issue as well, except from the other side (my business objects are not entirely stable).

I can see the use of graphical elements in an editor instance (fast/easy detection of what the user points at), but I don't understand the idea behind using this information as *the* pictogram model and storing it in the diagram file.

If I were to write an editor from scratch, I would make "graphical business objects" (let's call them GBOs), ie elements that represents concepts in the editor containing just enough information to draw themselves, eg just position and size for a box-like shape, or just the source and destination (graphical) business objects for a connection element.
While it would be more work (you need to make these GBOs which are probably almost a copy of your real business objects), raising the level of abstraction here would solve your style problems (since the style is 'generated' by the GBO while rendering it).
It may also simplify the layout feature, since you don't have to dig around in low-level graphical objects without direct business meaning.

For me, if I define the GBOs as a proper meta-model, I can do version management and migration with it as usual with meta models.
(More extreme steps would be to do a transformation between the business object model and the GBO, or even just drop the business object model, and use the GBO as business object model instead.

What I don't know unfortunately, is why Graphiti uses such low-level graphical elements instead. It would be interesting to learn why this path was chosen.
Re: Newbie Question - Incremental Development - Updating GA's and Styles [message #1065288 is a reply to message #1065195] Tue, 25 June 2013 08:52 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Not sure if there is "the right way"...

Extracting style information to a preference store is not possible. Graphiti
expects all the values directly in the EMF model.

I would suggest to tag all elements with a version property und update the
stuff in case an older version exists in the diagram (this might already
happen on opening a diagram).

Michael
Re: Newbie Question - Incremental Development - Updating GA's and Styles [message #1065461 is a reply to message #1065146] Tue, 25 June 2013 19:08 Go to previous message
Philip Alldredge is currently offline Philip AlldredgeFriend
Messages: 20
Registered: February 2013
Junior Member
Okay. Thanks for the info. If there isn't a right way then I'll likely do something similar to what you suggest. I don't expect it to cause issues.

Thanks!
Previous Topic:Line color for shapes
Next Topic:How do I change color in programmatic way
Goto Forum:
  


Current Time: Fri Apr 26 08:43:47 GMT 2024

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

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

Back to the top