Browse Source

Pull request #7307: REPORT-63660 frm新旧自适应切换-国际化问题

Merge in DESIGN/design from ~FANGLEI/design:release/11.0 to release/11.0

* commit 'fc368f94a141ef212952a9c7dab8a5b7b1b3689c':
  REPORT-63660 frm新旧自适应切换-国际化问题
bugfix/11.0
fanglei 3 years ago
parent
commit
b4e9fec00f
  1. 4
      designer-base/src/main/java/com/fr/design/mainframe/DesktopCardPane.java
  2. 40
      designer-base/src/main/java/com/fr/design/utils/LoadingUtils.java
  3. 0
      designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png
  4. 32
      designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java
  5. BIN
      designer-form/src/main/resources/com/fr/design/form/images/loading.png

4
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;
@ -35,7 +37,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 ForbiddenPane forbiddenPane = new ForbiddenPane();

40
designer-base/src/main/java/com/fr/design/mainframe/OpenLoadingPane.java → 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;
}
}

0
designer-base/src/main/resources/com/fr/design/images/mainframe/openloading.png → designer-base/src/main/resources/com/fr/design/images/mainframe/loading.png

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 5.6 KiB

32
designer-form/src/main/java/com/fr/design/fit/toolbar/SwitchAction.java

@ -3,6 +3,8 @@ package com.fr.design.fit.toolbar;
import com.fr.design.actions.UpdateAction;
import com.fr.design.dialog.FineJOptionPane;
import com.fr.design.file.TemplateTreePane;
import com.fr.design.mainframe.FormDesigner;
import com.fr.design.mainframe.JForm;
import com.fr.design.fit.NewJForm;
import com.fr.design.fit.common.AdaptiveSwitchUtil;
import com.fr.design.fit.common.TemplateTool;
@ -10,9 +12,9 @@ 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.JForm;
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() {
@ -132,19 +130,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);
}
}

BIN
designer-form/src/main/resources/com/fr/design/form/images/loading.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

Loading…
Cancel
Save