Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Repaint whole Diagram(Repaint a whole diagram by a event)
Repaint whole Diagram [message #1077863] Fri, 02 August 2013 04:39 Go to next message
Juliane Mueller is currently offline Juliane Mueller
Messages: 25
Registered: August 2011
Junior Member
Hello all,

I have drawn a diagram automatically.
By a certain event the whole diagram should be repainted automatically with the new values.
I've tried this with the removeFeature and new AddFeatures. But there always come an exception that I can't modify a resource without a writing transaction.

I also tried to create a new diagram with the same URI as before, but if the diagram is open by the event, it is not refreshed.

Are there any other solutions?

I'm looking forward for your reply!

Best regards, Juliane
Re: Repaint whole Diagram [message #1077964 is a reply to message #1077863] Fri, 02 August 2013 07:14 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1370
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Juliane,

what do you mean with "repainted"?

Just an update of what the editor shows to the state the Graphiti model is
in? In that case calling refresh on the editor should help.

In case your would like to update the Graphiti model to the current state of
e.g. your domain model I would suggest to implement your own subclass of
DefaultUpdateDiagramFeature and call that. Note that any feature you call
and makes changes to the EMF models need to do those changes inside a
transaction on the transactional editing domain of the editor otherwise you
will see the exception you got.

Michael
Re: Repaint whole Diagram [message #1082231 is a reply to message #1077964] Thu, 08 August 2013 05:20 Go to previous messageGo to next message
Juliane Mueller is currently offline Juliane Mueller
Messages: 25
Registered: August 2011
Junior Member
Thanks Michael,

I've found the solution for my problem. Now I remove everything from the diagram with the RemoveFeature and afterwards I call my own UpdateFeature, which repaints the whole diagram.

Regards, Juliane
Re: Repaint whole Diagram [message #1095009 is a reply to message #1082231] Mon, 26 August 2013 10:02 Go to previous message
Michael Wenz is currently offline Michael Wenz
Messages: 1370
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Juliane,

that surely works for small diagrams, but might cause performance issues
with larger diagrams. Maybe it would be better to implement the update
features in a way that they first check what is already on the diagram and
only update the missing parts (plus maybe delete no longer needed parts).

Michael
Previous Topic:Caching of features
Next Topic:Integration with eclipse launch fwk
Goto Forum:
  


Current Time: Mon Oct 07 09:23:50 EDT 2013

Powered by FUDForum. Page generated in 0.02538 seconds