diff --git a/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java b/designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java index 2027c4483b..06d6f8918f 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();