Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 380163 - Connection label move does not behave correctly when the diagram is zoomed
Summary: Connection label move does not behave correctly when the diagram is zoomed
Status: CLOSED DUPLICATE of bug 346172
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Sapphire (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Ling Hao CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-21 12:07 EDT by Shenxue Zhou CLA
Modified: 2021-11-19 09:22 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Shenxue Zhou CLA 2012-05-21 12:07:05 EDT
With the latest support of zoom in diagram editor, when you zoom in a diagram, and try to move a connection label, the connection label jumps somewhere
other than where it was dropped. I also notice the following exception in the console:

java.lang.ClassCastException: org.eclipse.sapphire.ui.swt.gef.parts.SapphireMidpointLocator cannot be cast to org.eclipse.draw2d.geometry.Rectangle
	at org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getCurrentConstraintFor(XYLayoutEditPolicy.java:102)
	at org.eclipse.gef.editpolicies.XYLayoutEditPolicy.getConstraintFor(XYLayoutEditPolicy.java:55)
	at org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.getConstraintFor(ConstrainedLayoutEditPolicy.java:244)
	at org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.getAddCommand(ConstrainedLayoutEditPolicy.java:184)
	at org.eclipse.gef.editpolicies.LayoutEditPolicy.getCommand(LayoutEditPolicy.java:216)
	at org.eclipse.gef.editpolicies.ConstrainedLayoutEditPolicy.getCommand(ConstrainedLayoutEditPolicy.java:214)
	at org.eclipse.gef.editparts.AbstractEditPart.getCommand(AbstractEditPart.java:502)
	at org.eclipse.gef.tools.DragEditPartsTracker.getCommand(DragEditPartsTracker.java:281)
	at org.eclipse.gef.tools.DragEditPartsTracker.handleDragInProgress(DragEditPartsTracker.java:370)
	at org.eclipse.gef.tools.AbstractTool.mouseDrag(AbstractTool.java:1114)
	at org.eclipse.gef.tools.SelectionTool.mouseDrag(SelectionTool.java:538)
	at org.eclipse.gef.EditDomain.mouseDrag(EditDomain.java:259)
	at org.eclipse.gef.ui.parts.DomainEventDispatcher.dispatchMouseMoved(DomainEventDispatcher.java:363)
	at org.eclipse.draw2d.LightweightSystem$EventHandler.mouseMove(LightweightSystem.java:543)
	at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:211)
	at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
	at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1053)
	at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4165)
	at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3754)
	at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2701)
	at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2665)
	at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2499)
	at org.eclipse.ui.internal.Workbench$7.run(Workbench.java:679)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:668)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:123)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	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(EclipseStarter.java:344)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.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:622)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1410)
	at org.eclipse.equinox.launcher.Main.main(Main.java:1386)
Comment 1 Shenxue Zhou CLA 2012-05-21 12:09:42 EDT
Ling, could you take a look at this? 

SapphireDiagramEditor's calculateRealMouseLocation() can be used to get a location which takes the scrolling and zooming into account.

Thanks,

Shenxue
Comment 2 Konstantin Komissarchik CLA 2012-05-21 14:00:37 EDT
Let's not split this off. Resolving this is an integral part of completing Bug 346172.

*** This bug has been marked as a duplicate of bug 346172 ***