From 64540e1e99c449ed61a44f37f36dd40c71268204 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=B9=E7=A3=8A?= <294531121@qq.com> Date: Fri, 24 Dec 2021 14:19:20 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-63660=20frm=E6=96=B0=E6=97=A7=E8=87=AA?= =?UTF-8?q?=E9=80=82=E5=BA=94=E5=88=87=E6=8D=A2-=E5=9B=BD=E9=99=85?= =?UTF-8?q?=E5=8C=96=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/DesktopCardPane.java | 4 +- .../LoadingUtils.java} | 40 +++++++----------- .../{openloading.png => loading.png} | Bin .../fr/design/fit/toolbar/SwitchAction.java | 30 ++++++------- .../com/fr/design/form/images/loading.png | Bin 7641 -> 0 bytes 5 files changed, 32 insertions(+), 42 deletions(-) rename designer-base/src/main/java/com/fr/design/{mainframe/OpenLoadingPane.java => utils/LoadingUtils.java} (78%) rename designer-base/src/main/resources/com/fr/design/images/mainframe/{openloading.png => loading.png} (100%) delete mode 100644 designer-form/src/main/resources/com/fr/design/form/images/loading.png diff --git a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java index 65a9a47d68..42b1a553ed 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java +++ b/designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java @@ -11,9 +11,11 @@ import com.fr.design.dialog.BasicPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; import com.fr.design.gui.itoolbar.UIToolbar; +import com.fr.design.utils.LoadingUtils; import javax.swing.JComponent; import javax.swing.JLayeredPane; +import javax.swing.JPanel; import java.awt.BorderLayout; import java.awt.Component; import java.util.HashMap; @@ -34,7 +36,7 @@ public class DesktopCardPane extends BasicPane implements TargetModifiedListener private static final long serialVersionUID = 1L; private JTemplate component; private TransparentPane transparentPane = new TransparentPane(); - private OpenLoadingPane loadingPane = new OpenLoadingPane(); + private JPanel loadingPane = LoadingUtils.createLoadingPane(); private OpenFailedPane failedPane = new OpenFailedPane(); Map backUpToolbarComponentState = new HashMap<>(); diff --git a/designer-base/src/main/java/com/fr/design/mainframe/OpenLoadingPane.java b/designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java similarity index 78% rename from designer-base/src/main/java/com/fr/design/mainframe/OpenLoadingPane.java rename to designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java index adc30b2bff..d464dec796 100644 --- a/designer-base/src/main/java/com/fr/design/mainframe/OpenLoadingPane.java +++ b/designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java @@ -1,35 +1,29 @@ -package com.fr.design.mainframe; +package com.fr.design.utils; import com.fr.design.gui.ilable.UILabel; import com.fr.design.i18n.Toolkit; import com.fr.general.IOUtils; + +import javax.swing.ImageIcon; +import javax.swing.JPanel; import java.awt.Color; import java.awt.Component; import java.awt.Container; import java.awt.Dimension; import java.awt.LayoutManager; -import javax.swing.ImageIcon; -import javax.swing.JPanel; - -/** - * @author hades - * @version 10.0 - * Created by hades on 2021/4/9 - */ -public class OpenLoadingPane extends JPanel { - private static final ImageIcon LOADING_ICON = new ImageIcon(IOUtils.readImage("/com/fr/design/images/mainframe/openloading.png")); +public class LoadingUtils { + private static final ImageIcon LOADING_ICON = new ImageIcon(IOUtils.readImage("/com/fr/design/images/mainframe/loading.png")); private static final Color TIP_COLOR = new Color(108, 174, 235); private static final int Y_GAP = 50; private static final int X_GAP = 10; - private UILabel loadingLabel; - private UILabel tipLabel; - - public OpenLoadingPane() { - - setLayout(new LayoutManager() { - + public static JPanel createLoadingPane() { + JPanel jPanel = new JPanel(); + UILabel loadingLabel = new UILabel(LOADING_ICON); + UILabel tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Open_Template_Loading")); + tipLabel.setForeground(TIP_COLOR); + jPanel.setLayout(new LayoutManager() { @Override public void removeLayoutComponent(Component comp) { } @@ -64,12 +58,10 @@ public class OpenLoadingPane extends JPanel { public void addLayoutComponent(String name, Component comp) { } }); - setBackground(Color.WHITE); - loadingLabel = new UILabel(LOADING_ICON); - tipLabel = new UILabel(Toolkit.i18nText("Fine-Design_Open_Template_Loading")); - tipLabel.setForeground(TIP_COLOR); - add(loadingLabel); - add(tipLabel); + jPanel.setBackground(Color.WHITE); + jPanel.add(loadingLabel); + jPanel.add(tipLabel); + return jPanel; } } diff --git a/designer-base/src/main/resources/com/fr/design/images/mainframe/openloading.png b/designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png similarity index 100% rename from designer-base/src/main/resources/com/fr/design/images/mainframe/openloading.png rename to designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png diff --git a/designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java b/designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java index e14d39a68f..ed94eadb4d 100644 --- a/designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java +++ b/designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java @@ -11,8 +11,10 @@ import com.fr.design.gui.ibutton.UIButton; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.BaseJForm; import com.fr.design.mainframe.DesignerContext; +import com.fr.design.mainframe.FormDesigner; import com.fr.design.mainframe.JTemplate; import com.fr.design.menu.MenuKeySet; +import com.fr.design.utils.LoadingUtils; import com.fr.file.FILE; import com.fr.file.FILEChooserPane; import com.fr.file.FileFILE; @@ -23,13 +25,10 @@ import com.fr.general.IOUtils; import com.fr.log.FineLoggerFactory; import javax.swing.Icon; -import javax.swing.ImageIcon; import javax.swing.JComponent; -import javax.swing.JLabel; import javax.swing.JOptionPane; import javax.swing.JPanel; import javax.swing.KeyStroke; -import java.awt.BorderLayout; import java.awt.Color; import java.awt.Font; import java.awt.event.ActionEvent; @@ -46,7 +45,6 @@ public class SwitchAction extends UpdateAction { private UIButton switchBtn; private static final Icon SWITCH_ICON = IOUtils.readIcon("/com/fr/design/form/images/icon_switch.png"); - private static final String LOADING_ICON_PATH = "/com/fr/design/form/images/loading.png"; private static final MenuKeySet SWITCH_ATTR = new MenuKeySet() { @Override public char getMnemonic() { @@ -136,19 +134,17 @@ public class SwitchAction extends UpdateAction { * @date: 2020/9/30 15:18 */ public void showLoadingJPanel() { - JComponent area = TemplateTool.getCurrentEditingNewJForm().getFormDesign().getArea(); - JComponent formDesigner = TemplateTool.getCurrentEditingNewJForm().getFormDesign(); - area.remove(formDesigner); - - JPanel loadingJPanel = new JPanel(new BorderLayout()); - loadingJPanel.setBackground(Color.WHITE); - loadingJPanel.setBounds(formDesigner.getBounds()); - JLabel jLabel = new JLabel(new ImageIcon(this.getClass().getResource(LOADING_ICON_PATH)), JLabel.CENTER); - loadingJPanel.add(jLabel, BorderLayout.CENTER); - - area.setLayout(null); - area.add(loadingJPanel); - DesignerContext.getDesignerFrame().setVisible(true); + NewJForm jForm = TemplateTool.getCurrentEditingNewJForm(); + if (jForm != null) { + FormDesigner formDesigner = jForm.getFormDesign(); + JComponent area = formDesigner.getArea(); + area.remove(formDesigner); + area.setLayout(null); + JPanel panel = LoadingUtils.createLoadingPane(); + panel.setBounds(formDesigner.getBounds()); + area.add(panel); + DesignerContext.getDesignerFrame().setVisible(true); + } } diff --git a/designer-form/src/main/resources/com/fr/design/form/images/loading.png b/designer-form/src/main/resources/com/fr/design/form/images/loading.png deleted file mode 100644 index d479fb376be6526651ffa41579bd4551f5d44916..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7641 zcmd6MRZtvC6eS@L+}(o)C%C%@hu}^iz~D}B8(f2j4DRkO!3jFRFgSw*A3V5Zd4IdV zTeVVkTRytFySnc^efr!OO?5>qbaHeA1OzN)B{}Wa_WHG~p}u>q%klSfUK=D^X*FpC zgoY%HCre}m1gd0ZIqA>7Z%#lM0fY-Zqchpr>r)sqN{GMdxQPBdRN5`9Zr4B~nI)=- zj2)b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