From 5d7f2db6a7681a87cffc7be835a950b6a9293c8a Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 11:50:04 +0800 Subject: [PATCH 1/4] =?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/4] =?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/4] 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 ac008319d7992d2d5681efd8fb0acce01f93eb51 Mon Sep 17 00:00:00 2001 From: kerry Date: Fri, 24 Sep 2021 16:35:00 +0800 Subject: [PATCH 4/4] =?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; + } + + /** * 增加表单的页面大小控制界面,包括手动修改和滑块拖动