| Summary: | problem about removing intermodel connections in multi-editors | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Jens Von Pilgrim <developer> | ||||
| Component: | Gef3d | Assignee: | Jens Von Pilgrim <developer> | ||||
| Status: | RESOLVED FIXED | QA Contact: | |||||
| Severity: | critical | ||||||
| Priority: | P3 | ||||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | All | ||||||
| OS: | All | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
fixed (rev. 562) When an anchor is set, a 3D owner must exist in order to calculate the 3D location of the anchor. This is not the case when the anchor is removed, by setting a null value. I forgot this last case, thanks for the report. Created attachment 193250 [details]
mylyn/context/zip
|
Bug description copied from GEF3D newsgroup, author: Dennis Chen 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?