Browse Source

Pull request #5: REPORT-113064 超链-网络报表,卡顿修复效果不明显

Merge in ~DESTINY.LIN/design from Fix-lag to fix-lag

* commit 'c424f95a568d21a99c96e510b9cd4d3e17b244a3':
  REPORT-113064 超链-网络报表,卡顿修复效果不明显
fix-lag
Destiny.Lin-林锦龙 11 months ago
parent
commit
1e7a16ff90
  1. 25
      designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

25
designer-base/src/main/java/com/fr/design/gui/itree/filetree/ReportletPane.java

@ -3,6 +3,7 @@ package com.fr.design.gui.itree.filetree;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.file.TemplateTreePane; import com.fr.design.file.TemplateTreePane;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextarea.UITextArea;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils; import com.fr.design.utils.DesignUtils;
@ -11,6 +12,7 @@ import com.fr.file.filetree.IOFileNodeFilter;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Font; import java.awt.Font;
@ -23,6 +25,8 @@ public class ReportletPane extends BasicPane {
private ClassFileTree classReportletTree; private ClassFileTree classReportletTree;
private JScrollPane c_panel; private JScrollPane c_panel;
private JScrollPane loadPanel;
private UIButton switchButton; private UIButton switchButton;
private CardLayout card; private CardLayout card;
private JPanel cardPane; private JPanel cardPane;
@ -59,8 +63,13 @@ public class ReportletPane extends BasicPane {
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE"); cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree(); classReportletTree = new ClassFileTree();
cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS"); cardPane.add(c_panel = new JScrollPane(classReportletTree), "CLASS");
JPanel panel = new JPanel();
panel.add(new UILabel("loading..."));
cardPane.add(loadPanel = new JScrollPane(panel), "LOADING");
this.refreshEnv(); // 初始化的时候没有采用到Class面板,没必要这里就刷新,这里只需要刷template面板就行
TemplateFileTree tree = TemplateTreePane.getInstance().getTemplateFileTree();
this.templateReportletTree.setModel(tree.getModel());
} }
/* /*
@ -68,8 +77,20 @@ public class ReportletPane extends BasicPane {
*/ */
private void switchCardPane(boolean switch2Class) { private void switchCardPane(boolean switch2Class) {
if (switch2Class) { if (switch2Class) {
card.show(cardPane, "CLASS"); card.show(cardPane, "LOADING");
switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Template_Reportlet")); switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Template_Reportlet"));
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
classReportletTree.refreshEnv();
return null;
}
@Override
protected void done() {
card.show(cardPane, "CLASS");
}
}.execute();
} else { } else {
card.show(cardPane, "TEMPLATE"); card.show(cardPane, "TEMPLATE");
switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Class_Reportlet")); switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Class_Reportlet"));

Loading…
Cancel
Save