From f1700d58510a6900d543d99e6a57df54bbb072ba Mon Sep 17 00:00:00 2001 From: plough Date: Sat, 29 Jul 2017 16:50:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E5=A4=96=E6=A1=86?= =?UTF-8?q?=E6=9E=B6=E9=81=97=E7=95=99=3D=E3=80=8B=E5=8F=82=E6=95=B0?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mainframe/EastRegionContainerPane.java | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index 2027c4483..06d6f8918 100644 --- a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java +++ b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java @@ -301,6 +301,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void addParameterPane(JComponent paraPane) { +// System.out.println("add para"); + propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceHeaderPane(paraPane); // propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(paraPane); } @@ -340,7 +342,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void removeParameterPane() { - + propertyItemMap.get(KEY_WIDGET_SETTINGS).removeHeaderPane(); } /** @@ -396,6 +398,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private String title; // 用于显示 private JComponent propertyPanel; private JComponent contentPane; + private JComponent headerPane; // 在contentPane 上方,可以用于显示参数面板 + private Container contentArea; // 包含 headerPane 和 contentPane private FixedPopupPane popupPane; // 左侧固定弹出框 private PopupToolPane popupToolPane; // 弹出工具条 private PopupDialog popupDialog; // 弹出框 @@ -404,6 +408,7 @@ public class EastRegionContainerPane extends UIEastResizableContainer { private boolean isEnabled = true; // 是否可用 private Set visibleModes; private Set enableModes; + private static final int MAX_PARA_HEIGHT = 240; public PropertyItem(String name, String title, String btnUrl, PropertyMode[] visibleModes, PropertyMode[] enableModes) { this.name = name; @@ -454,9 +459,13 @@ public class EastRegionContainerPane extends UIEastResizableContainer { propertyPanel.setBackground(Color.pink); contentPane = generateContentPane(); popupToolPane = new PopupToolPane(this, PopupToolPane.DOWN_BUTTON); + headerPane = new JPanel(); + contentArea = new JPanel(new BorderLayout()); + contentArea.add(headerPane, BorderLayout.NORTH); + contentArea.add(contentPane, BorderLayout.CENTER); propertyPanel.setLayout(new BorderLayout()); propertyPanel.add(popupToolPane, BorderLayout.NORTH); - propertyPanel.add(contentPane, BorderLayout.CENTER); + propertyPanel.add(contentArea, BorderLayout.CENTER); } public boolean isPoppedOut() { @@ -477,8 +486,8 @@ public class EastRegionContainerPane extends UIEastResizableContainer { } public void replaceContentPane(JComponent pane) { - propertyPanel.remove(this.contentPane); - propertyPanel.add(this.contentPane = pane); + contentArea.remove(this.contentPane); + contentArea.add(this.contentPane = pane); if (popupDialog != null && isPoppedOut) { popupDialog.replaceContentPane(this); } @@ -493,6 +502,25 @@ public class EastRegionContainerPane extends UIEastResizableContainer { return contentPane; } + public void replaceHeaderPane(JComponent pane) { + contentArea.remove(headerPane); + int height = Math.min(pane.getPreferredSize().height, MAX_PARA_HEIGHT); + pane.setPreferredSize(new Dimension(pane.getPreferredSize().width, height)); + headerPane = pane; + contentArea.add(headerPane, BorderLayout.NORTH); + + refreshContainer(); + } + + public void removeHeaderPane() { + contentArea.remove(headerPane); + refreshContainer(); + } + + public JComponent getHeaderPane() { + return headerPane; + } + public void onResize() { if (isRightPaneVisible()) { hideCurrentPopupPane();