Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Update the shapes programmatically
Update the shapes programmatically [message #1037109] Tue, 09 April 2013 07:20 Go to next message
Wok Show is currently offline Wok ShowFriend
Messages: 40
Registered: July 2009
Member
Hi,

if I add some new Elements to my domain model (addressbook) programmatically, how can I update the shapes for rendering programmatically? Maybe I should extends the DefaultUpdateShapeFeature, but how should I call this extended class in the popupmenu?

E.g. I add a new contact via popupmenu of a shape with an SWT Dialog. After running the dialog the new contact is going to add to the emf addressbook model. The addressbook will render by a rectangle and the contacts are compartment in this rectangle rendered by ellipse. How to update this in the diagramm?

And another question is, how can I reuse the outline view for my domain model? With Eclipse Editor I can use the Adapter class. But how can I add this in graphiti editor?

Thanks for helping.

best regards,

d.chau
Re: Update the shapes programmatically [message #1037450 is a reply to message #1037109] Tue, 09 April 2013 15:13 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
d.chau,

you may override the DefaultUpdateDiagramFeature that cares about updating
the complete diagram. It it registered by default for updates on diagram
level (see DefaultFeatureProvider.getUpdateFeature()). In your subclass you
may also check if all contacts are available in the diagram.

Regarding the outline: there is an example of an outline available in the
org.eclipse.graphiti.examples.common plugin. See the classes in package
org.eclipse.graphiti.examples.common.outline and
org.eclipse.graphiti.examples.common.outline.tree.

HTH,
Michael
Previous Topic:Property View - changes cause undo problems
Next Topic:Two errors in tutorial I am curious about
Goto Forum:
  


Current Time: Fri Apr 19 16:48:30 GMT 2024

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

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

Back to the top