Browse Source

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

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

* commit '1e7a16ff90f18dd004481bca58a0575fb89b5a28':
  REPORT-113064 超链-网络报表,卡顿修复效果不明显
fix-lag
Destiny.Lin-林锦龙 11 months ago
parent
commit
51eb344764
  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.file.TemplateTreePane;
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.layout.FRGUIPaneFactory;
import com.fr.design.utils.DesignUtils;
@ -11,6 +12,7 @@ import com.fr.file.filetree.IOFileNodeFilter;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.SwingWorker;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Font;
@ -23,6 +25,8 @@ public class ReportletPane extends BasicPane {
private ClassFileTree classReportletTree;
private JScrollPane c_panel;
private JScrollPane loadPanel;
private UIButton switchButton;
private CardLayout card;
private JPanel cardPane;
@ -59,8 +63,13 @@ public class ReportletPane extends BasicPane {
cardPane.add(t_panel = new JScrollPane(templateReportletTree), "TEMPLATE");
classReportletTree = new ClassFileTree();
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) {
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"));
new SwingWorker<Void, Void>() {
@Override
protected Void doInBackground() throws Exception {
classReportletTree.refreshEnv();
return null;
}
@Override
protected void done() {
card.show(cardPane, "CLASS");
}
}.execute();
} else {
card.show(cardPane, "TEMPLATE");
switchButton.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Utils_Switch_To_Class_Reportlet"));

Loading…
Cancel
Save