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 a2c6efcb2b..74dc180755 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 @@ -10,9 +10,11 @@ import com.fr.design.data.BasicTableDataTreePane; import com.fr.design.dialog.BasicPane; import com.fr.design.event.TargetModifiedEvent; import com.fr.design.event.TargetModifiedListener; +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; @@ -31,7 +33,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(); private JLayeredPane layeredPane = new JLayeredPane() { @Override 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..433df931a9 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; } -} +} \ No newline at end of file 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