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: 30
Registered: August 2011
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: 1590
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: 30
Registered: August 2011
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 messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
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
Re: Repaint whole Diagram [message #1128962 is a reply to message #1095009] Tue, 08 October 2013 02:46 Go to previous messageGo to next message
PALANI SANKAR is currently offline PALANI SANKAR
Messages: 35
Registered: April 2013
Member
Hi Michael/Juliane

I am facing performance issue since my requirements contains larger diagrams. Is there any way to improve it? Could you please suggest a way to improve my performance.

Thanks
Palani


Thanks
Palani
Re: Repaint whole Diagram [message #1130118 is a reply to message #1128962] Wed, 09 October 2013 04:35 Go to previous messageGo to next message
Michael Wenz is currently offline Michael Wenz
Messages: 1590
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Palani,

that strongly depends on you graphical model. As I already wrote, in general
it is better to avoid a complete redraw and instead check if the existing
parts on the diagram can be reused and add/remove/adapt only the no more
current things.

Michael
Re: Repaint whole Diagram [message #1130128 is a reply to message #1130118] Wed, 09 October 2013 04:47 Go to previous message
PALANI SANKAR is currently offline PALANI SANKAR
Messages: 35
Registered: April 2013
Member
Hi Michael

There is no other solution ?Sad , because i am playing with different objects so i need to clear all and re-paint it again.

Thanks
Palani


Thanks
Palani
Previous Topic:Disabling Undo Issues
Next Topic:Best way of clearing the commandstack on saving of editor
Goto Forum:
  


Current Time: Tue Sep 02 00:23:36 EDT 2014

Powered by FUDForum. Page generated in 0.01739 seconds