From 7daf44dceff1b060729dc858deab78832df3b925 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 23 Aug 2021 17:20:12 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-54538=20=E7=BB=84=E4=BB=B6=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E6=97=A0=E7=BD=91=E7=BB=9C=E6=8F=90=E7=A4=BA=E5=9C=B0?= =?UTF-8?q?=E5=9D=80=E6=94=AF=E6=8C=81=E9=80=89=E4=B8=AD=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/ui/online/OnlineWidgetRepoPane.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java index af329cde8..c07485745 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/online/OnlineWidgetRepoPane.java @@ -14,6 +14,7 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; +import javax.swing.JTextField; import javax.swing.SwingConstants; import javax.swing.SwingWorker; import java.awt.BorderLayout; @@ -164,9 +165,14 @@ public class OnlineWidgetRepoPane extends BasicPane { tipLabel1.setForeground(Color.decode("#8F8F92")); UILabel tipLabel2 = tipLabel(Toolkit.i18nText("Fine-Design_Share_Internet_Connect_Failed_Tip2")); tipLabel2.setForeground(Color.decode("#8F8F92")); - UILabel tipLabel3 = tipLabel(MARKET_URL); - tipLabel3.setForeground(Color.decode("#8F8F92")); + JTextField tipLabel3 = new JTextField(MARKET_URL); + tipLabel3.setHorizontalAlignment(JTextField.CENTER); + tipLabel3.setPreferredSize(new Dimension(240, 20)); + tipLabel3.setEditable(false); + tipLabel3.setForeground(Color.decode("#8F8F92")); + tipLabel3.setBackground(null); + tipLabel3.setBorder(null); UILabel emptyLabel = tipLabel(StringUtils.EMPTY); panel.add(uiLabel); From 04bac5d214bddc2ff1d1febdfdc1c0a79e8dcad8 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Mon, 23 Aug 2021 17:21:19 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-57590=20=E8=A1=A8=E5=8D=95=E5=8F=82?= =?UTF-8?q?=E6=95=B0=E9=9D=A2=E6=9D=BF=E4=B8=8D=E5=BA=94=E8=AF=A5=E8=83=BD?= =?UTF-8?q?=E8=A2=AB=E5=A4=8D=E5=88=B6=E5=88=B0=E5=AE=B9=E5=99=A8=E5=86=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/creator/XWParameterLayout.java | 10 +++++++ .../design/mainframe/FormSelectionUtils.java | 27 +++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java index 1d37024d9..f60aa9846 100644 --- a/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java +++ b/designer-form/src/main/java/com/fr/design/designer/creator/XWParameterLayout.java @@ -103,6 +103,16 @@ public class XWParameterLayout extends XWAbsoluteLayout { return false; } + @Override + public boolean canEnterIntoAbsolutePane() { + return false; + } + + @Override + public boolean canEnterIntoAdaptPane() { + return false; + } + /** * 该组件是否可以拖拽(表单中参数面板和自适应布局不可以拖拽) * @return 是则返回true diff --git a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java index 2900650aa..84b8f6bf3 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/FormSelectionUtils.java @@ -10,6 +10,7 @@ import com.fr.design.designer.creator.XCreatorUtils; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; import com.fr.design.designer.creator.XWFitLayout; +import com.fr.design.designer.creator.XWParameterLayout; import com.fr.design.designer.creator.XWScaleLayout; import com.fr.design.designer.creator.XWTitleLayout; import com.fr.design.designer.creator.cardlayout.XWTabFitLayout; @@ -60,6 +61,11 @@ public class FormSelectionUtils { */ public static void paste2Container(FormDesigner designer, XLayoutContainer parent, FormSelection clipboard, int x, int y) { + clipboard = filterFormSelection(clipboard, parent); + if (clipboard.isEmpty()) { + Toolkit.getDefaultToolkit().beep(); + return; + } LayoutAdapter adapter = parent.getLayoutAdapter(); if (parent instanceof XWAbsoluteLayout) { //绝对布局 @@ -77,6 +83,27 @@ public class FormSelectionUtils { Toolkit.getDefaultToolkit().beep(); } + private static FormSelection filterFormSelection(FormSelection clipboard, XLayoutContainer parent) { + FormSelection newSelection = new FormSelection(); + for (XCreator xCreator : clipboard.getSelectedCreators()) { + if (parent.acceptType(XWParameterLayout.class)) { + if (xCreator.canEnterIntoParaPane()) { + newSelection.addSelectedCreator(xCreator); + } + } else if (parent.acceptType(XWAbsoluteLayout.class)) { + if (xCreator.canEnterIntoAbsolutePane()) { + newSelection.addSelectedCreator(xCreator); + } + } else if (parent.acceptType(XWFitLayout.class)) { + if (xCreator.canEnterIntoAdaptPane()) { + newSelection.addSelectedCreator(xCreator); + } + } + + } + return newSelection; + } + private static boolean isExtraContainer(XLayoutContainer parent) { if (parent != null) { Set set = ExtraDesignClassManager.getInstance().getArray(FormWidgetOptionProvider.XML_TAG);