Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Help: Error , thread with GEF
Help: Error , thread with GEF [message #215306] Fri, 28 April 2006 23:09 Go to next message
Eclipse UserFriend
Originally posted by: riky2008.hotmail.com

Can someone help me, if I use Thread, in order to
move the Figure from GEF , but unfortunately with me
always return errors, if I Thread with start() start
(wenn with run(), then no problem, but that is not Thread),
then following errors:


Exception in thread "Thread-5" java.lang.NullPointerException
at
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.java:174)
at
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateManager.java:117)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1351)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.revalidate(Figure.java:1353)
at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1464)
at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(AbstractGraphicalEditPart.java:789)
at com.test.subject.parts.ShapePart.refreshVisuals(ShapePart.ja va:95)
at com.test.subject.parts.NodePart.propertyChange(NodePart.java :40)
at com.test.subject.parts.ShapePart.propertyChange(ShapePart.ja va:118)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.test.subject.model.Element.firePropertyChange(Element.ja va:21)
at com.test.subject.model.StateShape.setName(StateShape.java:66 )
at com.test.subject.trace.RobotTrace.run(RobotTrace.java:310)
at java.lang.Thread.run(Unknown Source)

here ist code this method, which I think, error:
protected void refreshVisuals() {

Rectangle bounds = new Rectangle(getCastedModel().getLocation(),
getCastedModel().getSize());
createFigureForModel();

if(getFigure()!=null && ((GraphicalEditPart) getParent())!=null
&& bounds !=null && this != null)
((GraphicalEditPart) getParent()).setLayoutConstraint(this,
getFigure(), bounds);

}
Re: Help: Error , thread with GEF [message #215322 is a reply to message #215306] Sat, 29 April 2006 01:14 Go to previous message
cloudor Mising name is currently offline cloudor Mising nameFriend
Messages: 34
Registered: July 2009
Member
You should update figures in SWT thread. To do this, wrap your codes into a runnable object, and call Display.getDefault().syncExec(runnable).
Previous Topic:The example in the example of ibm Red book
Next Topic:How to control the adding of child figures
Goto Forum:
  


Current Time: Fri Apr 26 09:01:50 GMT 2024

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

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

Back to the top