Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF3D » problem about removing intermodel connections in multi-editors
problem about removing intermodel connections in multi-editors [message #665291] Thu, 14 April 2011 07:44 Go to next message
Dennis Chen is currently offline Dennis Chen
Messages: 4
Registered: April 2011
Junior Member
Hi!
Now I am studying GEF3D, want to develop a multi-editor. when removing intermodel connections between two nodes which come from different diagrams, there will be some errors like this:

java.lang.NullPointerException
at org.eclipse.draw3d.PolylineConnection3D.setTargetAnchor(Poly lineConnection3D.java:423)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.deactiv ateFigure(AbstractConnectionEditPart.java:124)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.removeN otify(AbstractConnectionEditPart.java:246)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.setPare nt(AbstractConnectionEditPart.java:258)
at org.eclipse.gef.editparts.AbstractConnectionEditPart.setTarg et(AbstractConnectionEditPart.java:293)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.removeTa rgetConnection(AbstractGraphicalEditPart.java:758)
at org.eclipse.gef.editparts.AbstractGraphicalEditPart.refreshT argetConnections(AbstractGraphicalEditPart.java:683)
at hellogef.control.NodePart.propertyChange(NodePart.java:69)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at java.beans.PropertyChangeSupport.firePropertyChange(Unknown Source)
at hellogef.model.AbstractModel.fireStructureChange(AbstractMod el.java:78)
at hellogef.model.NodeModel.removeInput(NodeModel.java:73)
at hellogef.command.DeleteConnectionCommand.execute(DeleteConne ctionCommand.java:31)
at org.eclipse.gef.commands.CompoundCommand.execute(CompoundCom mand.java:107)
at org.eclipse.gef.commands.CommandStack.execute(CommandStack.j ava:170)
at org.eclipse.gef.ui.actions.WorkbenchPartAction.execute(Workb enchPartAction.java:76)
at org.eclipse.gef.ui.actions.DeleteAction.run(DeleteAction.jav a:125)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498 )
at org.eclipse.jface.commands.ActionHandler.execute(ActionHandl er.java:119)
at org.eclipse.core.commands.Command.executeWithChecks(Command. java:476)
at org.eclipse.core.commands.ParameterizedCommand.executeWithCh ecks(ParameterizedCommand.java:508)
at org.eclipse.ui.internal.handlers.HandlerService.executeComma nd(HandlerService.java:169)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.executeComman d(WorkbenchKeyboard.java:470)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.press(Workben chKeyboard.java:824)
at org.eclipse.ui.internal.keys.WorkbenchKeyboard.processKeyEve nt(WorkbenchKeyboard.java:880)
at org.eclipse.ui.internal.keys.OutOfOrderListener.handleEvent( OutOfOrderListener.java:76)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :84)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1003)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1027)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1012)
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1040 )
at org.eclipse.swt.widgets.Widget.sendKeyEvent(Widget.java:1036 )
at org.eclipse.swt.widgets.Widget.wmKeyDown(Widget.java:1669)
at org.eclipse.swt.widgets.Control.WM_KEYDOWN(Control.java:4281 )
at org.eclipse.swt.widgets.Control.windowProc(Control.java:3977 )
at org.eclipse.swt.widgets.Canvas.windowProc(Canvas.java:342)
at org.eclipse.swt.widgets.Display.windowProc(Display.java:4602 )
at org.eclipse.swt.internal.win32.OS.DispatchMessageW(Native Method)
at org.eclipse.swt.internal.win32.OS.DispatchMessage(OS.java:24 09)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :3471)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:2405)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2369)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:22 21)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:500)
at org.eclipse.core.databinding.observable.Realm.runWithDefault (Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:493)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:149)
at org.eclipse.ui.internal.ide.application.IDEApplication.start (IDEApplication.java:113)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(Eclips eAppHandle.java:194)
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(EclipseS tarter.java:368)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:179)
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: 559)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:514)
at org.eclipse.equinox.launcher.Main.run(Main.java:1311)
at org.eclipse.equinox.launcher.Main.main(Main.java:1287)

By error tracing, I found deactivateFigure method in org.eclipse.gef.editparts.AbstractConnectionEditPart class have a line is: getConnectionFigure().setSourceAnchor(null), this method will call setSourceAnchor() method in org.eclipse.draw3d.PolylineConnection3D class:

public void setSourceAnchor(ConnectionAnchor anchor) {
if (anchor == startAnchor) {
return;
}

// comments added by myself

// if (!(anchor instanceof ConnectionAnchor3D)) {
// if (Figure3DHelper.getAncestor3D(anchor.getOwner()) == null) {
// throw new IllegalArgumentException(
// "Cannot set 2D anchor w/o available 3D owner, you probably"
// + "would subclass your connection edit part from a 3D base class");
// }
// }
unhookSourceAnchor();
// No longer needed, revalidate does this. (original comment)
// getConnectionRouter().invalidate(this); (originally uncommented)
startAnchor = anchor;
if (getParent() != null) {
hookSourceAnchor();
}
revalidate();
}

Only to comment these lines, errors will be disappeared. that means that parameter must not be null. why? And, may I do it like that?
Re: problem about removing intermodel connections in multi-editors [message #665371 is a reply to message #665291] Thu, 14 April 2011 12:57 Go to previous messageGo to next message
Jens von Pilgrim is currently offline Jens von Pilgrim
Messages: 295
Registered: July 2009
Senior Member
Dennis,

thank you for the report. I filed a bug report
http://bugs.eclipse.org/342830
and fixed it in rev. 562.

Can you confirm it to be fixed?

If you find other issues, feel free to report a bug yourself ;-)

Cheers,
Jens
Re: problem about removing intermodel connections in multi-editors [message #665623 is a reply to message #665371] Fri, 15 April 2011 09:59 Go to previous message
Dennis Chen is currently offline Dennis Chen
Messages: 4
Registered: April 2011
Junior Member
Dear Jens,
Now I just developed a sample multi-editor, so by my fixing, I haven't find other errors. If I found some issues, I will report them.
Besides, what is "rev. 562"? I cann't find it?How can I find your fixed file?
I'm very much obliged to you.
Dennis
Previous Topic:Engilish version of GEF goes 3D Teil2 and Teil3
Next Topic:Is GEF3D needed for Fish Eye view?
Goto Forum:
  


Current Time: Thu Oct 23 05:14:07 GMT 2014

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

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