Skip to main content



      Home
Home » Eclipse Projects » GEF » Change the location of a Figure in a different thread
Change the location of a Figure in a different thread [message #50677] Sun, 22 December 2002 15:44 Go to next message
Eclipse UserFriend
Originally posted by: truenoto.yahoo.com

In a GEF plugin that I am working on, I create a Pop up menu command in
which I spawn a thread and change the locations of all the figures in the
diagram.

I use the setLocation() function to change the location but I get and a
NullPointerException when I invoke my command.

Is it because I call setLocation() in a different thread? But I change the
setLocation() is implemented the same as the setLocation() of the
LogicSubPart of the Logic Editor. It basically fires a Property Change
event. So I don't know why this will cause a problem if I call setLocation
in a same thread or a different thread.

If I want to change the location in a different, what should I do?

I notice I can change the location thru the Property View. Is that done in a
different thread or the same thread?

Thanks for any help.

<<<< Complete Stack dump >>>>

java.lang.NullPointerException

at
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.jav
a:100)

at
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateMana
ger.java:61)

at org.eclipse.draw2d.Figure.revalidate(Figure.java:1130)

at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)

at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)

at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)

at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)

at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1241)

at
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(Abst
ractGraphicalEditPart.java:763)

at
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.refreshVisual
s(LogicEditPart.java:204)

at
org.eclipse.gef.examples.logicdesigner.edit.UmlClassEditPart .refreshVisuals(
UmlClassEditPart.java:106)

at
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.propertyChang
e(LogicEditPart.java:193)

at
java.beans.PropertyChangeSupport.firePropertyChange(Property ChangeSupport.ja
va:252)

at
org.eclipse.gef.examples.logicdesigner.model.core.LogicEleme nt.firePropertyC
hange(LogicElement.java:30)

at
org.eclipse.gef.examples.logicdesigner.model.core.LogicSubpa rt.setLocation(L
ogicSubpart.java:178)

at
org.eclipse.gef.examples.logicdesigner.autolayout.SpringLayo utGraph$1.graphL
ayoutUpdated(SpringLayoutGraph.java:51)

at
de.fzi.wim.guibase.graphview.graph.AbstractGraph.notifyLayou tUpdated(Abstrac
tGraph.java:43)

at
de.fzi.wim.guibase.graphview.layout.Layouter$LayouterThread. run(Layouter.jav
a:79)
Re: Change the location of a Figure in a different thread [message #50705 is a reply to message #50677] Sun, 22 December 2002 17:26 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: truenoto.yahoo.com

The reason I spawn another thread to change the locations of all the figures
is I want to achieve some kind of animation effect. So I appreciate what can
I do to change the location of the figures in diagram in this new thread?


"Takumi Fujiwara" <truenoto@yahoo.com> wrote in message
news:au57n9$dj7$1@rogue.oti.com...
> In a GEF plugin that I am working on, I create a Pop up menu command in
> which I spawn a thread and change the locations of all the figures in the
> diagram.
>
> I use the setLocation() function to change the location but I get and a
> NullPointerException when I invoke my command.
>
> Is it because I call setLocation() in a different thread? But I change the
> setLocation() is implemented the same as the setLocation() of the
> LogicSubPart of the Logic Editor. It basically fires a Property Change
> event. So I don't know why this will cause a problem if I call setLocation
> in a same thread or a different thread.
>
> If I want to change the location in a different, what should I do?
>
> I notice I can change the location thru the Property View. Is that done in
a
> different thread or the same thread?
>
> Thanks for any help.
>
> <<<< Complete Stack dump >>>>
>
> java.lang.NullPointerException
>
> at
>
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.jav
> a:100)
>
> at
>
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateMana
> ger.java:61)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1130)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1241)
>
> at
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(Abst
> ractGraphicalEditPart.java:763)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.refreshVisual
> s(LogicEditPart.java:204)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.UmlClassEditPart .refreshVisuals(
> UmlClassEditPart.java:106)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.propertyChang
> e(LogicEditPart.java:193)
>
> at
>
java.beans.PropertyChangeSupport.firePropertyChange(Property ChangeSupport.ja
> va:252)
>
> at
>
org.eclipse.gef.examples.logicdesigner.model.core.LogicEleme nt.firePropertyC
> hange(LogicElement.java:30)
>
> at
>
org.eclipse.gef.examples.logicdesigner.model.core.LogicSubpa rt.setLocation(L
> ogicSubpart.java:178)
>
> at
>
org.eclipse.gef.examples.logicdesigner.autolayout.SpringLayo utGraph$1.graphL
> ayoutUpdated(SpringLayoutGraph.java:51)
>
> at
>
de.fzi.wim.guibase.graphview.graph.AbstractGraph.notifyLayou tUpdated(Abstrac
> tGraph.java:43)
>
> at
>
de.fzi.wim.guibase.graphview.layout.Layouter$LayouterThread. run(Layouter.jav
> a:79)
>
>
Re: Change the location of a Figure in a different thread [message #50761 is a reply to message #50677] Sun, 22 December 2002 22:26 Go to previous message
Eclipse UserFriend
Originally posted by: hudsonr.us.eye-bee-em.com

You can animate without spawning a thread. When you have finished updating
the figures' bounds, call figure.getUpdateManager.performUpdate() to cause
an immediate repaint. Then move the figures and do this again, until the
animation is complete. This will block the UI, so the animation should be
brief.

The palette does exactly this. See AnimatableFigure


"Takumi Fujiwara" <truenoto@yahoo.com> wrote in message
news:au57n9$dj7$1@rogue.oti.com...
> In a GEF plugin that I am working on, I create a Pop up menu command in
> which I spawn a thread and change the locations of all the figures in the
> diagram.
>
> I use the setLocation() function to change the location but I get and a
> NullPointerException when I invoke my command.
>
> Is it because I call setLocation() in a different thread? But I change the
> setLocation() is implemented the same as the setLocation() of the
> LogicSubPart of the Logic Editor. It basically fires a Property Change
> event. So I don't know why this will cause a problem if I call setLocation
> in a same thread or a different thread.
>
> If I want to change the location in a different, what should I do?
>
> I notice I can change the location thru the Property View. Is that done in
a
> different thread or the same thread?
>
> Thanks for any help.
>
> <<<< Complete Stack dump >>>>
>
> java.lang.NullPointerException
>
> at
>
org.eclipse.draw2d.DeferredUpdateManager.queueWork(DeferredU pdateManager.jav
> a:100)
>
> at
>
org.eclipse.draw2d.DeferredUpdateManager.addInvalidFigure(De ferredUpdateMana
> ger.java:61)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1130)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.revalidate(Figure.java:1132)
>
> at org.eclipse.draw2d.Figure.setConstraint(Figure.java:1241)
>
> at
>
org.eclipse.gef.editparts.AbstractGraphicalEditPart.setLayou tConstraint(Abst
> ractGraphicalEditPart.java:763)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.refreshVisual
> s(LogicEditPart.java:204)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.UmlClassEditPart .refreshVisuals(
> UmlClassEditPart.java:106)
>
> at
>
org.eclipse.gef.examples.logicdesigner.edit.core.LogicEditPa rt.propertyChang
> e(LogicEditPart.java:193)
>
> at
>
java.beans.PropertyChangeSupport.firePropertyChange(Property ChangeSupport.ja
> va:252)
>
> at
>
org.eclipse.gef.examples.logicdesigner.model.core.LogicEleme nt.firePropertyC
> hange(LogicElement.java:30)
>
> at
>
org.eclipse.gef.examples.logicdesigner.model.core.LogicSubpa rt.setLocation(L
> ogicSubpart.java:178)
>
> at
>
org.eclipse.gef.examples.logicdesigner.autolayout.SpringLayo utGraph$1.graphL
> ayoutUpdated(SpringLayoutGraph.java:51)
>
> at
>
de.fzi.wim.guibase.graphview.graph.AbstractGraph.notifyLayou tUpdated(Abstrac
> tGraph.java:43)
>
> at
>
de.fzi.wim.guibase.graphview.layout.Layouter$LayouterThread. run(Layouter.jav
> a:79)
>
>
Previous Topic:[jdt-ui-dev] Pre-reqs are not exported
Next Topic:Is this me or is this a bug?
Goto Forum:
  


Current Time: Thu May 01 01:30:27 EDT 2025

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

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

Back to the top