Skip to main content



      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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Eclipse UserFriend
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
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
Eclipse UserFriend
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
Eclipse UserFriend
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
Previous Topic:Disabling Undo Issues
Next Topic:Best way of clearing the commandstack on saving of editor
Goto Forum:
  


Current Time: Tue Jul 08 08:47:45 EDT 2025

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

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

Back to the top