From d2a8ed8e0e1fc7b37fa7c60ce8bc45d7f93bef8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 19 Oct 2021 15:30:35 +0800 Subject: [PATCH 01/22] =?UTF-8?q?REPORT-58796=20=E3=80=90=E5=A4=8D?= =?UTF-8?q?=E7=94=A8=E7=BB=84=E4=BB=B6=E3=80=91=E7=BB=84=E4=BB=B6=E5=B0=81?= =?UTF-8?q?=E8=A3=85=E5=B0=BA=E5=AF=B8=E8=B6=85500*300=EF=BC=8C=E4=BC=9A?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E7=BC=A9=E5=B0=8F=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../share/ui/generate/ShareGeneratePane.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java index 99d6c556b..b3a751b5f 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java @@ -19,24 +19,22 @@ import com.fr.design.mainframe.share.collect.ComponentCollector; import com.fr.design.mainframe.share.exception.LackOfValueException; import com.fr.design.mainframe.share.generate.ComponentGeneratorCenter; import com.fr.design.mainframe.share.select.ComponentTransformerFactory; -import com.fr.design.mod.ContentObjectManager; -import com.fr.form.share.exception.NetWorkFailedException; -import com.fr.form.share.group.DefaultShareGroup; import com.fr.design.mainframe.share.util.ShareUIUtils; +import com.fr.design.mod.ContentObjectManager; import com.fr.design.share.effect.EffectItemGroup; import com.fr.design.share.utils.EffectItemUtils; import com.fr.design.share.utils.ShareDialogUtils; import com.fr.form.share.DefaultSharableWidget; +import com.fr.form.share.Group; import com.fr.form.share.config.ComponentReuseConfigManager; +import com.fr.form.share.exception.NetWorkFailedException; +import com.fr.form.share.group.DefaultShareGroup; import com.fr.form.share.group.DefaultShareGroupManager; -import com.fr.form.share.Group; import com.fr.form.share.record.ShareWidgetInfoManager; import com.fr.form.ui.Widget; import com.fr.log.FineLoggerFactory; import com.fr.stable.StringUtils; -import java.util.HashSet; -import java.util.Set; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingWorker; @@ -51,7 +49,9 @@ import java.awt.Image; import java.awt.Rectangle; import java.awt.event.ItemEvent; import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Set; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -65,8 +65,8 @@ public class ShareGeneratePane extends BasicPane { private static final Dimension DIALOG_SIZE = new Dimension(670, 760); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); - private static final double MAX_WIDTH = 500.0; - private static final double MAX_HEIGHT = 260.0; + private static final double MAX_WIDTH = 960.0; + private static final double MAX_HEIGHT = 540.0; private JPanel mainPane = null; private ShareMainPane uploadPane = null; From cd59c435b6d20d8ea3ecb67d846c77ee0fb72973 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 19 Oct 2021 16:25:39 +0800 Subject: [PATCH 02/22] =?UTF-8?q?REPORT-60942=20=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E9=A1=B5=E8=A7=86=E8=A7=89=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/guide/ui/GuideManageDialog.java | 8 ++--- .../design/mainframe/guide/complete_all.png | Bin 485 -> 0 bytes .../design/mainframe/guide/complete_all.svg | 18 +++++++++++ .../design/mainframe/guide/complete_none.png | Bin 401 -> 0 bytes .../design/mainframe/guide/complete_none.svg | 24 ++++++++++++++ .../design/mainframe/guide/complete_some.png | Bin 567 -> 0 bytes .../design/mainframe/guide/complete_some.svg | 30 ++++++++++++++++++ .../mainframe/guide/entry/GuideEntryHint.java | 2 +- 8 files changed, 77 insertions(+), 5 deletions(-) delete mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.png create mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg delete mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.png create mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg delete mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.png create mode 100644 designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java index 98ea4c3c6..ca53613c4 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideManageDialog.java @@ -1,6 +1,7 @@ package com.fr.design.mainframe.guide.ui; +import com.fr.base.svg.IconUtils; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; @@ -14,7 +15,6 @@ import com.fr.design.mainframe.guide.base.GuideManager; import com.fr.design.mainframe.guide.base.GuideVersion; import com.fr.design.mainframe.guide.collect.GuideCollector; import com.fr.design.utils.gui.GUICoreUtils; -import com.fr.general.IOUtils; import javax.swing.BorderFactory; import javax.swing.Icon; @@ -31,9 +31,9 @@ import java.awt.event.ActionListener; public class GuideManageDialog extends JDialog { private static final int DEFAULT_HEIGHT = 400; private static final int DEFAULT_WIDTH = 600; - private static final Icon GROUP_COMPLETE_NONE = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_none.png"); - private static final Icon GROUP_COMPLETE_SOME = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_some.png"); - private static final Icon GROUP_COMPLETE_ALL = IOUtils.readIcon("/com/fr/design/mainframe/guide/complete_all.png"); + private static final Icon GROUP_COMPLETE_NONE = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_none.svg"); + private static final Icon GROUP_COMPLETE_SOME = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_some.svg"); + private static final Icon GROUP_COMPLETE_ALL = IconUtils.readIcon("/com/fr/design/mainframe/guide/complete_all.svg"); private static final Color BORDER_COLOR = new Color(224, 224, 225); private static final Color UNCOMPLETE_FONT_COLOR = new Color(51, 51, 52); private static final Color COMPLETE_FONT_COLOR = new Color(51,51,52,128); diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.png b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.png deleted file mode 100644 index c696cba4d388a7dfb94451ff7eb7211777c6e3ec..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 485 zcmVPx$pGibPR5(wqlfP>eaS+AdoA2J{A|%&{q!fh|R$>|4aEVI5!mHH3AcbYH^AE5S z3k#9!v@&2}6BG#^1OyvNl|s-)3l*EoiFe8F&Xc`8!?7kO{+RB|@cqoZH#0;f7Vh^> z9E<8_9GTIfA}s?Ak$=wyJFjlcd>Q}3gU7l;vpYyY)+r@`T?Tl%%f0@@s0cR|cnJ1aTZg>en?PcIu&&kM*9&}{dcWH<$(J#2Vl&_S$9 z`TNf5bccoJxK=wy=i?(QSAoK=OxO3*^bIez(`JtB5@5G}Q+a#evsP^3HGnz5ZwEv# zxZLh93w8&<*$IHRds&>sQF@icJxGQ0ZNhKz!h`;jTX+g+W@OYOkXHaTO5gM$@~QKR z^29xV2w>z9d**rT7l4^9z!5q048S*-FH)G7>Zyh2*Ujw+9Dx3`R&u*M0 zv;kki8h0IAM%k05O1S<>5jdjPair>A$S + + 编组 7备份 4 + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.png b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.png deleted file mode 100644 index 4c6c6f2bbaba1ad9c699e234f8b67bac6746b737..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 401 zcmV;C0dD?@P)Px$OG!jQR5(wqlQBp_Q51&%|AsFxF7jRY>4p8MbPoqO&%hv-|03x$KWGbIDkh1zm= zZwIZH(mLzCF8nsKGO0-?3Nb{Zw17o`(;Z#U1n%TA52{gkwW`>s+g3V&tjv7Gj$)Nm21XmI4kKu;!-hVmHSg`+sT|0 zCv{75Pp+N{nb8WpoIhGo7~~}^{N~&Rb|AQii?lr!sM3p0tO^VlHm#kXBKM!APMsq{ zbqQBYo;7DEoWtdIVaqBF1UPXLFgg~o;k^Llqs9Y~;xZe90FpNf@x4`pH0J~0)F8|a vCk0=h=(~)*8)+!5+=cvqn0ku;*Kz&=!aDZfq)LR^00000NkvXXu0mjfk3g!- diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg new file mode 100644 index 000000000..0e945f5a8 --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg @@ -0,0 +1,24 @@ + + + 编组 7备份 5 + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.png b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.png deleted file mode 100644 index b3443318bde309459c48d35b1f453420742b2647..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 567 zcmV-70?7S|P)Px$@kvBMR5(wSlh11tQ5?i)-lk~{QoJdq`2$47f}o%xja8^<55<58UPLPt@uDZa z6fYhG1<6U<;zjUaC7?Yh{zwolco2%By$WsgCL$8-X7@X?yG=~fR^mJD+u8SdGwghc zwzc=ZdNVaYCkN7?NNzmWGU2%DR6xqQ~&2In?W8WB_gm`!w52~LYF!R$x5 znx4lsTBIa^ak)cVYyC)d?Utb^qC~oBXWpAgHWwa{tUzIe4i^#B-@p2rnTsGXAb)ph zJ3a1`>6QmK{9?4L(jG0^AD*ZWgs>-cyrfXG<@4R27-#++?1c2v1Bcc-+yEvJJq0;f z>q&iNd^>r@h-~Ft`qWxCx4#>h^dC5(D(M~vCYN?ln1S;ym(Qjibppsw1t(zPO%caq z2O#I1<3UL$B@Kh@1N4nz$%629Wo*NjR`B42HXG`TkouP+-~)g_Kzfw}(g!dVO2yZs z-Sd&20Q@S1T}cGsEri~G+9w6!GoVF~IY4~^_Afio1%YFo-T_pMf8)klu*axp zacMhRG)Er$)svcS7Rhs|qanf@kp9+tEf^_+S7bI57imS6z4Q@D*VlJKBY72}|9nN2 z8<1$2oO3xrLoyZMxFvDK?}R-hy~k#@uzHwUtp4vf{{dxj0PeJ?a?bz&002ovPDHLk FV1jwI{5Svr diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg new file mode 100644 index 000000000..9cff96f2a --- /dev/null +++ b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg @@ -0,0 +1,30 @@ + + + 编组 7备份 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java index c1e361ec2..c1775f718 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/entry/GuideEntryHint.java @@ -58,6 +58,6 @@ public class GuideEntryHint { private Point getBubbleLocation() { Point point = SwingUtilities.convertPoint(GuideEntryPane.getGuideEntryPane(),0,0, guideView.getRootPane()); Dimension size = GuideEntryPane.getGuideEntryPane().getSize(); - return new Point(point.x - 187,point.y + size.height); + return new Point(point.x - 187,point.y + size.height + 5); } } From fbffe1bb5c469e3fab42410a8324d3ec382d963d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Tue, 19 Oct 2021 16:38:20 +0800 Subject: [PATCH 03/22] REPORT-58796 --- .../share/action/CreateComponentAction.java | 27 ++++++++++++- .../share/ui/generate/ShareGeneratePane.java | 39 +------------------ 2 files changed, 26 insertions(+), 40 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index 476afe8b6..a86f5043a 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -81,6 +81,9 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE; * 创建组件事件 */ public class CreateComponentAction extends UpdateAction { + private static final double MAX_WIDTH = 10.0; + private static final double MAX_HEIGHT = 540.0; + ShareUIAspect aspect; /** * 等待时间 500 ms. @@ -114,8 +117,12 @@ public class CreateComponentAction extends UpdateAction { // 获取选中的组件 Triple sharedTriple = ComponentTransformerFactory.getInstance().transform(selection); if (sharedTriple == null) { - FineJOptionPane.showMessageDialog(designerFrame, Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), ERROR_MESSAGE, IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png")); + showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Select_Error_Tip")); + return; + } + + if (isBeyondMaxSize(sharedTriple.getRight())) { + showErrMsgDialog(Toolkit.i18nText("Fine-Design_Share_Widget_Size_Error_Tip")); return; } @@ -398,4 +405,20 @@ public class CreateComponentAction extends UpdateAction { } return paras; } + + private boolean isBeyondMaxSize(Rectangle rec) { + double width = rec.getWidth(); + double height = rec.getHeight(); + return width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT); + } + + private void showErrMsgDialog(String err) { + FineJOptionPane.showMessageDialog( + DesignerContext.getDesignerFrame(), + err, + Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), + ERROR_MESSAGE, + IOUtils.readIcon("/com/fr/base/images/share/Information_Icon_warning_normal_32x32.png") + ); + } } diff --git a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java index b3a751b5f..2d027db89 100644 --- a/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java +++ b/designer-realize/src/main/java/com/fr/design/share/ui/generate/ShareGeneratePane.java @@ -65,8 +65,6 @@ public class ShareGeneratePane extends BasicPane { private static final Dimension DIALOG_SIZE = new Dimension(670, 760); private static final Dimension DIALOG_NORMAL_SIZE = new Dimension(670, 610); private static final Border DIALOG_BORDER = BorderFactory.createEmptyBorder(0, 6, 4, 6); - private static final double MAX_WIDTH = 960.0; - private static final double MAX_HEIGHT = 540.0; private JPanel mainPane = null; private ShareMainPane uploadPane = null; @@ -213,7 +211,6 @@ public class ShareGeneratePane extends BasicPane { dialog.setButtonEnabled(false); ShareDialogUtils.getInstance().setShareDialog(dialog); dialog.addDialogActionListener(new DialogActionAdapter() { - @Override public void doOk() { ShareMainPane mainPane = getSelectMainPane(); @@ -297,29 +294,11 @@ public class ShareGeneratePane extends BasicPane { } private boolean generateModule(DefaultSharableWidget info) throws Exception { - - DefaultSharableWidget transformInfo = transform(info); - ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, transformInfo); + ComponentGenerateInfo generateInfo = new ComponentGenerateInfo(uploadCheckbox.isSelected(), jt, paraMap, shareWidget, info); ComponentGeneratorCenter center = new ComponentGeneratorCenter(generateInfo); return center.generate(); } - private DefaultSharableWidget transform(DefaultSharableWidget info) { - confineSize(info); - - //先屏蔽 - //if (shareWidget instanceof AbstractBorderStyleWidget) { - // AbstractBorderStyleWidget styleWidget = (AbstractBorderStyleWidget) shareWidget; - // ExtendSharableAttrMark attrMark = styleWidget.getWidgetAttrMark(ExtendSharableAttrMark.XML_TAG); - // if (attrMark != null) { - // String shareId = attrMark.getShareId(); - // info.setId(shareId); - // } - //} - return info; - } - - @Override protected String title4PopupWindow() { return Toolkit.i18nText("Fine-Design_Share_Module_Msg"); @@ -328,20 +307,4 @@ public class ShareGeneratePane extends BasicPane { private Dimension getDialogSize() { return effectItemGroups.size() > 0 ? DIALOG_SIZE : DIALOG_NORMAL_SIZE; } - - - private void confineSize(DefaultSharableWidget info) { - double width = info.getWidth(); - double height = info.getHeight(); - if (width > 0 && height > 0 && (width > MAX_WIDTH || height > MAX_HEIGHT)) { - double aspectRatio = width / height; - if (width / height > MAX_WIDTH / MAX_HEIGHT) { - info.setWidth((int) MAX_WIDTH); - info.setHeight((int) (MAX_WIDTH / aspectRatio)); - } else { - info.setHeight((int) MAX_HEIGHT); - info.setWidth((int) (MAX_HEIGHT * aspectRatio)); - } - } - } } From 18c92584eeaa93079f28a8b2b00b73de4a11b641 Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 19 Oct 2021 15:28:44 +0800 Subject: [PATCH 04/22] =?UTF-8?q?REPORT-60982=20=E4=B8=BB=E9=A2=98?= =?UTF-8?q?=E8=8E=B7=E5=8F=96-=E7=82=B9=E5=87=BB=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E5=90=8E=E7=BD=91=E7=BB=9C=E8=BE=83=E6=85=A2?= =?UTF-8?q?=E6=97=B6=E8=BF=87=E6=B8=A1=E4=B8=8D=E5=90=88=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 修改主题下载交互 1. 添加加载动画 2. 下载是弹窗菜单不消失 【改动思路】 同上 --- .../actions/DownloadSuitableThemeAction.java | 31 ++++++++--- .../share/ui/actions/LoadingMenuItem.java | 50 ++++++++++++++++++ .../SharedComponentActionMenuItemUI.java | 37 ++++++++----- .../ui/block/AbstractOnlineWidgetBlock.java | 3 +- .../com/fr/design/form/images/loading.gif | Bin 0 -> 3430 bytes 5 files changed, 101 insertions(+), 20 deletions(-) create mode 100644 designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java create mode 100644 designer-form/src/main/resources/com/fr/design/form/images/loading.gif diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java index 399a644b4..f8f4cc1a7 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/DownloadSuitableThemeAction.java @@ -10,6 +10,7 @@ import com.fr.design.dialog.FineJOptionPane; import com.fr.design.file.HistoryTemplateListCache; import com.fr.design.gui.imenu.UIMenuItem; import com.fr.design.gui.imenu.UIMenuItemUI; +import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.i18n.Toolkit; import com.fr.design.login.DesignerLoginHelper; import com.fr.design.login.DesignerLoginSource; @@ -39,22 +40,35 @@ import java.util.concurrent.ExecutionException; */ public class DownloadSuitableThemeAction extends UpdateAction { private final String themePath; + private final UIPopupMenu popupMenu; private boolean downloading = false; private JTemplate currentTemplate; - public DownloadSuitableThemeAction(String themePath) { + public DownloadSuitableThemeAction(String themePath, UIPopupMenu popupMenu) { this.themePath = themePath; + this.popupMenu = popupMenu; this.putValue(Action.SMALL_ICON, null); this.setName(Toolkit.i18nText("Fine-Design_Share_Download_Suitable_Theme")); } @Override public UIMenuItem createMenuItem() { - UIMenuItem menuItem = super.createMenuItem(); - menuItem.setOpaque(true); - menuItem.setBackground(ColorConstants.BACKGROUND); - menuItem.setUI(new SharedComponentActionMenuItemUI()); - return menuItem; + return getLoadingMenuItem(); + } + + public LoadingMenuItem getLoadingMenuItem() { + Object object = this.getValue(LoadingMenuItem.class.getName()); + if (object == null) { + UIMenuItem menuItem = new LoadingMenuItem(this); + // 设置名字用作单元测 + menuItem.setName(getName()); + setPressedIcon4Button(menuItem); + setDisabledIcon4Button(menuItem); + object = menuItem; + + this.putValue(LoadingMenuItem.class.getName(), object); + } + return (LoadingMenuItem) object; } @Override @@ -91,6 +105,8 @@ public class DownloadSuitableThemeAction extends UpdateAction { } downloading = true; + LoadingMenuItem menuItem = getLoadingMenuItem(); + menuItem.startLoading(); new SwingWorker() { @Override @@ -109,11 +125,14 @@ public class DownloadSuitableThemeAction extends UpdateAction { onThemeFetched(theme); downloading = false; + LoadingMenuItem menuItem = getLoadingMenuItem(); + menuItem.stopLoading(); } }.execute(); } public void onThemeFetched(FormTheme theme) { + popupMenu.menuSelectionChanged(false); if (theme == null) { return; } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java new file mode 100644 index 000000000..6262c34a3 --- /dev/null +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java @@ -0,0 +1,50 @@ +package com.fr.design.mainframe.share.ui.actions; + +import com.fr.design.gui.imenu.UIMenuItem; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; +import com.fr.general.IOUtils; + +import javax.swing.Action; +import javax.swing.BorderFactory; +import javax.swing.Icon; +import java.awt.Graphics; + +/** + * @author Starryi + * @version 1.0 + * Created by Starryi on 2021/10/19 + */ +public class LoadingMenuItem extends UIMenuItem { + private boolean loading = false; + + private final Icon profileIcon = IOUtils.readIcon("/com/fr/design/form/images/loading.gif"); + + public LoadingMenuItem(Action action) { + super(action); + setOpaque(true); + setBackground(ColorConstants.BACKGROUND); + setUI(new SharedComponentActionMenuItemUI(false)); + } + + public void startLoading() { + loading = true; + setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 20)); + revalidate(); + repaint(); + } + + public void stopLoading() { + loading = false; + setBorder(BorderFactory.createEmptyBorder()); + revalidate(); + repaint(); + } + + @Override + protected void paintBorder(Graphics g) { + super.paintBorder(g); + if (loading) { + profileIcon.paintIcon(this, g, getWidth() - 20, 0); + } + } +} diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java index ca4d499b1..8a3fe5e1c 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java @@ -8,7 +8,7 @@ import com.fr.stable.Constants; import javax.swing.ButtonModel; import javax.swing.JMenu; import javax.swing.JMenuItem; -import javax.swing.JPopupMenu; +import javax.swing.MenuSelectionManager; import java.awt.Color; import java.awt.Graphics; import java.awt.Graphics2D; @@ -20,6 +20,16 @@ import java.awt.Graphics2D; */ public class SharedComponentActionMenuItemUI extends UIMenuItemUI { + private final boolean autoClosePopup; + + public SharedComponentActionMenuItemUI(boolean autoClosePopup) { + this.autoClosePopup = autoClosePopup; + } + + public SharedComponentActionMenuItemUI() { + this(true); + } + @Override protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { ButtonModel model = menuItem.getModel(); @@ -27,18 +37,19 @@ public class SharedComponentActionMenuItemUI extends UIMenuItemUI { int menuWidth = menuItem.getWidth(); int menuHeight = menuItem.getHeight(); - g.setColor(UIConstants.NORMAL_BACKGROUND); - g.fillRect(0, 0, menuWidth, menuHeight); - if (menuItem.isOpaque()) { - if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); - } else { - GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); - } - g.setColor(oldColor); - } else if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); - g.setColor(oldColor); + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 0); + } + + g.setColor(oldColor); + } + + @Override + protected void doClick(MenuSelectionManager msm) { + if (autoClosePopup) { + super.doClick(msm); + } else { + menuItem.doClick(0); } } } diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java index 5ce5b57dd..3be4f96b9 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/block/AbstractOnlineWidgetBlock.java @@ -116,12 +116,13 @@ public abstract class AbstractOnlineWidgetBlock extends PreviewWidgetBlockhv}#+}aVEv=5L*BUxHZZtO8&!4|==FGXKX8W;Y$4}RvX=rR38XCQD z;nKy6mmH4kmoHzra^>2gLx=1wtu-~Z4Gm2l9bGM0)tnvY&YiEXKT}mzRa0B*aJKgk z3|_g~a0run>ot@n$>gvYsJschx8ydcQckIFF-TNb>_g=nyNq>e3aTC7y9QR`{h>bwGtl=1VmW(KVwN6J{rOJS!J z%hmY>iI7g60WHc@L2Fc^97dFk7FjATEh;Wj>y@<9qC!oHxKzqe=4i9kV(fWxnZ=;J zGSRP*GGZn_&?aNbwK_G87tUv@I3SxQ5QTI2Y>>wZqjA|B0gKIJvH46kN6Z$Axg6T- zi-ASc<>ZRf74ffQVQ*4KzFuD}X0g_V{t?x5sS@bak)&)f>~nF=#`~R zO-az39Te&km9C&zU!c{{CU;b3YuD%B@`8>r2Mh5rX>88pm3G8h*hdAW^uyV ztfHbxU9YT5^y%vVrZJ^;Nv5G#%}Q67XxHjgYRo+7jWbreKMyo%h-D*A)fHe+l!Xed zYHg8Pqfb&u8Q7QboPr#24o9TUX7fO1gpeJ<1S6CxrbxigW~v38ToF4L`(?A=>@$^r zjDj5#!4}2F2;zAhPF$=AjEfNpxpF>V7{`r|<-YMv(v;|x8kPD@>;f$IYu}hZ^%cu? zYNcMQ%hYNM-*iD*zE-a-$=4RsYR9;wutts z(&B1suLQf~gc{gG^8fikQj>zM2^!$c@P5ayi*tfq?PaKj;6gAPY;1HQ6rz z(>`yOu%4WJ{NpfSFMk{-wFWywI_$9EU;g`Fzy0$czfS!9Z!ezz^6cr8pMU!6;~#(c z{=09#`TDCzUyeU~aR1)e-O-WZp}{)?xBL5gdv4wAzR}g$alPH?Xlre;H#aplT)TSZ z@}-Lx&YwGbrvCJ)lXWMKAFHi7dgSn-g9rBS+xwU5FZS%-wR6YkRiAC&_UYCwHf!bP zO%)qAlv~WEPs%<<5!eVBO4qMjt1r=gRIJq$6|Pxbke`>U&QWD6SAF=w$`$V~&sw(h zy(O6$>5J1+7o{vrUXYZS5Fe+I$HqiQ$)u4Iu}CQ3^S}r$hs_FShK0WS&is(zd2@pp zbQ*O|;Otp5-+n8=-_O^_+Y6w0&hQ{lpXN?-b0xYEu#rRmmFSAYeT)mkrVsYF0N`+> zkuubTpoqa;JIi9SqA+C+)i2c3hyd?aZpjdOh8qGt2gM*_K`6qow(8>P0t1N>Xfyk-r7`K)EWd+*U5YQ#}ep1G08} zjYM%G{m~$VB;R8)_M1V*F5$E@`SJ>q?5C<{KJ6}6dUWxV?|+$Bw%IlLc-7hZ{jH<` z|1giT=$2UbS(N9(F1ZWdHHy(O;iYoAQDxSN*}c!`7IzW4+CEWst{RjDT6_;4NKd0p zrFH;Qi^9<=$Pg=o&1M*;$N7*@b+Ez9YD!66XNd6$q_`!A#Vv;rOYHo7<+1t(Y+z%pC8}P;JFAgu3!&G-oVT`lBwg^yucEZN#{I zg~+7B*=VA-=0A>DRY}F;K#vw(8O076{BiXMLb?J|UQ7_b|MZ6rLb(a!ItA9D-?4hd z7NT&u$p#Cu#B|?K6byF7vNXs;l?LBZWRYhy-K$*4_mk#H-Y*pUWQFkXCRGs!jHRMR zAWO*6djbgQy?|so(u0Jop01Z-Wq_$3mMxSeP>4aqU`VYt)F2B8NSEnyWX5}DWTmI4 z-t@LS{)H|7@kmBKg@O}38+eo<--wG}++KI=X|z2;$``uRbccG)E(VP|T}N}DK?Wus zAEVb!qe@-G6Iu4Qt)4T$y+voA5=r}9qsy4}_%y&48@0}NVSxKoS_fZ2rKVaIh%lyD ziqc>JEyBS&Z3QAP5;vN(P#Pji!iY-Ki=kCZ62bw_yh0S&0%y*U5O_v_QZg-wZXhK9 zkOY7)8hC;6g2f_^4z~`hv>_{fJeQ+{sHI?y4N7A~&8{JkAgeiYrqPSKBrcKnjR}V4 zxdo@Ww?4wpz#F??jGV(IY;?oz8Bf!-t*``X?3wOoYI|(6$*r7FAwF{aAMaR zHY121CvUmrCX5Jx&AUk))X(5SCQ~ZS@B*cBtt2{nCN#2pQFy>|Gidw@iI2Lt2_hx9 zgPo2qH@OhK*_`^~RjIc1FfptJuObA_Leriec=|ATJCW=$SLt z^k+GvB@dJ51o-?md)F#AqUb~PSz^-oMv6r`GIjs*fa3uW_2%t@L4S}RDG^Bg zsSw69DL8_S8XN9d5lAE@Jv2J4W;_L|CMguVY*5h(ZZePWl<;?2jB|!@+lkW-0C8gz zz_$shpK@bkzbg1LWGh9mf_ORF#X=^s)YWrux2hd@7n#3sep<_B-(ru{3HB3Z>NIwS zBkPOL^UADJuMXk3JaOu2bO#e@Mko>t=4J$p0%2+-iecJhF_L4DZ3tN=fOi@pnD0;6 zKwuOYjDQJH5Fio{g}|jeQrx0TkX+2)X);iKWn#o|(`a;7@Tq79oD~pW$m*-`Ps|OR zmlf~lFTqq<+eOzCq_SX^QuILqpWI{i@xG`jI$l*GtK(Ev*nS) z&pW$npl|%Zf^wGv;Y6p8X#*)3wXb;cnZx->q?cRVMB0Xga(3u%j@@2CTNx_=zM}r1 zlS0KC-CPM%_3iL0oJPI{05F``5aB6|C{>K?wCS>7l*ltmK7xf&X2U9GAxa{|ON@Xh z!35LkwK5n&jXaSAg^@@$-k2CuZGlLQ6q0hTn_5n{R&p3J4yst9l6P6DQGCb?rEtJX z>j`fNiOchuPcjUlv8w#Y#A!=3k?hvIwzIS1O?G_i#-2@c)K$+%oMA0{5-KMuc7Jvx zeixo Date: Tue, 19 Oct 2021 17:06:17 +0800 Subject: [PATCH 05/22] REPORT-58796 --- .../fr/design/mainframe/share/action/CreateComponentAction.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java index a86f5043a..364588813 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/action/CreateComponentAction.java @@ -81,7 +81,7 @@ import static javax.swing.JOptionPane.ERROR_MESSAGE; * 创建组件事件 */ public class CreateComponentAction extends UpdateAction { - private static final double MAX_WIDTH = 10.0; + private static final double MAX_WIDTH = 960.0; private static final double MAX_HEIGHT = 540.0; ShareUIAspect aspect; From 0b5bc65816a9aa509ce54be81de8fbacedf1172c Mon Sep 17 00:00:00 2001 From: zack Date: Tue, 19 Oct 2021 17:06:42 +0800 Subject: [PATCH 06/22] =?UTF-8?q?REPORT-60993=20=E5=AF=BC=E5=87=BA-?= =?UTF-8?q?=E5=AF=BC=E5=87=BA=E4=BA=8B=E4=BB=B6-=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E6=B2=A1=E6=9C=89=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/ExportJavaScriptPane.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index b559c22e6..b57531ef7 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -218,6 +218,10 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane Date: Tue, 19 Oct 2021 19:00:03 +0800 Subject: [PATCH 07/22] =?UTF-8?q?REPORT-61125=20=E4=BA=A4=E4=BA=92?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guide/creator/GuideCreateUtils.java | 21 +++++++--- .../layout/ChangeLayoutComponentGuide.java | 24 ++--------- .../layout/UseLayoutAndComponentGuide.java | 37 ++++++++++++++-- .../theme/DownloadComponentPackageGuide.java | 42 ++++--------------- .../guide/creator/theme/ThemeToggleGuide.java | 10 +++-- 5 files changed, 68 insertions(+), 66 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java index 864459276..39c6b5574 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/GuideCreateUtils.java @@ -31,6 +31,7 @@ import javax.swing.JComponent; import javax.swing.JDialog; import javax.swing.JOptionPane; import javax.swing.JRootPane; +import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import javax.swing.UIManager; import java.awt.BorderLayout; @@ -231,7 +232,7 @@ public class GuideCreateUtils { int returnVal = FineJOptionPane.showConfirmDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Guide_Option_Confirm_Not_Login"), - Toolkit.i18nText("Fine-Design_Basic_Confirm"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE); if (returnVal == JOptionPane.YES_OPTION) { @@ -243,16 +244,16 @@ public class GuideCreateUtils { FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), Toolkit.i18nText("Fine-Design_Guide_Option_Warning_Need_Network"), - Toolkit.i18nText("Fine-Design_Basic_Confirm"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), JOptionPane.WARNING_MESSAGE); } public static void showNoFileAuthAlert() { FineJOptionPane.showMessageDialog( DesignerContext.getDesignerFrame(), - Toolkit.i18nText("Fine-Design_Basic_Warning_Template_Do_Not_Exsit"), - Toolkit.i18nText("Fine-Design_Basic_Tool_Tips"), - JOptionPane.INFORMATION_MESSAGE + Toolkit.i18nText("Fine-Design_Guide_Option_Warning_No_Directory_Auth"), + Toolkit.i18nText("Fine-Design_Basic_Alert"), + JOptionPane.WARNING_MESSAGE ); } @@ -292,4 +293,14 @@ public class GuideCreateUtils { return dialog; } + public static JScrollPane getParentScrollPane(Component component) { + if (component.getParent() == null) { + return null; + } + if (component.getParent() instanceof JScrollPane) { + return (JScrollPane) component.getParent(); + } + return getParentScrollPane(component.getParent()); + } + } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java index 6bf82065f..2058bf958 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/ChangeLayoutComponentGuide.java @@ -35,10 +35,9 @@ public class ChangeLayoutComponentGuide { public static Guide createGuide() { GuideScene scene = createScene(); scene.nextScene(createScene2()) - .nextScene(createScene3()) .nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()) - .nextScene(createScene4()) - .nextScene(createScene5()); + .nextScene(createScene3()) + .nextScene(createScene4()); Guide guide = GuideBuilder.newInstance() .setID(GuideIds.Guide.F001002) @@ -83,21 +82,6 @@ public class ChangeLayoutComponentGuide { } private static GuideScene createScene2() { - DisplayScene scene = new DisplayScene(); - scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { - @Override - public boolean prepared() { - scene.addCustomTarget( - GuideCreateUtils.createTarget(switchButton.getComponentPopupMenu()), - GuideCreateUtils.getRelativeBounds(switchButton.getComponentPopupMenu(), switchButton,0, -switchButton.getComponentPopupMenu().getHeight()) - ); - return true; - } - }); - return scene; - } - - private static GuideScene createScene3() { ClickScene scene = new ClickScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override @@ -117,7 +101,7 @@ public class ChangeLayoutComponentGuide { return scene; } - private static GuideScene createScene4() { + private static GuideScene createScene3() { DragScene scene = new DragScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override @@ -158,7 +142,7 @@ public class ChangeLayoutComponentGuide { return scene; } - private static GuideScene createScene5() { + private static GuideScene createScene4() { DisplayScene scene = new DisplayScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java index 6d67f3b93..0ea5b0645 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java @@ -1,18 +1,24 @@ package com.fr.design.mainframe.guide.creator.layout; +import com.fr.base.theme.FormTheme; +import com.fr.base.theme.FormThemeConfig; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XOccupiedLayout; import com.fr.design.dialog.UIDialog; import com.fr.design.gui.imenu.UIHeadMenu; import com.fr.design.i18n.Toolkit; +import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.FormWidgetDetailPane; +import com.fr.design.mainframe.JForm; +import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.NorthRegionContainerPane; import com.fr.design.mainframe.guide.GuideIds; import com.fr.design.mainframe.guide.base.Guide; import com.fr.design.mainframe.guide.base.GuideBuilder; import com.fr.design.mainframe.guide.base.GuideLifecycleAdaptor; +import com.fr.design.mainframe.guide.base.GuideManager; import com.fr.design.mainframe.guide.creator.GuideCreateUtils; import com.fr.design.mainframe.guide.creator.GuideSceneHelper; import com.fr.design.mainframe.guide.scene.ClickScene; @@ -24,6 +30,7 @@ import com.fr.design.mainframe.guide.tip.GuideTip; import com.fr.design.mainframe.share.ui.block.LocalWidgetBlock; import com.fr.design.mainframe.share.ui.local.LocalWidgetRepoPane; import com.fr.design.mainframe.share.util.InstallComponentHelper; +import com.fr.design.mainframe.theme.AsyncThemeFetcher; import com.fr.design.utils.ComponentUtils; import com.fr.design.widget.ui.designer.NewFormPane; import com.fr.design.widget.ui.designer.PredefinedLayoutPane; @@ -47,6 +54,7 @@ public class UseLayoutAndComponentGuide { private static final String RESOURCE_PATH = "/com/fr/report/guide/component"; private static UIHeadMenu fileHeadMenu; private static NewFormPane newFormPane; + private static String defaultThemeName; public static Guide createGuide() { GuideScene scene = createScene(); @@ -71,9 +79,23 @@ public class UseLayoutAndComponentGuide { @Override public boolean prepared() { preloadShareComponent(); - Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File")); - fileHeadMenu = ((UIHeadMenu) component); - return true; + List themeNames = FormThemeConfig.getInstance().getThemeNames(); + if (themeNames.size() > 0) { + defaultThemeName = themeNames.get(Math.max(themeNames.size() - 2, 0)); + AsyncThemeFetcher asyncThemeFetcher = new AsyncThemeFetcher<>(1, FormThemeConfig.getInstance()); + asyncThemeFetcher.submit(defaultThemeName, new AsyncThemeFetcher.AsyncThemeFetchCallbackAdapter(){ + @Override + public void afterCachedFetch(FormTheme theme) { + Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File")); + fileHeadMenu = ((UIHeadMenu) component); + asyncThemeFetcher.shutdown(); + GuideManager.getInstance().getCurrentGuide().start(); + } + }); + } else { + GuideManager.getInstance().getCurrentGuide().terminate(); + } + return false; } @Override @@ -176,6 +198,15 @@ public class UseLayoutAndComponentGuide { public boolean onComplete() { newFormPane.createLayoutForm(); newFormPane.getWindow().dispose(); + FormTheme defaultTheme = FormThemeConfig.getInstance().cachedFetch(defaultThemeName); + if (defaultTheme != null) { + JTemplate newTemplate = DesignerContext.getDesignerFrame().getSelectedJTemplate(); + if (newTemplate instanceof JForm) { + JForm jForm = (JForm) newTemplate; + jForm.setTemplateTheme(defaultTheme); + } + + } return true; } }); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java index 68de9ef8f..2fdbe0699 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java @@ -43,6 +43,7 @@ import javax.swing.JPopupMenu; import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import java.awt.Component; +import java.awt.Dimension; import java.awt.Point; import java.awt.event.ContainerAdapter; import java.awt.event.ContainerEvent; @@ -62,7 +63,6 @@ public class DownloadComponentPackageGuide { .nextScene(createScene3()) .nextScene(createScene4()) .nextScene(createScene5()) - .nextScene(createScene6()) .nextScene(GuideSceneHelper.createFormDesignerBodyDisplayScene()); Guide guide = GuideBuilder.newInstance() @@ -93,7 +93,7 @@ public class DownloadComponentPackageGuide { } boolean loadWidgetSuccess = OnlineWidgetRepoPane.loadWidgets(); if (loadWidgetSuccess) { - filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "layout_recommend", ".frm"); + filePath = GuideCreateUtils.openGuideFile("/com/fr/report/guide/template", "download_theme", ".frm"); if (filePath == null) { GuideCreateUtils.showNoFileAuthAlert(); GuideManager.getInstance().getCurrentGuide().terminate(); @@ -189,7 +189,7 @@ public class DownloadComponentPackageGuide { if (onlineWidgetPackageBlock == null) { GuideManager.getInstance().getCurrentGuide().terminate(); } else { - JScrollPane scrollPane = getParentScrollPane(onlineWidgetPackageBlock); + JScrollPane scrollPane = GuideCreateUtils.getParentScrollPane(onlineWidgetPackageBlock); scrollPane.getVerticalScrollBar().setValue(onlineWidgetPackageBlock.getY()); SwingUtilities.invokeLater(new Runnable() { @Override @@ -207,24 +207,6 @@ public class DownloadComponentPackageGuide { } private static GuideScene createScene3() { - DisplayScene scene = new DisplayScene(); - scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { - @Override - public boolean prepared() { - scene.addTarget(onlineWidgetPackageBlock); - JPopupMenu popupMenu = onlineWidgetPackageBlock.getRightClickPopupMenu(); - Point location = getPopupMenuLocation(); - scene.addCustomTarget( - GuideCreateUtils.createTarget(popupMenu), - GuideCreateUtils.getRelativeBounds(popupMenu, onlineWidgetPackageBlock, location.x, location.y) - ); - return true; - } - }); - return scene; - } - - private static GuideScene createScene4() { ClickScene scene = new ClickScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override @@ -260,7 +242,7 @@ public class DownloadComponentPackageGuide { return scene; } - private static GuideScene createScene5() { + private static GuideScene createScene4() { DisplayScene scene = new DisplayScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override @@ -279,7 +261,7 @@ public class DownloadComponentPackageGuide { return scene; } - private static GuideScene createScene6() { + private static GuideScene createScene5() { ClickScene scene = new ClickScene(); scene.registerLifecycle(new GuideSceneLifecycleAdaptor() { @Override @@ -305,7 +287,8 @@ public class DownloadComponentPackageGuide { private static Point getPopupMenuLocation() { JPopupMenu popupMenu = onlineWidgetPackageBlock.getRightClickPopupMenu(); - return new Point((onlineWidgetPackageBlock.getWidth() - popupMenu.getWidth()) / 2, (onlineWidgetPackageBlock.getHeight()- popupMenu.getHeight()) / 2); + Dimension preferredSize = popupMenu.getPreferredSize(); + return new Point((onlineWidgetPackageBlock.getWidth() - preferredSize.width) / 2, (onlineWidgetPackageBlock.getHeight()- preferredSize.height) / 2); } private static void closeConfirmDialog() { @@ -313,15 +296,4 @@ public class DownloadComponentPackageGuide { themeConfirmDialog.dispose(); } } - - private static JScrollPane getParentScrollPane(Component component) { - if (component.getParent() == null) { - return null; - } - if (component.getParent() instanceof JScrollPane) { - return (JScrollPane) component.getParent(); - } - return getParentScrollPane(component.getParent()); - } - } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java index 07fb60041..8baffb676 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java @@ -28,6 +28,7 @@ import com.fr.design.mainframe.theme.TemplateThemeGridPagesPane; import com.fr.design.mainframe.theme.dialog.TemplateThemeUsingDialog; import com.fr.design.utils.ComponentUtils; +import javax.swing.JScrollPane; import javax.swing.SwingUtilities; import java.awt.Component; import java.util.List; @@ -35,7 +36,6 @@ import java.util.TimerTask; public class ThemeToggleGuide { private static final int PAGE_THEME_COUNT = 9; - private static final int DEFAULT_THEME_INDEX = 4; private static TemplateThemeUsingDialog themeDialog; private static String TARGET_XCREATOR_NAME = "chart00"; private static String filePath; @@ -64,11 +64,11 @@ public class ThemeToggleGuide { @Override public boolean prepared() { List themeNames = FormThemeConfig.getInstance().getThemeNames(); - themeLoadCount = Math.min(themeNames.size(), PAGE_THEME_COUNT); + themeLoadCount = themeNames.size(); if (themeLoadCount == 0) { GuideManager.getInstance().getCurrentGuide().terminate(); } - selectedThemeIndex = Math.min(themeLoadCount - 1, DEFAULT_THEME_INDEX); + selectedThemeIndex = Math.max(themeLoadCount - 5, 0); int lazyCount = themeLoadCount; AsyncThemeFetcher asyncThemeFetcher = new AsyncThemeFetcher<>(PAGE_THEME_COUNT, FormThemeConfig.getInstance()); for (int index = 0; index < lazyCount; index++) { @@ -230,7 +230,11 @@ public class ThemeToggleGuide { if (themeDialog == null) { themeDialog = new TemplateThemeUsingDialog(); } + String name = FormThemeConfig.getInstance().getThemeNames().get(selectedThemeIndex); + Component component = ComponentUtils.findComponentByName(themeDialog.getContentPane(), name); + JScrollPane scrollPane = GuideCreateUtils.getParentScrollPane(component); GuideCreateUtils.showDialogWithoutModal(themeDialog); + scrollPane.getVerticalScrollBar().setValue(component.getY()); } private static void closeTemplateThemeUsingDialog() { From 223e15fcbb60acc554522f22739b0e88a7253dd4 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 19 Oct 2021 20:44:14 +0800 Subject: [PATCH 08/22] =?UTF-8?q?REPORT-60942=20=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=9B=BE=E8=A7=86=E8=A7=89=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/guide/base/GuideView.java | 5 +- .../guide/ui/GuideLoadingGlassPane.java | 19 ++-- .../mainframe/guide/ui/GuideLoadingPane.java | 98 +++++++++++++++++++ .../design/mainframe/guide/ui/ImagePanel.java | 28 ------ 4 files changed, 115 insertions(+), 35 deletions(-) create mode 100644 designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java delete mode 100644 designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java index 7e141d7d5..f8b93e34c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/base/GuideView.java @@ -40,7 +40,6 @@ public class GuideView extends JDialog { this.setSize(window.getSize()); this.setLayout(FRGUIPaneFactory.createBorderLayout()); setBg(); - this.setGlassPane(new GuideLoadingGlassPane()); DesignerContext.getDesignerFrame().addWindowListener(new WindowAdapter() { @Override @@ -106,12 +105,16 @@ public class GuideView extends JDialog { } public void showLoading() { + this.setGlassPane(GuideLoadingGlassPane.getInstance()); + GuideLoadingGlassPane.getInstance().startLoading(); updateGuideViewLocation(); this.setVisible(true); + this.invalidate(); this.getGlassPane().setVisible(true); } public void hideLoading() { + GuideLoadingGlassPane.getInstance().stopLoading(); this.getGlassPane().setVisible(false); repaint(); SwingUtilities.invokeLater(new Runnable() { diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java index 64017dfb7..47a10d0be 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingGlassPane.java @@ -9,11 +9,11 @@ import javax.swing.SwingConstants; import java.awt.BorderLayout; import java.awt.Color; import java.awt.Dimension; +import java.awt.Font; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; public class GuideLoadingGlassPane extends JPanel { - private static final String loadingImagePath = "/com/fr/design/mainframe/guide/loading.gif"; private static GuideLoadingGlassPane loadingPane; public static GuideLoadingGlassPane getInstance() { @@ -32,16 +32,15 @@ public class GuideLoadingGlassPane extends JPanel { public void initComponent() { JPanel loadingView = FRGUIPaneFactory.createBorderLayout_S_Pane(); loadingView.setOpaque(false); - loadingView.setPreferredSize(new Dimension(130, 120)); + loadingView.setPreferredSize(new Dimension(150, 90)); JPanel imageContainer = FRGUIPaneFactory.createCenterFlowInnerContainer_S_Pane(); imageContainer.setOpaque(false); - ImagePanel imagePanel = new ImagePanel(loadingImagePath); - imagePanel.setOpaque(false); - imagePanel.setPreferredSize(new Dimension(84, 84)); - imageContainer.add(imagePanel); + + imageContainer.add(GuideLoadingPane.getInstance()); UILabel hintLabel = new UILabel(Toolkit.i18nText("Fine-Design_Guide_Loading_Wait")); + hintLabel.setFont(new Font(Font.SANS_SERIF, Font.PLAIN, 14)); hintLabel.setHorizontalAlignment(SwingConstants.CENTER); hintLabel.setForeground(Color.WHITE); @@ -50,4 +49,12 @@ public class GuideLoadingGlassPane extends JPanel { this.add(loadingView, new GridBagConstraints()); } + + public void startLoading() { + GuideLoadingPane.getInstance().start(); + } + + public void stopLoading() { + GuideLoadingPane.getInstance().stop(); + } } diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java new file mode 100644 index 000000000..0a290c784 --- /dev/null +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideLoadingPane.java @@ -0,0 +1,98 @@ +package com.fr.design.mainframe.guide.ui; + +import javax.swing.JPanel; +import javax.swing.Timer; +import java.awt.AlphaComposite; +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.Composite; +import java.awt.Dimension; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Image; +import java.awt.Point; +import java.awt.RenderingHints; +import java.awt.Stroke; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; + +/** + * Created by kerry on 2020-10-23 + */ +public class GuideLoadingPane extends JPanel { + private static final BasicStroke STROKE = new BasicStroke(4); + private static final int FPS = 30; + private static final int START_ANGLE = 90; + private static GuideLoadingPane imagePanel; + private Image image; + private int angle; + private Timer timer; + + public static GuideLoadingPane getInstance() { + if (imagePanel == null) { + imagePanel = new GuideLoadingPane(); + } + return imagePanel; + } + + public GuideLoadingPane() { + this.setOpaque(false); + this.setPreferredSize(new Dimension(50, 50)); + timer = new Timer(1000 / FPS, new ActionListener() { + @Override + public void actionPerformed(ActionEvent e) { + repaint(); + angle -= 180 / FPS; // 5 degrees per 100 ms = 50 degrees/second + if (angle > -270) { + angle += 2 * 360; + } + } + }); + } + + public void start() { + angle = START_ANGLE; + timer.start(); + } + + public void stop() { + timer.stop(); + } + + @Override + public void paintComponent(Graphics g) { + super.paintComponent(g); + Graphics2D g2 = (Graphics2D) g; + g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON); + + Composite oldComposite = g2.getComposite(); + Stroke oldStroke = g2.getStroke(); + + g2.setComposite(AlphaComposite.getInstance(AlphaComposite.SRC_OVER)); + + int d = Math.min(getWidth(), getHeight()); + int r = d / 2; + Point circlePoint = new Point(getWidth() / 2, getHeight() / 2); + + g2.setColor(Color.WHITE); + g2.fillOval(circlePoint.x - r, circlePoint.y - r, d, d); + + g2.setColor(Color.BLACK); + int waitCircleD = d / 10; + int waitCircleR = waitCircleD / 2; + + g2.fillOval(circlePoint.x - r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); + g2.fillOval(circlePoint.x - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); + g2.fillOval(circlePoint.x + r / 3 - waitCircleR, circlePoint.y - waitCircleR, waitCircleD, waitCircleD); + + + g2.setStroke(STROKE); + g2.setColor(Color.decode("#419BF9")); + + int lineWidth = (int) STROKE.getLineWidth(); + g2.drawArc(circlePoint.x - r + lineWidth / 2 , circlePoint.y - r + lineWidth / 2, d - lineWidth, d - lineWidth, angle, -90); + + g2.setStroke(oldStroke); + g2.setComposite(oldComposite); + } +} diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java deleted file mode 100644 index deaf97417..000000000 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/ImagePanel.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.fr.design.mainframe.guide.ui; - -import javax.swing.JPanel; -import java.awt.Graphics; -import java.awt.Image; -import java.awt.Toolkit; - -/** - * Created by kerry on 2020-10-23 - */ -public class ImagePanel extends JPanel { - - - private Image image; - - public ImagePanel(String imagePath) { - image = Toolkit.getDefaultToolkit().createImage(ImagePanel.class - .getResource(imagePath)); - } - - @Override - public void paintComponent(Graphics g) { - super.paintComponent(g); - if (image != null) { - g.drawImage(image, 0, 0, getWidth(), getHeight(), this); - } - } -} From 4100e7889a39efa193129683f9e6c900ed85cd0a Mon Sep 17 00:00:00 2001 From: Starryi Date: Tue, 19 Oct 2021 22:11:41 +0800 Subject: [PATCH 09/22] =?UTF-8?q?REPORT-61219=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=8E=B7=E5=8F=96=E3=80=91=E5=8F=B3=E9=94=AE=E6=9C=89?= =?UTF-8?q?=E4=B8=BB=E9=A2=98=E7=9A=84=E7=BB=84=E4=BB=B6=EF=BC=8C=E9=BC=A0?= =?UTF-8?q?=E6=A0=87=E4=BB=8E=E8=8E=B7=E5=8F=96=E4=B8=BB=E9=A2=98=E6=BB=91?= =?UTF-8?q?=E5=88=B0=E8=AF=A6=E7=BB=86=E8=AF=B4=E6=98=8E=EF=BC=8C=E4=B8=A4?= =?UTF-8?q?=E4=B8=AA=E9=83=BD=E8=A2=AB=E9=80=89=E4=B8=AD=E4=BA=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 修改主题下载交互 【改动思路】 同上 --- .../share/ui/actions/LoadingMenuItem.java | 6 ++- .../SharedComponentActionMenuItemUI.java | 54 +++++++++++++------ 2 files changed, 42 insertions(+), 18 deletions(-) diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java index 6262c34a3..883a30644 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/LoadingMenuItem.java @@ -23,7 +23,7 @@ public class LoadingMenuItem extends UIMenuItem { super(action); setOpaque(true); setBackground(ColorConstants.BACKGROUND); - setUI(new SharedComponentActionMenuItemUI(false)); + setUI(new SharedComponentActionMenuItemUI()); } public void startLoading() { @@ -40,6 +40,10 @@ public class LoadingMenuItem extends UIMenuItem { repaint(); } + public boolean isLoading() { + return loading; + } + @Override protected void paintBorder(Graphics g) { super.paintBorder(g); diff --git a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java index 8a3fe5e1c..a400ccf37 100644 --- a/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java +++ b/designer-form/src/main/java/com/fr/design/mainframe/share/ui/actions/SharedComponentActionMenuItemUI.java @@ -2,6 +2,8 @@ package com.fr.design.mainframe.share.ui.actions; import com.fr.design.constants.UIConstants; import com.fr.design.gui.imenu.UIMenuItemUI; +import com.fr.design.gui.imenu.UIPopupMenu; +import com.fr.design.mainframe.share.ui.constants.ColorConstants; import com.fr.design.utils.gui.GUIPaintUtils; import com.fr.stable.Constants; @@ -10,6 +12,8 @@ import javax.swing.JMenu; import javax.swing.JMenuItem; import javax.swing.MenuSelectionManager; import java.awt.Color; +import java.awt.Component; +import java.awt.Container; import java.awt.Graphics; import java.awt.Graphics2D; @@ -20,16 +24,6 @@ import java.awt.Graphics2D; */ public class SharedComponentActionMenuItemUI extends UIMenuItemUI { - private final boolean autoClosePopup; - - public SharedComponentActionMenuItemUI(boolean autoClosePopup) { - this.autoClosePopup = autoClosePopup; - } - - public SharedComponentActionMenuItemUI() { - this(true); - } - @Override protected void paintBackground(Graphics g, JMenuItem menuItem, Color bgColor) { ButtonModel model = menuItem.getModel(); @@ -37,19 +31,45 @@ public class SharedComponentActionMenuItemUI extends UIMenuItemUI { int menuWidth = menuItem.getWidth(); int menuHeight = menuItem.getHeight(); - if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { - GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 0); + g.setColor(ColorConstants.BACKGROUND); + g.fillRect(0, 0, menuWidth, menuHeight); + if (menuItem.isOpaque()) { + if (model.isArmed() || (menuItem instanceof JMenu && model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + } else { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, menuItem.getBackground(), 7); + } + g.setColor(oldColor); + } else if (model.isArmed() || (menuItem instanceof JMenu && + model.isSelected())) { + GUIPaintUtils.fillPaint((Graphics2D) g, 0, 0, menuWidth, menuHeight, true, Constants.NULL, UIConstants.FLESH_BLUE, 7); + g.setColor(oldColor); } - - g.setColor(oldColor); } @Override protected void doClick(MenuSelectionManager msm) { - if (autoClosePopup) { - super.doClick(msm); - } else { + if (hasLoadingMenuItem()) { + return; + } + + if (menuItem instanceof LoadingMenuItem) { menuItem.doClick(0); + } else { + super.doClick(msm); + } + } + + private boolean hasLoadingMenuItem() { + Container parent = menuItem.getParent(); + if (parent instanceof UIPopupMenu) { + Component[] components = parent.getComponents(); + for (Component component: components) { + if (component instanceof LoadingMenuItem && ((LoadingMenuItem) component).isLoading()) { + return true; + } + } } + return false; } } From 5269cee3a6a8b8806c311d5a8e46d3bc9027de80 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 19 Oct 2021 23:07:55 +0800 Subject: [PATCH 10/22] =?UTF-8?q?REPORT-61207=20=E8=A1=8C=E9=97=B4?= =?UTF-8?q?=E8=B7=9D=E5=87=8F=E5=B0=8F=EF=BC=8C=E6=94=BE=E5=9C=A8window?= =?UTF-8?q?=E4=B8=8A=E6=96=87=E5=AD=97=E6=88=AA=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java index af1854d7a..b90c5718c 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/guide/ui/GuideCompleteDialog.java @@ -78,7 +78,7 @@ public class GuideCompleteDialog extends JDialog { title.setForeground(FONT_COLOR); textArea = new UITextPane(); - changeLineSpacing(textArea, 0.19f,false); + changeLineSpacing(textArea, 0.15f,false); textArea.setEnabled(false); textArea.setOpaque(false); textArea.setFont(CONTENT_FONT); From c111cea5900927c01a526df4d5658ed6c603684d Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Tue, 19 Oct 2021 23:08:59 +0800 Subject: [PATCH 11/22] =?UTF-8?q?REPORT-61177=20=E8=A7=A3=E5=86=B3?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E9=A1=B5=E5=BC=B9=E7=AA=97=E5=B1=95=E7=A4=BA?= =?UTF-8?q?=E5=8F=98=E6=88=90=E5=8D=8A=E9=80=8F=E6=98=8E=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guide/creator/layout/UseLayoutAndComponentGuide.java | 2 +- .../guide/creator/theme/DownloadComponentPackageGuide.java | 2 +- .../design/mainframe/guide/creator/theme/ThemeToggleGuide.java | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java index 0ea5b0645..0a8c3abae 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java @@ -156,7 +156,7 @@ public class UseLayoutAndComponentGuide { scene.showScene(); GuideCreateUtils.TIMER.purge(); } - }, 100); + }, 300); return false; } }); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java index 2fdbe0699..3b6e86a8f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java @@ -254,7 +254,7 @@ public class DownloadComponentPackageGuide { scene.showScene(); GuideCreateUtils.TIMER.purge(); } - }, 100); + }, 300); return false; } }); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java index 8baffb676..a61c592a3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java @@ -141,7 +141,7 @@ public class ThemeToggleGuide { scene.showScene(); GuideCreateUtils.TIMER.purge(); } - },100); + },300); return false; } }); From ae5cd80e9c61c7c32b1f29a013b3d9e14c9ae5e1 Mon Sep 17 00:00:00 2001 From: pengda Date: Wed, 20 Oct 2021 10:39:22 +0800 Subject: [PATCH 12/22] =?UTF-8?q?REPORT-61105=20&=20REPORT-61096=20&=20REP?= =?UTF-8?q?ORT-61012=20=E6=8E=A7=E4=BB=B6=E8=81=94=E5=8A=A8=E5=8F=8A?= =?UTF-8?q?=E5=85=BC=E5=AE=B9=E8=80=81=E6=A8=A1=E6=9D=BF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../javascript/ExportJavaScriptPane.java | 35 +++++++++++++------ 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index b559c22e6..cd094480b 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -399,6 +399,8 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane { + if (e.getStateChange() == ItemEvent.SELECTED) { + final int row = table.getSelectedRow(); + if (row == -1) { + return; + } + SingleJavaScript js = getList().get(row); + Object ob = fileNameComboBox.getSelectedItem(); + if (ob != null) { + String value = ob.toString(); + js.setDefaultFileName(StringUtils.equals(value, DEFAULT)); + if (js.isDefaultFileName()) { + js.setFileName(StringUtils.EMPTY); + } + } + table.repaint(); + } + }); this.addCellEditorListener(new CellEditorListener() { @Override @@ -458,15 +478,6 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane Date: Wed, 20 Oct 2021 10:55:14 +0800 Subject: [PATCH 13/22] =?UTF-8?q?REPORT-52578=2010.0=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=96=B0=E8=87=AA=E9=80=82=E5=BA=94=E6=8F=92=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81=E5=9C=A811.0=E4=B8=AD?= =?UTF-8?q?=E9=9C=80=E8=A6=81=E6=94=B9=E6=88=90=E5=BC=82=E6=AD=A5=E7=9A=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/app/FormApp.java | 47 +++++++++---------- 1 file changed, 21 insertions(+), 26 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index 286890303..c048edbd0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -58,36 +58,31 @@ class FormApp extends AbstractAppProvider { * @return */ private JTemplate compatibleForm(FILE tplFile, HashMap classType) { - if (ComparatorUtils.equals(StableFactory.getRegisteredClass(BaseJForm.XML_TAG), JForm.class)) { - classType.put(Constants.ARG_2, Parameter[].class); - JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); - OpenWorker> worker = new OpenWorker<>( - new Callable>() { - @Override - public OpenResult call() throws Exception { - Form form = getForm(tplFile); - return new OpenResult<>(form, form.getParameters()); - } - }, emptyForm); - worker.addCallBack(new Callable>() { - @Override - public JTemplate call() throws Exception { - OpenResult result = worker.getResult(); - return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); - } - }); - worker.start(tplFile.getPath()); - OpenResult result = worker.getResult(); - if (result != null) { + classType.put(Constants.ARG_2, Parameter[].class); + JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); + OpenWorker> worker = new OpenWorker<>( + new Callable>() { + @Override + public OpenResult call() throws Exception { + Form form = getForm(tplFile); + return new OpenResult<>(form, form.getParameters()); + } + }, emptyForm); + worker.addCallBack(new Callable>() { + @Override + public JTemplate call() throws Exception { + OpenResult result = worker.getResult(); return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); + new Object[]{result.getBaseBook(), tplFile, result.getRef()}, classType, BaseJForm.class); } - return emptyForm; - } else { + }); + worker.start(tplFile.getPath()); + OpenResult result = worker.getResult(); + if (result != null) { return (JTemplate) StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, - new Object[]{getForm(tplFile), tplFile}, classType, BaseJForm.class); + new Object[]{result.getBaseBook(), tplFile, new Parameter[0]}, classType, BaseJForm.class); } + return emptyForm; } @Nullable From dcec661132e66fe7f4b02201c8830573d70d020b Mon Sep 17 00:00:00 2001 From: vito Date: Wed, 20 Oct 2021 11:04:54 +0800 Subject: [PATCH 14/22] =?UTF-8?q?REPORT-60991=20=E5=AF=BC=E5=87=BA?= =?UTF-8?q?=E5=8F=82=E6=95=B0=E8=AE=BE=E7=BD=AE=E9=9D=A2=E6=9D=BF=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E6=97=A0=E5=93=8D=E5=BA=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/fr/design/javascript/ExportJavaScriptPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java index b57531ef7..c173102f9 100644 --- a/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java +++ b/designer-base/src/main/java/com/fr/design/javascript/ExportJavaScriptPane.java @@ -637,7 +637,7 @@ public class ExportJavaScriptPane extends AbstractHyperLinkPane(Arrays.asList(providers))); } return paraButton; } From fd4b15f8f992f1ea72db2ccacdf3d290aa5d8d2f Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 20 Oct 2021 11:52:49 +0800 Subject: [PATCH 15/22] =?UTF-8?q?REPORT-61055=20=E3=80=90=E4=B8=BB?= =?UTF-8?q?=E9=A2=98=E8=8E=B7=E5=8F=96=E3=80=91=E4=B8=BB=E9=A2=98=E5=AF=BC?= =?UTF-8?q?=E5=87=BA=E6=8F=92=E4=BB=B6=E5=87=A0=E4=B8=AA=E5=B0=8F=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 主题编辑面板开放交互接口,便于与插件中的导出按钮交互 【改动思路】 同上 --- .../mainframe/theme/TemplateThemeProfilePane.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java index 4fc65badb..bc787bb18 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/theme/TemplateThemeProfilePane.java @@ -141,6 +141,7 @@ public abstract class TemplateThemeProfilePane extends if (saveAsButton != null) { saveAsButton.setEnabled(StringUtils.isNotEmpty(name)); } + actionListener.onInitialize(theme); isPopulating = false; } @@ -218,6 +219,7 @@ public abstract class TemplateThemeProfilePane extends super.afterCommit(); saveButton.setEnabled(false); saveAsButton.setEnabled(true); + actionListener.onSaved(config.cachedFetch(getName())); DesignerToastMsgUtil.toastPrompt(Toolkit.i18nText("Fine-Design_Basic_Template_Theme_Profile_Pane_Save_Successfully")); } }); @@ -342,11 +344,21 @@ public abstract class TemplateThemeProfilePane extends } public interface TemplateThemeProfileActionListener { + void onInitialize(TemplateTheme theme); + void onThemeNameChecked(String name, boolean valid); + + void onSaved(TemplateTheme theme); } public static class TemplateThemeProfileActionAdapter implements TemplateThemeProfileActionListener { + @Override + public void onInitialize(TemplateTheme theme) {} + @Override public void onThemeNameChecked(String name, boolean valid) { } + + @Override + public void onSaved(TemplateTheme theme) {} } } \ No newline at end of file From b2fef89cb4ce7a871ad2b5cb778d48a8ca07a0ce Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 20 Oct 2021 14:09:49 +0800 Subject: [PATCH 16/22] =?UTF-8?q?REPORT-61237=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=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8-?= =?UTF-8?q?=E8=87=AA=E9=80=82=E5=BA=94=E5=B8=83=E5=B1=80-=E6=96=B0?= =?UTF-8?q?=E5=BB=BA=E7=A9=BA=E7=99=BD=E6=A8=A1=E6=9D=BF=EF=BC=8C=E5=88=87?= =?UTF-8?q?=E6=8D=A2=E5=88=B0=E5=9B=BA=E5=AE=9A=E5=B8=83=E5=B1=80=EF=BC=8C?= =?UTF-8?q?=E6=AD=A4=E6=97=B6=E6=97=A0=E6=B3=95=E5=BE=80=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E7=94=BB=E5=B8=83=E9=87=8C=E6=8B=96=E5=85=A5=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/beans/adapters/layout/FRFixLayoutAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFixLayoutAdapter.java b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFixLayoutAdapter.java index d649c5e30..7fe0f5d7a 100644 --- a/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFixLayoutAdapter.java +++ b/designer-form/src/main/java/com/fr/design/designer/beans/adapters/layout/FRFixLayoutAdapter.java @@ -110,7 +110,8 @@ public class FRFixLayoutAdapter extends AbstractLayoutAdapter { @Override public boolean accept(XCreator creator, int x, int y) { - return true; + Component component = container.getComponentAt(x, y); + return component != container; } From 5480d73debae351591817006bb15851c7d3f3074 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 20 Oct 2021 14:39:56 +0800 Subject: [PATCH 17/22] =?UTF-8?q?=E6=97=A0JIRA=E4=BB=BB=E5=8A=A1=20?= =?UTF-8?q?=E6=8D=A2=E4=B8=80=E4=B8=8Bsvg=E5=9B=BE=E7=89=87=EF=BC=8C?= =?UTF-8?q?=E5=8E=9F=E6=9D=A5=E7=9A=84svg=E5=9B=BE=E7=89=87=E6=9C=89?= =?UTF-8?q?=E7=82=B9=E5=8F=98=E5=BD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/guide/complete_all.svg | 15 ++++------- .../design/mainframe/guide/complete_none.svg | 21 ++++------------ .../design/mainframe/guide/complete_some.svg | 25 +++++++------------ 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg index f609eb9e5..f18c15802 100644 --- a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg +++ b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_all.svg @@ -1,17 +1,12 @@ - 编组 7备份 4 - - - - - + 全部完成 - - + + - - + + diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg index 0e945f5a8..ec078243b 100644 --- a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg +++ b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_none.svg @@ -1,23 +1,12 @@ - 编组 7备份 5 - - - - - - + 未完成@2x - - + + - - - - - - - + + diff --git a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg index 9cff96f2a..e6151ea03 100644 --- a/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg +++ b/designer-base/src/main/resources/com/fr/design/mainframe/guide/complete_some.svg @@ -1,28 +1,21 @@ - 编组 7备份 4 + 部分完成 - - - - - + - - + + - + - - + + - - - - - + + From a0566c38606f7973e58ccded7d0d3e73e533954b Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 20 Oct 2021 14:49:26 +0800 Subject: [PATCH 18/22] =?UTF-8?q?REPORT-61249=20=E8=A7=86=E8=A7=89?= =?UTF-8?q?=E5=9B=BE=E5=8F=98=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/form/layouts/templates/5-7/2.frm | 24 ++++---- .../design/form/layouts/templates/multi/4.frm | 57 +++++++++++-------- 2 files changed, 45 insertions(+), 36 deletions(-) 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..17a624d7d 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 @@ -59,50 +59,50 @@ - + - + - + - + - + - + - + - + - + - + - + - + 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..c18a36d26 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 @@ -59,96 +59,105 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + + + + + + + + + - - - - + + + + + From ecce754c425a8047735dca87916d659f8f402577 Mon Sep 17 00:00:00 2001 From: Starryi Date: Wed, 20 Oct 2021 15:02:08 +0800 Subject: [PATCH 19/22] =?UTF-8?q?REPORT-61267=20=E3=80=90FR11=E3=80=91?= =?UTF-8?q?=E3=80=90=E7=BB=84=E4=BB=B6=E8=83=8C=E6=99=AF=E5=88=86=E7=A6=BB?= =?UTF-8?q?=E3=80=91=E7=BB=84=E4=BB=B6=E5=A4=8D=E7=94=A8-=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E6=A0=87=E9=A2=98=E5=9B=BE=E6=A1=88=E7=9A=84=E2=80=9C?= =?UTF-8?q?=E5=9B=BE=E6=A1=88=E7=9B=B8=E5=AF=B9=E4=BD=8D=E7=BD=AE=E2=80=9D?= =?UTF-8?q?=E5=88=87=E6=8D=A2=E4=B8=8D=E7=94=9F=E6=95=88=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E5=8F=AA=E6=9C=89=E5=9C=A8=E9=87=8D=E6=96=B0=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E5=9B=BE=E6=A1=88=E7=9A=84=E6=97=B6=E5=80=99=E6=89=8D=E7=94=9F?= =?UTF-8?q?=E6=95=88=EF=BC=9B=E2=80=9C=E4=BD=8D=E7=BD=AE=E2=80=9D=E4=B9=9F?= =?UTF-8?q?=E4=B8=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 【问题原因】 UIButtonGroup在点击控件时会触发多次内部ToggleButton的fireStateChange,所以需要在所有按钮内部状态改变时, 统一只触发一次fireStateChange. UIButtonGroup也需要实现UIObserver接口,否则外部不会挂载监听器,导致 不生效。 【改动思路】 同上 --- .../fr/design/gui/ibutton/UIButtonGroup.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java index 34a7a0012..cbebaf9d8 100644 --- a/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java +++ b/designer-base/src/main/java/com/fr/design/gui/ibutton/UIButtonGroup.java @@ -3,6 +3,8 @@ package com.fr.design.gui.ibutton; import com.fr.design.constants.UIConstants; import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameObserver; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.stable.ArrayUtils; import com.fr.stable.StringUtils; @@ -24,7 +26,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.List; -public class UIButtonGroup extends JPanel implements GlobalNameObserver { +public class UIButtonGroup extends JPanel implements GlobalNameObserver, UIObserver { private static final long serialVersionUID = 1L; private static final int TEXT_LENGTH = 3; private static final int BUTTON_SIZE = 2; @@ -37,6 +39,7 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { private boolean isToolBarComponent = false; private boolean isClick; + private UIObserverListener uiObserverListener; private boolean autoFireStateChanged = true; public UIButtonGroup(String[] textArray) { @@ -326,6 +329,9 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { ((ChangeListener) listeners[i + 1]).stateChanged(e); } } + if (uiObserverListener != null) { + uiObserverListener.doChange(); + } } /** @@ -368,6 +374,16 @@ public class UIButtonGroup extends JPanel implements GlobalNameObserver { return true; } + @Override + public void registerChangeListener(UIObserverListener listener) { + this.uiObserverListener = listener; + } + + @Override + public boolean shouldResponseChangeListener() { + return true; + } + /** * @param l From 0c76b726ba247cb250d3633de174b90c465a84e9 Mon Sep 17 00:00:00 2001 From: kuangshuai Date: Wed, 20 Oct 2021 15:32:26 +0800 Subject: [PATCH 20/22] =?UTF-8?q?REPORT-61275=20=E9=83=A8=E5=88=86?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E9=BB=98=E8=AE=A4=E5=B7=A5=E5=85=B7=E6=A0=8F?= =?UTF-8?q?=E5=B1=95=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../guide/creator/layout/UseLayoutAndComponentGuide.java | 2 ++ .../guide/creator/theme/DownloadComponentPackageGuide.java | 1 + .../design/mainframe/guide/creator/theme/ThemeToggleGuide.java | 1 + 3 files changed, 4 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java index 0a8c3abae..05f0d20be 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/layout/UseLayoutAndComponentGuide.java @@ -89,7 +89,9 @@ public class UseLayoutAndComponentGuide { Component component = ComponentUtils.findComponentByName(NorthRegionContainerPane.getInstance(), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_File")); fileHeadMenu = ((UIHeadMenu) component); asyncThemeFetcher.shutdown(); + EastRegionContainerPane.getInstance().showContainer(); GuideManager.getInstance().getCurrentGuide().start(); + } }); } else { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java index 3b6e86a8f..f5d8bf57f 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/DownloadComponentPackageGuide.java @@ -99,6 +99,7 @@ public class DownloadComponentPackageGuide { GuideManager.getInstance().getCurrentGuide().terminate(); return false; } + EastRegionContainerPane.getInstance().showContainer(); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); OnlineWidgetRepoPane onlineWidgetRepoPane = OnlineWidgetRepoPane.getInstance(); OnlineWidgetTabPane tabPane = (OnlineWidgetTabPane) ComponentUtils.findComponentByClass(onlineWidgetRepoPane, OnlineWidgetTabPane.class); diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java index a61c592a3..3ab6234a3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/guide/creator/theme/ThemeToggleGuide.java @@ -82,6 +82,7 @@ public class ThemeToggleGuide { GuideCreateUtils.showNoFileAuthAlert(); GuideManager.getInstance().getCurrentGuide().terminate(); } else { + EastRegionContainerPane.getInstance().showContainer(); EastRegionContainerPane.getInstance().switchTabTo(EastRegionContainerPane.KEY_WIDGET_SETTINGS); asyncThemeFetcher.shutdown(); GuideManager.getInstance().getCurrentGuide().start(); From d3e06d8673ebd96170f4eac7142f4b4235ac5041 Mon Sep 17 00:00:00 2001 From: kerry Date: Wed, 20 Oct 2021 16:05:00 +0800 Subject: [PATCH 21/22] =?UTF-8?q?REPORT-61205=20=E6=A0=87=E5=87=86?= =?UTF-8?q?=E8=89=B2=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/style/color/ColorFactory.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java b/designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java index b643752b3..0ab0d8f38 100644 --- a/designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java +++ b/designer-base/src/main/java/com/fr/design/style/color/ColorFactory.java @@ -3,7 +3,7 @@ package com.fr.design.style.color; import java.awt.Color; public interface ColorFactory { - + public static final Color MenuColors[] = { Color.black, new Color(153, 51, 0), @@ -72,17 +72,17 @@ public interface ColorFactory { }; public static final Color STANDARD_COLORS[] = { - new Color(166, 89, 66), - new Color(166, 123, 66), - new Color(166, 66, 66), - new Color(103, 166, 66), - new Color(66, 121, 166), - new Color(68, 66, 166), - new Color(98, 66, 166), - new Color(146, 66, 166), - new Color(75, 18, 89), - new Color(89, 18, 51) + new Color(234, 68, 49), + new Color(179, 96, 36), + new Color(232, 147, 37), + new Color(109, 214, 50), + new Color(51, 147, 219), + new Color(56, 54, 179), + new Color(93, 54, 179), + new Color(154, 54, 179), + new Color(127, 76, 217), + new Color(179, 36, 102) }; - -} \ No newline at end of file + +} From a18f27c41af4820d5e66c1517934f0d9ac302ea5 Mon Sep 17 00:00:00 2001 From: "Henry.Wang" Date: Wed, 20 Oct 2021 16:27:59 +0800 Subject: [PATCH 22/22] =?UTF-8?q?REPORT-61276=20=E5=86=B3=E7=AD=96?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8-=E6=9C=80=E6=96=B0=E7=9A=84release=E5=8C=85?= =?UTF-8?q?=EF=BC=8C=E6=89=93=E5=BC=80=E5=86=B3=E7=AD=96=E6=8A=A5=E8=A1=A8?= =?UTF-8?q?=E4=BC=9A=E6=89=93=E5=BC=80=E4=B8=80=E4=B8=AA=E7=A9=BAcpt?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=BB=BAfrm=E6=AD=A3=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ui/designer/NewFormPane.java | 11 +---------- .../java/com/fr/design/mainframe/app/FormApp.java | 4 +++- 2 files changed, 4 insertions(+), 11 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 ca3e26654..5e55b692d 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 @@ -282,7 +282,7 @@ public class NewFormPane extends BasicPane { private void newForm(String path) { BaseJForm jForm; try { - Form form = initEmptyBodyForm(); + Form form = Form.getEmptyBodyForm(); initLayoutInfo(form, path); jForm = StableFactory.getMarkedInstanceObjectFromClass(BaseJForm.XML_TAG, new Object[]{form}, BaseJForm.class); DesignerContext.getDesignerFrame().addAndActivateJTemplate((JTemplate) jForm); @@ -291,15 +291,6 @@ public class NewFormPane extends BasicPane { } } - private Form initEmptyBodyForm() { - WFitLayout body = new WFitLayout("body"); - body.setContainerWidth(WBorderLayout.DEFAULT_WIDTH); - body.setContainerHeight(WBorderLayout.DEFAULT_HEIGHT); - WBorderLayout borderLayout = new WBorderLayout("form"); - borderLayout.addCenter(body); - return new Form(borderLayout); - } - /** * 通过布局文件的位置初始化Form对象的布局信息 * diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java index c048edbd0..972df0cc8 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/app/FormApp.java @@ -4,6 +4,7 @@ import com.fr.base.Parameter; import com.fr.base.chart.exception.ChartNotFoundException; import com.fr.base.io.XMLEncryptUtils; import com.fr.design.DesignerEnvManager; +import com.fr.design.fit.NewJForm; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.AbstractAppProvider; import com.fr.design.mainframe.BaseJForm; @@ -19,6 +20,7 @@ import com.fr.exception.TplLockedException; import com.fr.file.FILE; import com.fr.form.main.Form; import com.fr.form.ui.container.WBorderLayout; +import com.fr.form.ui.container.WFitLayout; import com.fr.general.ComparatorUtils; import com.fr.log.FineLoggerFactory; import com.fr.report.util.ReadXmlType; @@ -59,7 +61,7 @@ class FormApp extends AbstractAppProvider { */ private JTemplate compatibleForm(FILE tplFile, HashMap classType) { classType.put(Constants.ARG_2, Parameter[].class); - JForm emptyForm = new JForm(new Form(new WBorderLayout("form")), tplFile); + NewJForm emptyForm = new NewJForm(Form.getEmptyBodyForm(), tplFile); OpenWorker> worker = new OpenWorker<>( new Callable>() { @Override