Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » DiagramEditor refresh behaviour (When is the diagramEditor refresh triggered?)
DiagramEditor refresh behaviour [message #1087271] Thu, 15 August 2013 11:51 Go to next message
Marco Roque is currently offline Marco RoqueFriend
Messages: 16
Registered: July 2012
Junior Member
Hi everyone,

I am trying to animate a BPMN2 diagram and for that i'm executing customFeature after customFeature, which sometimes results in the exception bellow.
From what i understand this happens because the diagram has its own Refresh Thread that is painting the diagram from time to time, sometimes at the same time as i am executing a customFeature. Am i wrong?

Or, on the other hand, is the refresh a result of the execution of a customFeature which leaves the diagram in a dirty state?

Is there any way to turn off the automatic refresh and be my code to control the refresh of the diagram?

sorry for the questioning...

Many thanks in advance.

java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
at java.util.HashMap$KeyIterator.next(Unknown Source)
at org.eclipse.graphiti.ui.internal.editor.DiagramRefreshJob.runInUIThread(DiagramRefreshJob.java:104)
at org.eclipse.ui.progress.UIJob$1.run(UIJob.java:95)
at org.eclipse.swt.widgets.RunnableLock.run(RunnableLock.java:35)
at org.eclipse.swt.widgets.Synchronizer.runAsyncMessages(Synchronizer.java:135)
at org.eclipse.swt.widgets.Display.runAsyncMessages(Display.java:4144)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1053)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:942)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:86)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:588)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:543)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:124)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:110)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:79)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:353)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:629)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:584)
at org.eclipse.equinox.launcher.Main.run(Main.java:1438)
at org.eclipse.equinox.launcher.Main.main(Main.java:1414)


Regards
Marco Roque
Re: DiagramEditor refresh behaviour [message #1092909 is a reply to message #1087271] Fri, 23 August 2013 10:09 Go to previous message
Felix Velasco is currently offline Felix VelascoFriend
Messages: 43
Registered: July 2009
Member
The refreshJob is launched by the platform as a response to the changes in the model (see DiagramChangeListener), so, yes, its periodical running is the result of launching CustomFeature after CustomFeature.

To prevent the ConcurrentModificacionException, you could try launching the CustomFeature in the UIThread (Display.syncExec).

Regarding your control of the refresh job, well, the answer is yes and no. No, you can't turn off automatic refresh (at least not easily), but yes you can control it, since it's running because of your changes.

All in all, the biggest problem with the animation is that your command stack will become polluted with all the small changes you are adding, and there's no way around that.
Previous Topic:DiagramEditor mouse over
Next Topic:Update/refresh automatically feature
Goto Forum:
  


Current Time: Fri Apr 26 22:30:55 GMT 2024

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

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

Back to the top