Skip to main content


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 08:39 Go to next message
Juliane Mueller is currently offline Juliane MuellerFriend
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 11:14 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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 09:20 Go to previous messageGo to next message
Juliane Mueller is currently offline Juliane MuellerFriend
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 14:02 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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 06:46 Go to previous messageGo to next message
PALANI SANKAR is currently offline PALANI SANKARFriend
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 08:35 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
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 08:47 Go to previous message
PALANI SANKAR is currently offline PALANI SANKARFriend
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: Fri Apr 19 02:52:36 GMT 2024

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

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

Back to the top