Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [gef-dev] Help: Error , thread with GEF


Figures form a tree-like data structure. This data structure is not thread-safe. For figures displayed on a canvas, you must modify figures on the UI thread using the same techniques you would use to update a native Tree.  i.e., Display#async/syncExec(Runnable).

-Randy




"ricky" <riky2008@xxxxxxxxxxx>
Sent by: gef-dev-bounces@xxxxxxxxxxx

04/28/2006 07:17 PM

Please respond to
GEF development <gef-dev@xxxxxxxxxxx>

To
"GEF development" <gef-dev@xxxxxxxxxxx>
cc
Subject
[gef-dev] Help: Error , thread with GEF





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
(es is hier unbelievably , wenn with run(), then no problem, but that is not Thread),
following errors message:


Exception in thread "Thread-5" java.lang.NullPointerException
at
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredUpdateManager.java:174)
at
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(DeferredUpdateManager.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.setLayoutConstraint(AbstractGraphicalEditPart.java:789)
at com.test.subject.parts.ShapePart.refreshVisuals(ShapePart.java:95)
at com.test.subject.parts.NodePart.propertyChange(NodePart.java:40)
at com.test.subject.parts.ShapePart.propertyChange(ShapePart.java:118)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at com.test.subject.model.Element.firePropertyChange(Element.java: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);

}

_______________________________________________
gef-dev mailing list
gef-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/gef-dev


Back to the top