diff --git a/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java b/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java index cc73abc36d..01d3b6f08e 100644 --- a/designer-base/src/main/java/com/fr/design/dialog/CollapsibleDetailDialog.java +++ b/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.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; -import java.awt.*; -import java.awt.event.ActionEvent; +import java.awt.Frame; +import java.awt.Dimension; +import java.awt.BorderLayout; +import java.awt.Color; import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.KeyEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; import javax.swing.JPanel; import javax.swing.JDialog; import javax.swing.JScrollPane; import javax.swing.JTextArea; +import javax.swing.KeyStroke; +import javax.swing.JComponent; import static com.fine.swing.ui.layout.Layouts.cell; @@ -70,6 +76,7 @@ public class CollapsibleDetailDialog extends JDialog implements ActionListener { this.setSize(this.collapseDimension); GUICoreUtils.centerWindow(this); this.setAlwaysOnTop(true); + this.getRootPane().registerKeyboardAction(e -> dispose(), KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), JComponent.WHEN_IN_FOCUSED_WINDOW); } private void initTopPanel() { diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java index 9fd6027fb4..45fff6bb0e 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/CellElementPropertyPane.java @@ -87,39 +87,11 @@ public class CellElementPropertyPane extends DockingView { 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() { this.setLayout(new BorderLayout()); this.setBorder(null); 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); - } @Override @@ -144,7 +116,6 @@ public class CellElementPropertyPane extends DockingView { } public void removeAll() { - this.remove(titlePane); this.remove(cellElementEditPane); } diff --git a/designer-realize/src/main/java/com/fr/start/MainDesigner.java b/designer-realize/src/main/java/com/fr/start/MainDesigner.java index 17595c25bb..8bede3d3ab 100644 --- a/designer-realize/src/main/java/com/fr/start/MainDesigner.java +++ b/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.i18n.Toolkit; import com.fr.design.mainframe.ActiveKeyGenerator; +import com.fr.design.mainframe.CellElementPropertyPane; import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerUIModeConfig; import com.fr.design.mainframe.InformationCollector; @@ -92,6 +93,7 @@ public class MainDesigner extends BaseDesigner { public MainDesigner(String[] args) { super(args); + preloadChildrenComponents(); } /** @@ -581,4 +583,11 @@ public class MainDesigner extends BaseDesigner { return new SplashCommon(); } + + /** + * 充分利用awt线程的空闲时间,初始化耗时面板组件 + */ + protected void preloadChildrenComponents() { + CellElementPropertyPane.getInstance(); + } }