From 5d7f2db6a7681a87cffc7be835a950b6a9293c8a Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 11:50:04 +0800 Subject: [PATCH 1/9] =?UTF-8?q?REPORT-59932=20=E3=80=90=E5=9B=BA=E5=AE=9A?= =?UTF-8?q?=E5=B8=83=E5=B1=80-=E5=8E=9F=E5=B8=83=E5=B1=80=E6=8E=A8?= =?UTF-8?q?=E8=8D=904.1=E3=80=91=E5=89=AA=E5=88=87=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/models/SelectionModel.java | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index df645e2df..ca9d5d9d3 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -140,11 +140,28 @@ public class SelectionModel { if (cutSelection != null) { cutSelection.cut2ClipBoard(clipboard); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); + setSelectedCreator(ifSelectParaComponent() ? designer.getParaComponent() : designer.getRootComponent()); designer.repaint(); } } } + /** + * 判断是否选中参数面板中的组件 + * @return boolean + */ + private boolean ifSelectParaComponent() { + XCreator[] roots = selection.getSelectedCreators(); + if (roots.length > 0) { + for (XCreator creator : roots) { + if ((creator.getParent() instanceof XWParameterLayout)) { + return true; + } + } + } + return false; + } + /** * 复制当前选中的组件到剪切板 */ @@ -320,8 +337,7 @@ public class SelectionModel { } designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_DELETED); - setSelectedCreator(isInPara ? designer.getParaComponent() : designer.getRootComponent()); - + setSelectedCreator(isInPara? designer.getParaComponent() : designer.getRootComponent()); // 触发事件 designer.repaint(); From 6a280163706ef6499bf6449304f56c13663ede86 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 13:43:09 +0800 Subject: [PATCH 2/9] =?UTF-8?q?=E5=91=BD=E5=90=8D=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/designer/beans/models/SelectionModel.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java index ca9d5d9d3..963f60e6c 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/models/SelectionModel.java @@ -140,7 +140,7 @@ public class SelectionModel { if (cutSelection != null) { cutSelection.cut2ClipBoard(clipboard); designer.getEditListenerTable().fireCreatorModified(DesignerEvent.CREATOR_CUTED); - setSelectedCreator(ifSelectParaComponent() ? designer.getParaComponent() : designer.getRootComponent()); + setSelectedCreator(hasSelectedParaComponent() ? designer.getParaComponent() : designer.getRootComponent()); designer.repaint(); } } @@ -150,7 +150,7 @@ public class SelectionModel { * 判断是否选中参数面板中的组件 * @return boolean */ - private boolean ifSelectParaComponent() { + private boolean hasSelectedParaComponent() { XCreator[] roots = selection.getSelectedCreators(); if (roots.length > 0) { for (XCreator creator : roots) { From f88caa05f10f5da9a203b93a67eb8f436e5c2e42 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 14:09:16 +0800 Subject: [PATCH 3/9] REPORT-59948 && REPORT-59948 --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 6 ++++-- .../ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java | 7 ------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 648a2845d..abaf6f068 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -29,7 +29,9 @@ import com.fr.design.scrollruler.VerticalRuler; import com.fr.design.utils.ComponentUtils; import com.fr.design.utils.gui.LayoutUtils; import com.fr.form.main.mobile.FormMobileAttr; +import com.fr.form.ui.container.WBodyLayoutType; import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WFitLayout; import com.fr.general.IOUtils; import com.fr.stable.AssistUtils; @@ -209,7 +211,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { GUICoreUtils.showPopupMenu(popupMenu, fixLayoutSwitchButton, 0, -59); } }); - + button.setVisible(((WFitLayout) designer.getRootComponent().toData()).getBodyLayoutType() != WBodyLayoutType.ABSOLUTE); return button; } @@ -258,7 +260,7 @@ public class FormArea extends JComponent implements ScrollRulerComponent { public void switchBodyLayout(XLayoutContainer xLayoutContainer) { this.fixLayoutSwitchButton.setVisible(xLayoutContainer.supportFixLayout()); - this.switchLayout(true); + this.switchLayout(false); } private void switchLayout(boolean isFixLayout) { diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java index 78c49d6f2..6db75c171 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/layout/FRAbsoluteBodyLayoutDefinePane.java @@ -4,11 +4,9 @@ import com.fr.base.io.IOFile; import com.fr.base.iofile.attr.WatermarkAttr; import com.fr.base.theme.FormTheme; import com.fr.base.theme.TemplateTheme; -import com.fr.base.theme.settings.ThemedComponentStyle; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.creator.XCreator; -import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWFitLayout; import com.fr.design.designer.properties.items.FRLayoutTypeItems; import com.fr.design.designer.properties.items.Item; @@ -23,7 +21,6 @@ import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.DesignerContext; -import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.WidgetPropertyPane; import com.fr.design.mainframe.widget.accessibles.AccessibleBodyWatermarkEditor; import com.fr.design.widget.FRWidgetFactory; @@ -41,9 +38,6 @@ import javax.swing.DefaultComboBoxModel; import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; - import static javax.swing.JOptionPane.OK_CANCEL_OPTION; import static javax.swing.JOptionPane.OK_OPTION; import static javax.swing.JOptionPane.WARNING_MESSAGE; @@ -170,7 +164,6 @@ public class FRAbsoluteBodyLayoutDefinePane extends FRAbsoluteLayoutDefinePane { stylePane.populateBean((LayoutBorderStyle) ob.getBorderStyle()); boundPane.populate(); watermarkEditor.setValue(ReportUtils.getWatermarkAttrFromTemplate(getCurrentIOFile())); - WidgetPropertyPane.getInstance().getEditingFormDesigner().switchBodyLayout((XLayoutContainer) creator); } public WAbsoluteBodyLayout updateSubPane() { From 5f6c301db71885ec4ec740193bd26d7ccfebb473 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 24 Sep 2021 15:10:52 +0800 Subject: [PATCH 4/9] =?UTF-8?q?REPORT-59905&REPORT-59952=20=E8=8B=A5?= =?UTF-8?q?=E5=B9=B2bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/widget/ui/designer/NewFormPane.java | 13 +++++++++++-- .../com/fr/design/form/layouts/templates/2-4/1.frm | 3 --- .../com/fr/design/form/layouts/templates/2-4/2.frm | 3 --- .../com/fr/design/form/layouts/templates/2-4/3.frm | 3 --- .../com/fr/design/form/layouts/templates/2-4/4.frm | 3 --- .../com/fr/design/form/layouts/templates/2-4/5.frm | 3 --- .../com/fr/design/form/layouts/templates/2-4/6.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/1.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/2.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/3.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/4.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/5.frm | 3 --- .../com/fr/design/form/layouts/templates/5-7/6.frm | 3 --- .../fr/design/form/layouts/templates/multi/1.frm | 3 --- .../fr/design/form/layouts/templates/multi/2.frm | 3 --- .../fr/design/form/layouts/templates/multi/3.frm | 3 --- .../fr/design/form/layouts/templates/multi/4.frm | 3 --- .../fr/design/form/layouts/templates/multi/5.frm | 3 --- .../fr/design/form/layouts/templates/multi/6.frm | 3 --- 19 files changed, 11 insertions(+), 56 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index f4e977ae6..c73f2f235 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -32,6 +32,7 @@ import javax.swing.event.ListSelectionEvent; import javax.swing.event.ListSelectionListener; import java.awt.BorderLayout; import java.awt.Color; +import java.awt.Component; import java.awt.Dimension; import java.awt.GridLayout; import java.awt.event.MouseAdapter; @@ -84,6 +85,7 @@ public class NewFormPane extends BasicPane { }); dialog.setSize(new Dimension(900, 600)); GUICoreUtils.centerWindow(dialog); + dialog.setTitle(this.title4PopupWindow()); dialog.setResizable(false); dialog.setVisible(true); } @@ -93,7 +95,14 @@ public class NewFormPane extends BasicPane { list.setSelectionMode(ListSelectionModel.SINGLE_SELECTION); list.setModel(initListModel()); list.setSelectedIndex(0); - list.setCellRenderer(new DefaultListCellRenderer()); + list.setCellRenderer(new DefaultListCellRenderer() { + @Override + public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) { + super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); + this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 0)); + return this; + } + }); list.addListSelectionListener(new ListSelectionListener() { @Override public void valueChanged(ListSelectionEvent e) { @@ -257,7 +266,7 @@ public class NewFormPane extends BasicPane { try { if (StringUtils.isNotEmpty(path)) { Form form = new Form(); - form.readStream(NewFormPane.class.getResourceAsStream(path)); + form.readStream(NewFormPane.class.getResourceAsStream(path), true); jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); } else { jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm index 941abbbb1..2e049900d 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm @@ -113,7 +113,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm index 0b04d5e7d..568302e17 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm @@ -122,7 +122,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm index 43cc0b93b..51c1663dd 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm @@ -131,7 +131,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm index d6b0ba42b..9d9287f98 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm @@ -131,7 +131,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm index 167db8fd2..80aecc1ac 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm @@ -131,7 +131,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm index 504bfbd12..e536bcec9 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm @@ -131,7 +131,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm index 24df43d5c..a7881cd9f 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm @@ -140,7 +140,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm index e7f9d76d0..bd56aaa15 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm @@ -140,7 +140,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm index 1b1f1e1a4..62729e1d0 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm @@ -149,7 +149,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm index dcd003aa1..44f8964ca 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm @@ -149,7 +149,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm index 98a3ac6f9..7a0906d07 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm @@ -158,7 +158,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm index 34d579ed5..93db94740 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm @@ -158,7 +158,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm index 710ccc3bd..b68f35f2e 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm @@ -167,7 +167,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm index 2bfe6c198..2033e2f70 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm @@ -176,7 +176,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm index e80cd4303..741cc8044 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm @@ -176,7 +176,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm index 21eac8ae6..9784af2ff 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm @@ -176,7 +176,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm index 5dde2178e..a10a18e3c 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm @@ -176,7 +176,4 @@ - - - diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm index 3644ecff8..f37a18830 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm @@ -185,7 +185,4 @@ - - - From ac008319d7992d2d5681efd8fb0acce01f93eb51 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 16:35:00 +0800 Subject: [PATCH 5/9] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/fr/design/mainframe/FormArea.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index abaf6f068..4596ac787 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -211,10 +211,15 @@ public class FormArea extends JComponent implements ScrollRulerComponent { GUICoreUtils.showPopupMenu(popupMenu, fixLayoutSwitchButton, 0, -59); } }); - button.setVisible(((WFitLayout) designer.getRootComponent().toData()).getBodyLayoutType() != WBodyLayoutType.ABSOLUTE); + button.setVisible(!isAbsoluteBodyLayout()); return button; } + private boolean isAbsoluteBodyLayout() { + return ((WFitLayout) designer.getRootComponent().toData()).getBodyLayoutType() == WBodyLayoutType.ABSOLUTE; + } + + /** * 增加表单的页面大小控制界面,包括手动修改和滑块拖动 From a4f08dcb02bfec117b3ad1767a40c2dac2bc53db Mon Sep 17 00:00:00 2001 From: Starryi Date: Thu, 23 Sep 2021 16:25:11 +0800 Subject: [PATCH 6/9] =?UTF-8?q?REPORT-55989=20mac=E7=9A=84=E8=A7=A6?= =?UTF-8?q?=E6=8E=A7=E6=9D=BF=E5=B7=A6=E5=8F=B3=E6=BB=91=E5=8A=A8=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E8=AE=BE=E8=AE=A1=E5=99=A8=E7=9A=84=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E4=B8=BB=E4=BD=93=E9=9D=A2=E6=9D=BF=E6=98=AF=E4=B8=8A=E4=B8=8B?= =?UTF-8?q?=E6=BB=9A=E5=8A=A8=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 1. 移植JScrollPane的触摸板滚轮交互逻辑到表单布局和报表网格面板中 2. 复用表单和报表的滚轮处理逻辑, 表单和报表各自实现所需的接口即可 【改动思路】 同上 --- .../DesignerScaleMouseWheelHandler.java | 31 ++ .../DesignerTranslateMouseWheelHandler.java | 279 ++++++++++++++++++ .../com/fr/design/mainframe/FormArea.java | 31 +- .../mainframe/FormAreaMouseWheelHandler.java | 75 +++++ .../mainframe/ReportComponentComposite.java | 17 +- ...rtComponentCompositeMouseWheelHandler.java | 75 +++++ 6 files changed, 480 insertions(+), 28 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/DesignerScaleMouseWheelHandler.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/DesignerTranslateMouseWheelHandler.java create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/FormAreaMouseWheelHandler.java create mode 100644 designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentCompositeMouseWheelHandler.java diff --git a/designer-form/src/main/java/com/fr/design/mainframe/DesignerScaleMouseWheelHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/DesignerScaleMouseWheelHandler.java new file mode 100644 index 000000000..15aec31d5 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/DesignerScaleMouseWheelHandler.java @@ -0,0 +1,31 @@ +package com.fr.design.mainframe; + +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/23 + */ +public class DesignerScaleMouseWheelHandler implements MouseWheelListener { + private final ScalePane scalePane; + private final int step; + + public DesignerScaleMouseWheelHandler(ScalePane scalePane, int step) { + this.scalePane = scalePane; + this.step = step; + } + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + int dir = e.getWheelRotation(); + JFormSliderPane slidePane = this.scalePane.getSlidePane(); + int old_resolution = slidePane.getShowValue(); + slidePane.setShowValue(old_resolution - (dir * step)); + } + + public interface ScalePane { + JFormSliderPane getSlidePane(); + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/DesignerTranslateMouseWheelHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/DesignerTranslateMouseWheelHandler.java new file mode 100644 index 000000000..82d2cb1b8 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/DesignerTranslateMouseWheelHandler.java @@ -0,0 +1,279 @@ +package com.fr.design.mainframe; + +import javax.swing.JScrollBar; +import javax.swing.JViewport; +import javax.swing.Scrollable; +import javax.swing.SwingConstants; +import java.awt.Component; +import java.awt.Rectangle; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; + +/** + * 实现设计器面板的触摸板滚动移动交互 https://work.fineres.com/browse/REPORT-55989 + * + * mouseWheelMoved 的具体实现来自 + * @link {javax.swing.plaf.basic.BasicScrollPaneUI.Handler#mouseWheelMoved} + * scrollByUnits 的具体实现来自 + * @link {javax.swing.plaf.basic.BasicScrollPaneUI#scrollByUnits} + * scrollByBlock 的具体实现来自 + * @link {javax.swing.plaf.basic.BasicScrollPaneUI#scrollByBlock} + */ +public class DesignerTranslateMouseWheelHandler implements MouseWheelListener { + private final ScrollPane scrollpane; + + public DesignerTranslateMouseWheelHandler(ScrollPane scrollpane) { + this.scrollpane = scrollpane; + } + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + if (scrollpane.isWheelScrollingEnabled() && + e.getWheelRotation() != 0) { + JScrollBar toScroll = scrollpane.getVerticalScrollBar(); + int direction = e.getWheelRotation() < 0 ? -1 : 1; + int orientation = SwingConstants.VERTICAL; + + // find which scrollbar to scroll, or return if none + if (toScroll == null || !toScroll.isVisible() + || e.isShiftDown()) { + toScroll = scrollpane.getHorizontalScrollBar(); + if (toScroll == null || !toScroll.isVisible()) { + return; + } + orientation = SwingConstants.HORIZONTAL; + } + + e.consume(); + + if (e.getScrollType() == MouseWheelEvent.WHEEL_UNIT_SCROLL) { + JViewport vp = scrollpane.getViewport(); + if (vp == null) { return; } + Component comp = vp.getView(); + int units = Math.abs(e.getUnitsToScroll()); + + // When the scrolling speed is set to maximum, it's possible + // for a single wheel click to scroll by more units than + // will fit in the visible area. This makes it + // hard/impossible to get to certain parts of the scrolling + // Component with the wheel. To make for more accurate + // low-speed scrolling, we limit scrolling to the block + // increment if the wheel was only rotated one click. + boolean limitScroll = Math.abs(e.getWheelRotation()) == 1; + + // Check if we should use the visibleRect trick + Object fastWheelScroll = toScroll.getClientProperty( + "JScrollBar.fastWheelScrolling"); + if (Boolean.TRUE == fastWheelScroll && + comp instanceof Scrollable) { + // 5078454: Under maximum acceleration, we may scroll + // by many 100s of units in ~1 second. + // + // BasicScrollBarUI.scrollByUnits() can bog down the EDT + // with repaints in this situation. However, the + // Scrollable interface allows us to pass in an + // arbitrary visibleRect. This allows us to accurately + // calculate the total scroll amount, and then update + // the GUI once. This technique provides much faster + // accelerated wheel scrolling. + Scrollable scrollComp = (Scrollable) comp; + Rectangle viewRect = vp.getViewRect(); + int startingX = viewRect.x; + boolean leftToRight = + comp.getComponentOrientation().isLeftToRight(); + int scrollMin = toScroll.getMinimum(); + int scrollMax = toScroll.getMaximum() - + toScroll.getModel().getExtent(); + + if (limitScroll) { + int blockIncr = + scrollComp.getScrollableBlockIncrement(viewRect, + orientation, + direction); + if (direction < 0) { + scrollMin = Math.max(scrollMin, + toScroll.getValue() - blockIncr); + } + else { + scrollMax = Math.min(scrollMax, + toScroll.getValue() + blockIncr); + } + } + + for (int i = 0; i < units; i++) { + int unitIncr = + scrollComp.getScrollableUnitIncrement(viewRect, + orientation, direction); + // Modify the visible rect for the next unit, and + // check to see if we're at the end already. + if (orientation == SwingConstants.VERTICAL) { + if (direction < 0) { + viewRect.y -= unitIncr; + if (viewRect.y <= scrollMin) { + viewRect.y = scrollMin; + break; + } + } + else { // (direction > 0 + viewRect.y += unitIncr; + if (viewRect.y >= scrollMax) { + viewRect.y = scrollMax; + break; + } + } + } + else { + // Scroll left + if ((leftToRight && direction < 0) || + (!leftToRight && direction > 0)) { + viewRect.x -= unitIncr; + if (leftToRight) { + if (viewRect.x < scrollMin) { + viewRect.x = scrollMin; + break; + } + } + } + // Scroll right + else if ((leftToRight && direction > 0) || + (!leftToRight && direction < 0)) { + viewRect.x += unitIncr; + if (leftToRight) { + if (viewRect.x > scrollMax) { + viewRect.x = scrollMax; + break; + } + } + } + else { + assert false : "Non-sensical ComponentOrientation / scroll direction"; + } + } + } + // Set the final view position on the ScrollBar + if (orientation == SwingConstants.VERTICAL) { + toScroll.setValue(viewRect.y); + } + else { + if (leftToRight) { + toScroll.setValue(viewRect.x); + } + else { + // rightToLeft scrollbars are oriented with + // minValue on the right and maxValue on the + // left. + int newPos = toScroll.getValue() - + (viewRect.x - startingX); + if (newPos < scrollMin) { + newPos = scrollMin; + } + else if (newPos > scrollMax) { + newPos = scrollMax; + } + toScroll.setValue(newPos); + } + } + } + else { + // Viewport's view is not a Scrollable, or fast wheel + // scrolling is not enabled. + scrollByUnits(toScroll, direction, + units, limitScroll); + } + } + else if (e.getScrollType() == + MouseWheelEvent.WHEEL_BLOCK_SCROLL) { + scrollByBlock(toScroll, direction); + } + } + } + + /* + * Method for scrolling by a unit increment. + * Added for mouse wheel scrolling support, RFE 4202656. + * + * If limitByBlock is set to true, the scrollbar will scroll at least 1 + * unit increment, but will not scroll farther than the block increment. + * See BasicScrollPaneUI.Handler.mouseWheelMoved(). + */ + static void scrollByUnits(JScrollBar scrollbar, int direction, + int units, boolean limitToBlock) { + // This method is called from BasicScrollPaneUI to implement wheel + // scrolling, as well as from scrollByUnit(). + int delta; + int limit = -1; + + if (limitToBlock) { + if (direction < 0) { + limit = scrollbar.getValue() - + scrollbar.getBlockIncrement(direction); + } + else { + limit = scrollbar.getValue() + + scrollbar.getBlockIncrement(direction); + } + } + + for (int i=0; i 0) { + delta = scrollbar.getUnitIncrement(direction); + } + else { + delta = -scrollbar.getUnitIncrement(direction); + } + + int oldValue = scrollbar.getValue(); + int newValue = oldValue + delta; + + // Check for overflow. + if (delta > 0 && newValue < oldValue) { + newValue = scrollbar.getMaximum(); + } + else if (delta < 0 && newValue > oldValue) { + newValue = scrollbar.getMinimum(); + } + if (oldValue == newValue) { + break; + } + + if (limitToBlock && i > 0) { + assert limit != -1; + if ((direction < 0 && newValue < limit) || + (direction > 0 && newValue > limit)) { + break; + } + } + scrollbar.setValue(newValue); + } + } + + /* + * Method for scrolling by a block increment. + * Added for mouse wheel scrolling support, RFE 4202656. + */ + static void scrollByBlock(JScrollBar scrollbar, int direction) { + // This method is called from BasicScrollPaneUI to implement wheel + // scrolling, and also from scrollByBlock(). + int oldValue = scrollbar.getValue(); + int blockIncrement = scrollbar.getBlockIncrement(direction); + int delta = blockIncrement * ((direction > 0) ? +1 : -1); + int newValue = oldValue + delta; + + // Check for overflow. + if (delta > 0 && newValue < oldValue) { + newValue = scrollbar.getMaximum(); + } + else if (delta < 0 && newValue > oldValue) { + newValue = scrollbar.getMinimum(); + } + + scrollbar.setValue(newValue); + } + + public interface ScrollPane { + boolean isWheelScrollingEnabled(); + JScrollBar getVerticalScrollBar(); + JScrollBar getHorizontalScrollBar(); + JViewport getViewport(); + } +} \ No newline at end of file diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java index 648a2845d..d7a8e1d2a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormArea.java @@ -74,8 +74,8 @@ public class FormArea extends JComponent implements ScrollRulerComponent { private static final String SCALE_MINUS_COMMAND = "scale_minus"; public static final double DEFAULT_SLIDER = 100.0; private static final int ROTATIONS = 50; - private static final int SHOWVALMAX = 400; - private static final int SHOWVALMIN = 10; + public static final int SHOWVALMAX = 400; + public static final int SHOWVALMIN = 10; private static final int RESIZE_PANE_GAP = 8; private static final int MOBILE_ONLY_WIDTH = 375; private static final int MOBILE_ONLY_HEIGHT = 560; @@ -132,10 +132,24 @@ public class FormArea extends JComponent implements ScrollRulerComponent { addFormRuler(); } this.setFocusTraversalKeysEnabled(false); - this.designer.addMouseWheelListener(showValSpinnerMouseWheelListener); + + + this.designer.addMouseWheelListener(new FormAreaMouseWheelHandler(this)); registerShortCutKey(); } + public FormScrollBar getVerticalScrollBar() { + return verScrollBar; + } + + public FormScrollBar getHorizontalScrollBar() { + return horScrollBar; + } + + public JFormSliderPane getSlidePane() { + return slidePane; + } + /** * 注册缩放快捷键 * mac: command + 和 command - @@ -169,17 +183,6 @@ public class FormArea extends JComponent implements ScrollRulerComponent { widthPane.setEnabled(!formMobileAttr.isMobileOnly()); } - MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { - @Override - public void mouseWheelMoved(MouseWheelEvent e) { - if (InputEventBaseOnOS.isControlDown(e)) { - int dir = e.getWheelRotation(); - int old_resolution = slidePane.getShowValue(); - slidePane.setShowValue(old_resolution - (dir * SHOWVALMIN)); - } - } - }; - private UIButton createFixLayoutSwitchButton(){ UIButton button = new UIButton(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Form_Layout_No_Fix_Layout")); button.setIcon(IOUtils.readIcon("/com/fr/base/images/share/filter_combo.png")); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormAreaMouseWheelHandler.java b/designer-form/src/main/java/com/fr/design/mainframe/FormAreaMouseWheelHandler.java new file mode 100644 index 000000000..6c4095a45 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormAreaMouseWheelHandler.java @@ -0,0 +1,75 @@ +package com.fr.design.mainframe; + +import com.fr.common.inputevent.InputEventBaseOnOS; + +import javax.swing.JScrollBar; +import javax.swing.JViewport; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/24 + */ +public class FormAreaMouseWheelHandler implements MouseWheelListener { + private final DesignerTranslateMouseWheelHandler translateMouseWheelHandler; + private final DesignerScaleMouseWheelHandler scaleMouseWheelHandler; + + public FormAreaMouseWheelHandler(FormArea formArea) { + translateMouseWheelHandler = new DesignerTranslateMouseWheelHandler(new FormAreaScrollPaneAdapter(formArea)); + scaleMouseWheelHandler = new DesignerScaleMouseWheelHandler(new FormAreaScalePaneAdapter(formArea), FormArea.SHOWVALMIN); + } + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + if (InputEventBaseOnOS.isControlDown(e)) { + scaleMouseWheelHandler.mouseWheelMoved(e); + } else { + translateMouseWheelHandler.mouseWheelMoved(e); + } + } + + private static class FormAreaScalePaneAdapter implements DesignerScaleMouseWheelHandler.ScalePane { + private final FormArea formArea; + + public FormAreaScalePaneAdapter(FormArea formArea) { + this.formArea = formArea; + } + + @Override + public JFormSliderPane getSlidePane() { + return formArea.getSlidePane(); + } + } + + private static class FormAreaScrollPaneAdapter implements DesignerTranslateMouseWheelHandler.ScrollPane { + private final FormArea formArea; + private final JViewport viewport; + + public FormAreaScrollPaneAdapter(FormArea formArea) { + this.formArea = formArea; + this.viewport = new JViewport(); + } + + @Override + public boolean isWheelScrollingEnabled() { + return true; + } + + @Override + public JScrollBar getVerticalScrollBar() { + return formArea.getVerticalScrollBar(); + } + + @Override + public JScrollBar getHorizontalScrollBar() { + return formArea.getHorizontalScrollBar(); + } + + @Override + public JViewport getViewport() { + return this.viewport; + } + } +} diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index b412d724d..5fe561829 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -34,7 +34,7 @@ public class ReportComponentComposite extends JComponent implements RemoveListen private static final int MAX = 400; private static final int HUND = 100; private static final int MIN = 10; - private static final int DIR = 10; + public static final int DIR = 10; private JWorkBook parent; private UIModeControlContainer parentContainer = null; @@ -66,17 +66,6 @@ public class ReportComponentComposite extends JComponent implements RemoveListen jSliderContainer.addValueChangeListener(showValSpinnerChangeListener); } - MouseWheelListener showValSpinnerMouseWheelListener = new MouseWheelListener() { - @Override - public void mouseWheelMoved(MouseWheelEvent e) { - if (InputEventBaseOnOS.isControlDown(e)) { - int dir = e.getWheelRotation(); - int old_resolution = jSliderContainer.getShowValue(); - jSliderContainer.setShowValue(old_resolution - (dir * DIR)); - } - } - }; - ChangeListener showValSpinnerChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -130,12 +119,12 @@ public class ReportComponentComposite extends JComponent implements RemoveListen } if (centerCardPane.editingComponet.elementCasePane == null) { - centerCardPane.getPolyDezi().polyArea.addMouseWheelListener(showValSpinnerMouseWheelListener); + centerCardPane.getPolyDezi().polyArea.addMouseWheelListener(new ReportComponentCompositeMouseWheelHandler(this)); return; } Grid grid = centerCardPane.editingComponet.elementCasePane.getGrid(); - this.centerCardPane.editingComponet.elementCasePane.getGrid().addMouseWheelListener(showValSpinnerMouseWheelListener); + this.centerCardPane.editingComponet.elementCasePane.getGrid().addMouseWheelListener(new ReportComponentCompositeMouseWheelHandler(this)); if (!grid.hasFocus() && grid.isRequestFocusEnabled()) { grid.requestFocus(); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentCompositeMouseWheelHandler.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentCompositeMouseWheelHandler.java new file mode 100644 index 000000000..e8b41afac --- /dev/null +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentCompositeMouseWheelHandler.java @@ -0,0 +1,75 @@ +package com.fr.design.mainframe; + +import com.fr.common.inputevent.InputEventBaseOnOS; + +import javax.swing.JScrollBar; +import javax.swing.JViewport; +import java.awt.event.MouseWheelEvent; +import java.awt.event.MouseWheelListener; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/9/24 + */ +public class ReportComponentCompositeMouseWheelHandler implements MouseWheelListener { + private final DesignerTranslateMouseWheelHandler translateMouseWheelHandler; + private final DesignerScaleMouseWheelHandler scaleMouseWheelHandler; + + public ReportComponentCompositeMouseWheelHandler(ReportComponentComposite componentComposite) { + translateMouseWheelHandler = new DesignerTranslateMouseWheelHandler(new ScrollPaneAdapter(componentComposite)); + scaleMouseWheelHandler = new DesignerScaleMouseWheelHandler(new ScalePaneAdapter(componentComposite), ReportComponentComposite.DIR); + } + + @Override + public void mouseWheelMoved(MouseWheelEvent e) { + if (InputEventBaseOnOS.isControlDown(e)) { + scaleMouseWheelHandler.mouseWheelMoved(e); + } else { + translateMouseWheelHandler.mouseWheelMoved(e); + } + } + + private static class ScrollPaneAdapter implements DesignerTranslateMouseWheelHandler.ScrollPane { + private final ReportComponentComposite componentComposite; + private JViewport viewport; + + public ScrollPaneAdapter(ReportComponentComposite componentComposite) { + this.componentComposite = componentComposite; + this.viewport = new JViewport(); + } + + @Override + public boolean isWheelScrollingEnabled() { + return true; + } + + @Override + public JScrollBar getVerticalScrollBar() { + return componentComposite.getEditingReportComponent().getVerticalScrollBar(); + } + + @Override + public JScrollBar getHorizontalScrollBar() { + return componentComposite.getEditingReportComponent().getHorizontalScrollBar(); + } + + @Override + public JViewport getViewport() { + return viewport; + } + } + + private static class ScalePaneAdapter implements DesignerScaleMouseWheelHandler.ScalePane { + private final ReportComponentComposite componentComposite; + + public ScalePaneAdapter(ReportComponentComposite componentComposite) { + this.componentComposite = componentComposite; + } + + @Override + public JFormSliderPane getSlidePane() { + return componentComposite.getjSliderContainer(); + } + } +} From 9b73a2fab61c8e854421e16415eb9d55aab96183 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Sun, 26 Sep 2021 16:52:12 +0800 Subject: [PATCH 7/9] =?UTF-8?q?REPORT-59952&=E6=97=A0JIRA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=20=E8=BF=98=E5=8E=9F=E4=BB=A3=E7=A0=81&click=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E6=84=9F=E8=A7=89=E7=94=A8=E8=B5=B7=E6=9D=A5=E4=B8=8D?= =?UTF-8?q?=E8=88=92=E6=9C=8D=EF=BC=8C=E9=BC=A0=E6=A0=87=E7=82=B9=E4=B8=8B?= =?UTF-8?q?=E9=87=8A=E6=94=BE=E4=BD=8D=E7=BD=AE=E5=81=8F=E7=A6=BB=E4=B8=80?= =?UTF-8?q?=E7=82=B9=E7=82=B9=E5=B0=B1=E5=A4=B1=E7=81=B5=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E6=94=B9=E6=88=90press=E4=BA=8B=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/designer/NewFormPane.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index c73f2f235..fa56280e8 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -151,9 +151,9 @@ public class NewFormPane extends BasicPane { private JPanel createNewTemplatePane() { EmptyLayoutPane jPanel = new EmptyLayoutPane(); - jPanel.addClickListener(new MouseAdapter() { + jPanel.addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent e) { + public void mousePressed(MouseEvent e) { setSelectedLayoutPane(jPanel); dialog.setButtonEnabled(true); } @@ -238,9 +238,9 @@ public class NewFormPane extends BasicPane { layoutPaneMap.put(moduleName, module); for (PredefinedLayout layout : layouts) { PredefinedLayoutPane predefinedLayoutPane = new PredefinedLayoutPane(layout); - predefinedLayoutPane.addClickListener(new MouseAdapter() { + predefinedLayoutPane.addMouseListener(new MouseAdapter() { @Override - public void mouseClicked(MouseEvent e) { + public void mousePressed(MouseEvent e) { setSelectedLayoutPane(predefinedLayoutPane); dialog.setButtonEnabled(true); } @@ -266,7 +266,7 @@ public class NewFormPane extends BasicPane { try { if (StringUtils.isNotEmpty(path)) { Form form = new Form(); - form.readStream(NewFormPane.class.getResourceAsStream(path), true); + form.readStream(NewFormPane.class.getResourceAsStream(path)); jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); } else { jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, BaseJForm.class); From c971e997fb1e2d2dff3367a435b1aa19faac0321 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Sun, 26 Sep 2021 17:03:51 +0800 Subject: [PATCH 8/9] =?UTF-8?q?REPORT-59952=20=E8=BF=98=E5=8E=9F=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/com/fr/design/form/layouts/templates/2-4/1.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/2-4/2.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/2-4/3.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/2-4/4.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/2-4/5.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/2-4/6.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/1.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/2.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/3.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/4.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/5.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/5-7/6.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/1.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/2.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/3.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/4.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/5.frm | 3 +++ .../resources/com/fr/design/form/layouts/templates/multi/6.frm | 3 +++ 18 files changed, 54 insertions(+) diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm index 2e049900d..941abbbb1 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/1.frm @@ -113,4 +113,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm index 568302e17..0b04d5e7d 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/2.frm @@ -122,4 +122,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm index 51c1663dd..43cc0b93b 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/3.frm @@ -131,4 +131,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm index 9d9287f98..d6b0ba42b 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/4.frm @@ -131,4 +131,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm index 80aecc1ac..167db8fd2 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/5.frm @@ -131,4 +131,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm index e536bcec9..504bfbd12 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/2-4/6.frm @@ -131,4 +131,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm index a7881cd9f..24df43d5c 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/1.frm @@ -140,4 +140,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm index bd56aaa15..e7f9d76d0 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/2.frm @@ -140,4 +140,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm index 62729e1d0..1b1f1e1a4 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/3.frm @@ -149,4 +149,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm index 44f8964ca..dcd003aa1 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/4.frm @@ -149,4 +149,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm index 7a0906d07..98a3ac6f9 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/5.frm @@ -158,4 +158,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm index 93db94740..34d579ed5 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/5-7/6.frm @@ -158,4 +158,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm index b68f35f2e..710ccc3bd 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/1.frm @@ -167,4 +167,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm index 2033e2f70..2bfe6c198 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/2.frm @@ -176,4 +176,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm index 741cc8044..e80cd4303 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/3.frm @@ -176,4 +176,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm index 9784af2ff..21eac8ae6 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/4.frm @@ -176,4 +176,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm index a10a18e3c..5dde2178e 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/5.frm @@ -176,4 +176,7 @@ + + + diff --git a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm index f37a18830..3644ecff8 100644 --- a/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm +++ b/designer-form/src/main/resources/com/fr/design/form/layouts/templates/multi/6.frm @@ -185,4 +185,7 @@ + + + From 32e6708bc3f6175435f530ead0fbe5b312567ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Sun, 26 Sep 2021 17:21:33 +0800 Subject: [PATCH 9/9] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20=E8=BF=98?= =?UTF-8?q?=E5=8E=9F=E4=B8=80=E4=B9=9F=E6=98=AF=E6=97=A0JIRA=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1=E7=9A=84=E6=94=B9=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/designer/NewFormPane.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java index fa56280e8..2f0b446e3 100644 --- a/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java +++ b/designer-form/src/main/java/com/fr/design/widget/ui/designer/NewFormPane.java @@ -151,9 +151,9 @@ public class NewFormPane extends BasicPane { private JPanel createNewTemplatePane() { EmptyLayoutPane jPanel = new EmptyLayoutPane(); - jPanel.addMouseListener(new MouseAdapter() { + jPanel.addClickListener(new MouseAdapter() { @Override - public void mousePressed(MouseEvent e) { + public void mouseClicked(MouseEvent e) { setSelectedLayoutPane(jPanel); dialog.setButtonEnabled(true); } @@ -238,9 +238,9 @@ public class NewFormPane extends BasicPane { layoutPaneMap.put(moduleName, module); for (PredefinedLayout layout : layouts) { PredefinedLayoutPane predefinedLayoutPane = new PredefinedLayoutPane(layout); - predefinedLayoutPane.addMouseListener(new MouseAdapter() { + predefinedLayoutPane.addClickListener(new MouseAdapter() { @Override - public void mousePressed(MouseEvent e) { + public void mouseClicked(MouseEvent e) { setSelectedLayoutPane(predefinedLayoutPane); dialog.setButtonEnabled(true); }