Browse Source

Merge pull request #16624 in DESIGN/design from fbp/release to fbp/merge

* commit 'a8859c330d5a6d44f94f9e2118d754d744bd03a3':
  REPORT-147520 fix:折叠弹窗增加esc退出操作
  REPORT-143678 UI启动耗时优化
fbp/merge
superman 2 months ago
parent
commit
3162c12458
  1. 11
      designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java
  2. 29
      designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java
  3. 9
      designer-realize/src/main/java/com/fr/start/MainDesigner.java

11
designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java

@ -11,15 +11,21 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import java.awt.*; import java.awt.Frame;
import java.awt.event.ActionEvent; import java.awt.Dimension;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JDialog; import javax.swing.JDialog;
import javax.swing.JScrollPane; import javax.swing.JScrollPane;
import javax.swing.JTextArea; import javax.swing.JTextArea;
import javax.swing.KeyStroke;
import javax.swing.JComponent;
import static com.fine.swing.ui.layout.Layouts.cell; import static com.fine.swing.ui.layout.Layouts.cell;
@ -70,6 +76,7 @@ public class CollapsibleDetailDialog extends JDialog implements ActionListener {
this.setSize(this.collapseDimension); this.setSize(this.collapseDimension);
GUICoreUtils.centerWindow(this); GUICoreUtils.centerWindow(this);
this.setAlwaysOnTop(true); this.setAlwaysOnTop(true);
this.getRootPane().registerKeyboardAction(e -> dispose(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW);
} }
private void initTopPanel() { private void initTopPanel() {

29
designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java

@ -87,39 +87,11 @@ public class CellElementPropertyPane extends DockingView {
private CellElementEditPane cellElementEditPane; private CellElementEditPane cellElementEditPane;
private JPanel titlePane;
private UILabel title;
private TitleChangeListener titleListener = new TitleChangeListener() {
@Override
public void fireTitleChange(String addName) {
title.setText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_CellElement_Property_Table") + '-' + addName);
}
};
private CellElementPropertyPane() { private CellElementPropertyPane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.setBorder(null); this.setBorder(null);
cellElementEditPane = new CellElementEditPane(); cellElementEditPane = new CellElementEditPane();
cellElementEditPane.addTitleChangeListner(titleListener);
titlePane = new JPanel(new BorderLayout());
title = new UILabel(this.getViewTitle() + '-' + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Expand_Attribute")) {
private static final long serialVersionUID = 1L;
@Override
public Dimension getPreferredSize() {
return new Dimension(super.getPreferredSize().width, 19);
}
};
title.setHorizontalAlignment(SwingConstants.CENTER);
title.setVerticalAlignment(SwingConstants.CENTER);
titlePane.add(title, BorderLayout.CENTER);
titlePane.setBorder(BorderFactory.createEmptyBorder(10,0,1,0));
// this.add(titlePane, BorderLayout.NORTH);
this.add(cellElementEditPane, BorderLayout.CENTER); this.add(cellElementEditPane, BorderLayout.CENTER);
} }
@Override @Override
@ -144,7 +116,6 @@ public class CellElementPropertyPane extends DockingView {
} }
public void removeAll() { public void removeAll() {
this.remove(titlePane);
this.remove(cellElementEditPane); this.remove(cellElementEditPane);
} }

9
designer-realize/src/main/java/com/fr/start/MainDesigner.java

@ -26,6 +26,7 @@ import com.fr.design.gui.imenu.UIMenuItem;
import com.fr.design.gui.imenu.UIPopupMenu; import com.fr.design.gui.imenu.UIPopupMenu;
import com.fr.design.i18n.Toolkit; import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.ActiveKeyGenerator; import com.fr.design.mainframe.ActiveKeyGenerator;
import com.fr.design.mainframe.CellElementPropertyPane;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.DesignerUIModeConfig;
import com.fr.design.mainframe.InformationCollector; import com.fr.design.mainframe.InformationCollector;
@ -92,6 +93,7 @@ public class MainDesigner extends BaseDesigner {
public MainDesigner(String[] args) { public MainDesigner(String[] args) {
super(args); super(args);
preloadChildrenComponents();
} }
/** /**
@ -581,4 +583,11 @@ public class MainDesigner extends BaseDesigner {
return new SplashCommon(); return new SplashCommon();
} }
/**
* 充分利用awt线程的空闲时间初始化耗时面板组件
*/
protected void preloadChildrenComponents() {
CellElementPropertyPane.getInstance();
}
} }

Loading…
Cancel
Save