diff --git a/org.eclipse.wb.core/src-draw2d/org/eclipse/wb/internal/draw2d/EventManager.java b/org.eclipse.wb.core/src-draw2d/org/eclipse/wb/internal/draw2d/EventManager.java index bfc46fa10..8b4a6c4f8 100644 --- a/org.eclipse.wb.core/src-draw2d/org/eclipse/wb/internal/draw2d/EventManager.java +++ b/org.eclipse.wb.core/src-draw2d/org/eclipse/wb/internal/draw2d/EventManager.java @@ -12,13 +12,9 @@ *******************************************************************************/ package org.eclipse.wb.internal.draw2d; -import org.eclipse.wb.draw2d.FigureUtils; - import org.eclipse.draw2d.EventDispatcher; import org.eclipse.draw2d.IFigure; import org.eclipse.draw2d.MouseEvent; -import org.eclipse.draw2d.geometry.Point; -import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.swt.events.FocusEvent; import org.eclipse.swt.events.KeyEvent; import org.eclipse.swt.events.TraverseEvent; @@ -221,17 +217,7 @@ private void sendEvent(Runnable event, m_targetFigure = m_captureFigure == null ? m_cursorFigure : m_captureFigure; // if (m_targetFigure != null) { - m_currentEvent = new MouseEvent(null, m_targetFigure, e); - // - Rectangle bounds = m_targetFigure.getBounds(); - Point location = new Point(m_currentEvent.x - bounds.x, m_currentEvent.y - bounds.y); - location.x += m_canvas.getViewport().getHorizontalRangeModel().getValue(); - location.y += m_canvas.getViewport().getVerticalRangeModel().getValue(); - FigureUtils.translateAbsoluteToFigure(m_targetFigure, location); - // - m_currentEvent.x = location.x; - m_currentEvent.y = location.y; - // + m_currentEvent = new MouseEvent(this, m_targetFigure, e); event.run(); } } diff --git a/org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/PaletteComposite.java b/org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/PaletteComposite.java index f0527bb49..c30ef0551 100644 --- a/org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/PaletteComposite.java +++ b/org.eclipse.wb.core/src/org/eclipse/wb/core/controls/palette/PaletteComposite.java @@ -765,8 +765,9 @@ protected void paintClientArea(Graphics graphics) { * @return the {@link Rectangle} of title. */ private Rectangle getTitleRectangle() { - Rectangle r = getClientArea().getCopy(); - translateToRelative(r); + Rectangle r = Rectangle.SINGLETON; + r.setBounds(getClientArea()); + translateToParent(r); r.height = m_titleHeight; return r; } diff --git a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/layout/StackLayoutNavigationFigure.java b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/layout/StackLayoutNavigationFigure.java index 8859bc5e5..374aea71d 100644 --- a/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/layout/StackLayoutNavigationFigure.java +++ b/org.eclipse.wb.rcp/src/org/eclipse/wb/internal/rcp/gef/policy/layout/StackLayoutNavigationFigure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,6 +17,7 @@ import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.MouseEvent; import org.eclipse.draw2d.MouseListener; +import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.swt.custom.StackLayout; import org.eclipse.swt.graphics.Image; @@ -48,7 +49,12 @@ public StackLayoutNavigationFigure(StackLayoutSelectionEditPolicy policy) { @Override public void mousePressed(MouseEvent event) { event.consume(); - if (event.x < WIDTH) { + // + Point location = Point.SINGLETON; + location.setLocation(event.x, event.y); + translateFromParent(location); + // + if (location.x < WIDTH) { m_policy.showPrevComponent(); } else { m_policy.showNextComponent(); diff --git a/org.eclipse.wb.swing/META-INF/MANIFEST.MF b/org.eclipse.wb.swing/META-INF/MANIFEST.MF index be8c680be..a6ddbd50b 100644 --- a/org.eclipse.wb.swing/META-INF/MANIFEST.MF +++ b/org.eclipse.wb.swing/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: org.eclipse.wb.swing;singleton:=true -Bundle-Version: 1.10.200.qualifier +Bundle-Version: 1.10.300.qualifier Bundle-ClassPath: . Bundle-Activator: org.eclipse.wb.internal.swing.Activator Bundle-Vendor: %providerName @@ -90,7 +90,7 @@ Import-Package: org.apache.commons.collections4;version="[4.4.0,5.0.0)", Require-Bundle: org.eclipse.ui;bundle-version="[3.206.0,4.0.0)", org.eclipse.core.runtime;bundle-version="[3.31.100,4.0.0)", org.eclipse.core.resources;bundle-version="[3.20.200,4.0.0)", - org.eclipse.wb.core;bundle-version="[1.20.0,2.0.0)";visibility:=reexport, + org.eclipse.wb.core;bundle-version="[1.21.0,2.0.0)";visibility:=reexport, org.eclipse.wb.core.ui;bundle-version="[1.10.800,2.0.0)";visibility:=reexport, org.eclipse.wb.core.java;bundle-version="[1.13.100,2.0.0)";visibility:=reexport, org.eclipse.draw2d;bundle-version="[3.20.0,4.0.0)", diff --git a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/CardNavigationFigure.java b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/CardNavigationFigure.java index a526d54fe..27e244713 100644 --- a/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/CardNavigationFigure.java +++ b/org.eclipse.wb.swing/src/org/eclipse/wb/internal/swing/gef/policy/layout/CardNavigationFigure.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2023 Google, Inc. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -17,6 +17,7 @@ import org.eclipse.draw2d.Graphics; import org.eclipse.draw2d.MouseEvent; import org.eclipse.draw2d.MouseListener; +import org.eclipse.draw2d.geometry.Point; import org.eclipse.draw2d.geometry.Rectangle; import org.eclipse.swt.graphics.Image; @@ -46,7 +47,12 @@ public CardNavigationFigure(CardLayoutSelectionEditPolicy policy) { @Override public void mousePressed(MouseEvent event) { event.consume(); - if (event.x < WIDTH) { + // + Point location = Point.SINGLETON; + location.setLocation(event.x, event.y); + translateFromParent(location); + // + if (location.x < WIDTH) { m_policy.showPrevComponent(); } else { m_policy.showNextComponent(); diff --git a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/draw2d/FigureEventTest.java b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/draw2d/FigureEventTest.java index c663f180c..8e65e9f68 100644 --- a/org.eclipse.wb.tests/src/org/eclipse/wb/tests/draw2d/FigureEventTest.java +++ b/org.eclipse.wb.tests/src/org/eclipse/wb/tests/draw2d/FigureEventTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2024 Google, Inc. and others. + * Copyright (c) 2011, 2025 Google, Inc. and others. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at @@ -127,41 +127,41 @@ public String toString() { { m_sender.moveTo(15, 15); // - expectedLogger.log("mouseMove = MouseEvent(5,5) to Figure: figure11"); + expectedLogger.log("mouseMove = MouseEvent(15,15) to Figure: figure11"); actualLogger.assertEquals(expectedLogger); } // click over "figure11" { m_sender.click(20, 20, 3); // - expectedLogger.log("mouseDown = MouseEvent(10,10) to Figure: figure11"); - expectedLogger.log("mouseUp = MouseEvent(10,10) to Figure: figure11"); + expectedLogger.log("mouseDown = MouseEvent(20,20) to Figure: figure11"); + expectedLogger.log("mouseUp = MouseEvent(20,20) to Figure: figure11"); actualLogger.assertEquals(expectedLogger); } // double click over "figure21" { m_sender.doubleClick(60, 60, 2); // - expectedLogger.log("mouseDown = MouseEvent(10,10) to Figure: figure21"); - expectedLogger.log("mouseUp = MouseEvent(10,10) to Figure: figure21"); - expectedLogger.log("mouseDown = MouseEvent(10,10) to Figure: figure21"); - expectedLogger.log("mouseDoubleClick = MouseEvent(10,10) to Figure: figure21"); - expectedLogger.log("mouseUp = MouseEvent(10,10) to Figure: figure21"); + expectedLogger.log("mouseDown = MouseEvent(60,60) to Figure: figure21"); + expectedLogger.log("mouseUp = MouseEvent(60,60) to Figure: figure21"); + expectedLogger.log("mouseDown = MouseEvent(60,60) to Figure: figure21"); + expectedLogger.log("mouseDoubleClick = MouseEvent(60,60) to Figure: figure21"); + expectedLogger.log("mouseUp = MouseEvent(60,60) to Figure: figure21"); actualLogger.assertEquals(expectedLogger); } // move to "figure12" { m_sender.moveTo(420, 330); // - expectedLogger.log("mouseMove = MouseEvent(20,30) to Figure: figure12"); + expectedLogger.log("mouseMove = MouseEvent(420,330) to Figure: figure12"); actualLogger.assertEquals(expectedLogger); } // click over "figure22" { m_sender.click(200, 300, 5); // - expectedLogger.log("mouseDown = MouseEvent(50,50) to Figure: figure22"); - expectedLogger.log("mouseUp = MouseEvent(50,50) to Figure: figure22"); + expectedLogger.log("mouseDown = MouseEvent(200,300) to Figure: figure22"); + expectedLogger.log("mouseUp = MouseEvent(200,300) to Figure: figure22"); actualLogger.assertEquals(expectedLogger); } // move to point without figures