From 3a6bb94efe52d38a771e97ab9123aa6031475ea9 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Wed, 25 Nov 2020 15:03:30 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-42237=20=E7=BB=84=E4=BB=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E8=BF=87=E7=A8=8B=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/EditingMouseListener.java | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 524dd8bf1..0dcab318f 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -194,7 +194,7 @@ public class EditingMouseListener extends MouseInputAdapter { e.translatePoint(oldX - e.getX(), oldY - e.getY()); } - private void offsetEventPoint(MouseEvent e){ + private void offsetEventPoint(MouseEvent e) { int x = designer.getRelativeX(e.getX()); int y = designer.getRelativeY(e.getY()); e.translatePoint(x - e.getX(), y - e.getY()); @@ -206,8 +206,8 @@ public class EditingMouseListener extends MouseInputAdapter { * @param e 鼠标事件 */ public void mouseReleased(MouseEvent e) { - MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); - MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); + MouseEvent transEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); + MouseEvent clickEvent = new MouseEvent(e.getComponent(), MouseEvent.MOUSE_CLICKED, e.getWhen(), e.getModifiers(), e.getX(), e.getY(), e.getXOnScreen(), e.getYOnScreen(), e.getClickCount(), e.isPopupTrigger(), e.getButton()); int oldX = e.getX(); int oldY = e.getY(); offsetEventPoint(e); @@ -240,7 +240,7 @@ public class EditingMouseListener extends MouseInputAdapter { } } - private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent ) { + private boolean isAutoFire(MouseEvent transEvent, MouseEvent clickEvent) { offsetEventPoint(transEvent); XCreator xCreator = designer.getComponentAt(transEvent); return (pressX != clickEvent.getX() || pressY != clickEvent.getY()) @@ -662,6 +662,7 @@ public class EditingMouseListener extends MouseInputAdapter { */ public void startEditing(XCreator creator, DesignerEditor designerEditor, ComponentAdapter adapter) { if (designerEditor != null) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); Rectangle rect = ComponentUtils.getRelativeBounds(creator); currentEditor = designerEditor; currentXCreator = creator; @@ -728,15 +729,15 @@ public class EditingMouseListener extends MouseInputAdapter { /** * 刷新顶层组件 - * */ - public void refreshTopXCreator(boolean isEditing){ + */ + public void refreshTopXCreator(boolean isEditing) { designer.refreshTopXCreator(isEditing); } /** * 刷新顶层组件 - * */ - public void refreshTopXCreator(){ + */ + public void refreshTopXCreator() { refreshTopXCreator(false); } From 8da706423ca45aeb29d48e4793c56e659baa2aa0 Mon Sep 17 00:00:00 2001 From: "Yuan.Wang" <1536296691@qq.com> Date: Wed, 25 Nov 2020 15:36:42 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-42237=20=E4=BB=A3=E7=A0=81=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/designer/creator/XChartEditor.java | 4 ++++ .../java/com/fr/design/mainframe/EditingMouseListener.java | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java index c002bceb3..38cab33dc 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XChartEditor.java @@ -14,6 +14,7 @@ import com.fr.design.gui.chart.MiddleChartComponent; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.CoverReportPane; +import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.EditingMouseListener; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.HelpDialogManager; @@ -266,6 +267,9 @@ public class XChartEditor extends XBorderStyleWidgetCreator { if (editingMouseListener.stopEditing()) { if (this != (XCreator) designer.getRootComponent()) { ComponentAdapter adapter = AdapterBus.getComponentAdapter(designer, this); + if (isEditing) { + EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); + } editingMouseListener.startEditing(this, isEditing ? adapter.getDesignerEditor() : null, adapter); } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java index 0dcab318f..b9ce52fc5 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/EditingMouseListener.java @@ -662,7 +662,6 @@ public class EditingMouseListener extends MouseInputAdapter { */ public void startEditing(XCreator creator, DesignerEditor designerEditor, ComponentAdapter adapter) { if (designerEditor != null) { - EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); Rectangle rect = ComponentUtils.getRelativeBounds(creator); currentEditor = designerEditor; currentXCreator = creator;