Browse Source

REPORT-3163 合作开发9.0设计器=>外框架遗留=》参数面板

master
plough 7 years ago
parent
commit
f1700d5851
  1. 36
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

36
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<PropertyMode> visibleModes;
private Set<PropertyMode> 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();

Loading…
Cancel
Save