|
|
@ -15,12 +15,11 @@ import javax.swing.*; |
|
|
|
import javax.swing.border.EmptyBorder; |
|
|
|
import javax.swing.border.EmptyBorder; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.*; |
|
|
|
import java.awt.event.*; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.*; |
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
private static EastRegionContainerPane THIS; |
|
|
|
private static EastRegionContainerPane THIS; |
|
|
|
private List<PropertyItem> propertyItemList; |
|
|
|
private Map<String, PropertyItem> propertyItemMap; |
|
|
|
private CardLayout propertyCard; |
|
|
|
private CardLayout propertyCard; |
|
|
|
private JPanel leftPane; |
|
|
|
private JPanel leftPane; |
|
|
|
private JPanel rightPane; |
|
|
|
private JPanel rightPane; |
|
|
@ -29,6 +28,30 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; |
|
|
|
private static final int CONTENT_WIDTH = CONTAINER_WIDTH - TAB_WIDTH; |
|
|
|
private static final int POPUP_TOOLPANE_HEIGHT = 25; |
|
|
|
private static final int POPUP_TOOLPANE_HEIGHT = 25; |
|
|
|
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; |
|
|
|
private static final int ARROW_RANGE_START = CONTENT_WIDTH - 30; |
|
|
|
|
|
|
|
private static final String KEY_CELL_ELEMENT = "cellElement"; |
|
|
|
|
|
|
|
private static final String KEY_CELL_ATTR = "cellAttr"; |
|
|
|
|
|
|
|
private static final String KEY_FLOAT_ELEMENT = "floatElement"; |
|
|
|
|
|
|
|
private static final String KEY_WIDGET_SETTINGS = "widgetSettings"; |
|
|
|
|
|
|
|
private static final String KEY_CONDITION_ATTR = "conditionAttr"; |
|
|
|
|
|
|
|
private static final String KEY_HYPERLINK = "hyperlink"; |
|
|
|
|
|
|
|
private static final String KEY_WIDGET_LIB = "widgetLib"; |
|
|
|
|
|
|
|
private static final String KEY_AUTHORITY_EDITION = "authorityEdition"; |
|
|
|
|
|
|
|
private static final String KEY_CONFIGURED_ROLES = "editedRoles"; |
|
|
|
|
|
|
|
private static final String DEFAULT_PANE = "defaultPane"; // "无可用配置项"面板
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public enum PropertyMode { |
|
|
|
|
|
|
|
REPORT, // 报表
|
|
|
|
|
|
|
|
REPORT_PARA, // 报表参数面板
|
|
|
|
|
|
|
|
REPORT_FLOAT, // 报表悬浮元素
|
|
|
|
|
|
|
|
FORM, // 表单
|
|
|
|
|
|
|
|
FORM_REPORT, // 表单报表块
|
|
|
|
|
|
|
|
POLY, // 聚合报表
|
|
|
|
|
|
|
|
POLY_REPORT, // 聚合报表-报表块
|
|
|
|
|
|
|
|
POLY_CHART, // 聚合报表-图表块
|
|
|
|
|
|
|
|
AUTHORITY_EDITION // 权限编辑
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
private PropertyMode currentMode; // 当前模式(根据不同模式,显示不同的可用面板)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 得到实例 |
|
|
|
* 得到实例 |
|
|
@ -48,35 +71,60 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
super(); |
|
|
|
super(); |
|
|
|
// setVerticalDragEnabled(false);
|
|
|
|
// setVerticalDragEnabled(false);
|
|
|
|
initPropertyItemList(); |
|
|
|
initPropertyItemList(); |
|
|
|
initContentPane(); |
|
|
|
switchMode(PropertyMode.REPORT); |
|
|
|
|
|
|
|
// initContentPane();
|
|
|
|
// super(leftPane, rightPane);
|
|
|
|
// super(leftPane, rightPane);
|
|
|
|
setContainerWidth(CONTAINER_WIDTH); |
|
|
|
setContainerWidth(CONTAINER_WIDTH); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPropertyItemList() { |
|
|
|
private void initPropertyItemList() { |
|
|
|
propertyItemList = new ArrayList<>(); |
|
|
|
propertyItemMap = new LinkedHashMap<>(); // 有序map
|
|
|
|
|
|
|
|
|
|
|
|
// 单元格元素
|
|
|
|
// 单元格元素
|
|
|
|
PropertyItem cellElement = new PropertyItem("cellElement", Inter.getLocText("FR-Designer_Cell_Element"), "/com/fr/design/images/buttonicon/add.png"); |
|
|
|
PropertyItem cellElement = new PropertyItem(KEY_CELL_ELEMENT, Inter.getLocText("FR-Designer_Cell_Element"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); |
|
|
|
// 单元格属性
|
|
|
|
// 单元格属性
|
|
|
|
PropertyItem cellAttr = new PropertyItem("cellAttr", Inter.getLocText("FR-Designer_Cell_Attributes"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem cellAttr = new PropertyItem(KEY_CELL_ATTR, Inter.getLocText("FR-Designer_Cell_Attributes"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); |
|
|
|
// 悬浮元素
|
|
|
|
// 悬浮元素
|
|
|
|
PropertyItem floatElement = new PropertyItem("floatElement", Inter.getLocText("FR-Designer_Float_Element"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem floatElement = new PropertyItem(KEY_FLOAT_ELEMENT, Inter.getLocText("FR-Designer_Float_Element"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_FLOAT, PropertyMode.POLY_REPORT}); |
|
|
|
// 控件设置
|
|
|
|
// 控件设置
|
|
|
|
PropertyItem widgetSettings = new PropertyItem("widgetSettings", Inter.getLocText("FR-Designer-Widget_Settings"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem widgetSettings = new PropertyItem(KEY_WIDGET_SETTINGS, Inter.getLocText("FR-Designer-Widget_Settings"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.FORM, PropertyMode.POLY}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.FORM, PropertyMode.POLY_REPORT, PropertyMode.POLY_CHART}); |
|
|
|
// 条件属性
|
|
|
|
// 条件属性
|
|
|
|
PropertyItem conditionAttr = new PropertyItem("conditionAttr", Inter.getLocText("FR-Designer_Condition_Attributes"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem conditionAttr = new PropertyItem(KEY_CONDITION_ATTR, Inter.getLocText("FR-Designer_Condition_Attributes"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); |
|
|
|
// 超级链接
|
|
|
|
// 超级链接
|
|
|
|
PropertyItem hyperlink = new PropertyItem("hyperlink", Inter.getLocText("FR-Designer_Hyperlink"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem hyperlink = new PropertyItem(KEY_HYPERLINK, Inter.getLocText("FR-Designer_Hyperlink"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.REPORT, PropertyMode.REPORT_PARA, PropertyMode.REPORT_FLOAT, PropertyMode.POLY, PropertyMode.POLY_CHART}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.REPORT, PropertyMode.FORM_REPORT, PropertyMode.POLY_REPORT}); |
|
|
|
// 组件库
|
|
|
|
// 组件库
|
|
|
|
PropertyItem widgetLib = new PropertyItem("widgetLib", Inter.getLocText("FR-Designer_Widget_Library"), "com/fr/design/images/toolbarbtn/close.png"); |
|
|
|
PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, Inter.getLocText("FR-Designer_Widget_Library"), |
|
|
|
propertyItemList.add(cellElement); |
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.FORM}, |
|
|
|
propertyItemList.add(cellAttr); |
|
|
|
new PropertyMode[]{PropertyMode.FORM}); |
|
|
|
propertyItemList.add(floatElement); |
|
|
|
// 权限编辑
|
|
|
|
propertyItemList.add(widgetSettings); |
|
|
|
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"), |
|
|
|
propertyItemList.add(conditionAttr); |
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, |
|
|
|
propertyItemList.add(hyperlink); |
|
|
|
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); |
|
|
|
propertyItemList.add(widgetLib); |
|
|
|
// 已配置角色
|
|
|
|
|
|
|
|
PropertyItem configuredRoles = new PropertyItem(KEY_CONFIGURED_ROLES, Inter.getLocText("FR-Designer_Configured_Roles"), |
|
|
|
|
|
|
|
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}, |
|
|
|
|
|
|
|
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
propertyItemMap.put(KEY_CELL_ELEMENT, cellElement); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_CELL_ATTR, cellAttr); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_FLOAT_ELEMENT, floatElement); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_WIDGET_SETTINGS, widgetSettings); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_CONDITION_ATTR, conditionAttr); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_HYPERLINK, hyperlink); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_WIDGET_LIB, widgetLib); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_AUTHORITY_EDITION, authorityEdition); |
|
|
|
|
|
|
|
propertyItemMap.put(KEY_CONFIGURED_ROLES, configuredRoles); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// "无可用配置项"面板
|
|
|
|
// "无可用配置项"面板
|
|
|
@ -99,23 +147,24 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
propertyCard = new CardLayout(); |
|
|
|
propertyCard = new CardLayout(); |
|
|
|
rightPane.setBackground(Color.green); |
|
|
|
rightPane.setBackground(Color.green); |
|
|
|
rightPane.setLayout(propertyCard); |
|
|
|
rightPane.setLayout(propertyCard); |
|
|
|
for (PropertyItem item : propertyItemList) { |
|
|
|
for (PropertyItem item : propertyItemMap.values()) { |
|
|
|
if (item.isPoppedOut()) { |
|
|
|
if (item.isPoppedOut() || !item.isVisible()) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
rightPane.add(item.getName(), item.getPropertyPanel()); |
|
|
|
rightPane.add(item.getName(), item.getPropertyPanel()); |
|
|
|
} |
|
|
|
} |
|
|
|
rightPane.add(getDefaultPane()); |
|
|
|
rightPane.add(DEFAULT_PANE, getDefaultPane()); |
|
|
|
|
|
|
|
|
|
|
|
replaceRightPane(rightPane); |
|
|
|
replaceRightPane(rightPane); |
|
|
|
|
|
|
|
refreshRightPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 左侧按钮面板
|
|
|
|
// 左侧按钮面板
|
|
|
|
private void initLeftPane() { |
|
|
|
private void initLeftPane() { |
|
|
|
leftPane = new JPanel(); |
|
|
|
leftPane = new JPanel(); |
|
|
|
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0)); |
|
|
|
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0)); |
|
|
|
for (PropertyItem item : propertyItemList) { |
|
|
|
for (PropertyItem item : propertyItemMap.values()) { |
|
|
|
if (item.isPoppedOut()) { |
|
|
|
if (item.isPoppedOut() || !item.isVisible()) { |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
leftPane.add(item.getButton()); |
|
|
|
leftPane.add(item.getButton()); |
|
|
@ -126,16 +175,36 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
replaceLeftPane(leftPane); |
|
|
|
replaceLeftPane(leftPane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void switchMode(PropertyMode mode) { |
|
|
|
|
|
|
|
if (currentMode != null && currentMode.equals(mode)) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
currentMode = mode; |
|
|
|
|
|
|
|
updateAllPropertyPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateAllPropertyPane() { |
|
|
|
|
|
|
|
updatePropertyItemMap(); |
|
|
|
|
|
|
|
initContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void updatePropertyItemMap() { |
|
|
|
|
|
|
|
for (PropertyItem item : propertyItemMap.values()) { |
|
|
|
|
|
|
|
item.updateStatus(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 弹出面板时,更新框架内容
|
|
|
|
// 弹出面板时,更新框架内容
|
|
|
|
private void removeItem(PropertyItem propertyItem) { |
|
|
|
private void removeItem(PropertyItem propertyItem) { |
|
|
|
leftPane.remove(propertyItem.getButton()); |
|
|
|
leftPane.remove(propertyItem.getButton()); |
|
|
|
rightPane.remove(propertyItem.getPropertyPanel()); |
|
|
|
rightPane.remove(propertyItem.getPropertyPanel()); |
|
|
|
|
|
|
|
refreshRightPane(); |
|
|
|
refreshContainer(); |
|
|
|
refreshContainer(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public void onResize() { |
|
|
|
public void onResize() { |
|
|
|
for (PropertyItem item : propertyItemList) { |
|
|
|
for (PropertyItem item : propertyItemMap.values()) { |
|
|
|
item.onResize(); |
|
|
|
item.onResize(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -147,23 +216,79 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void replaceUpPane(JComponent pane) { |
|
|
|
public void replaceUpPane(JComponent pane) { |
|
|
|
propertyItemList.get(0).replaceContentPane(pane); |
|
|
|
replaceCellElementPane(pane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void replaceDownPane(JComponent pane) { |
|
|
|
public void replaceDownPane(JComponent pane) { |
|
|
|
propertyItemList.get(1).replaceContentPane(pane); |
|
|
|
replaceCellAttrPane(pane); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JComponent getUpPane() { |
|
|
|
public JComponent getUpPane() { |
|
|
|
return propertyItemList.get(0).getContentPane(); |
|
|
|
return getCellElementPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public JComponent getDownPane() { |
|
|
|
public JComponent getDownPane() { |
|
|
|
return propertyItemList.get(1).getContentPane(); |
|
|
|
return getCellAttrPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceCellElementPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_CELL_ELEMENT).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getCellElementPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_CELL_ELEMENT).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceCellAttrPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_CELL_ATTR).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getCellAttrPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_CELL_ATTR).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceFloatElementPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_FLOAT_ELEMENT).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getFloatElementPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_FLOAT_ELEMENT).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceWidgetSettingsPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_WIDGET_SETTINGS).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getWidgetSettingsPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_WIDGET_SETTINGS).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceWidgetLibPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_WIDGET_LIB).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getWidgetLibPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_WIDGET_LIB).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceAuthorityEditionPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_AUTHORITY_EDITION).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getAuthorityEditionPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_AUTHORITY_EDITION).getContentPane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void replaceConfiguredRolesPane(JComponent pane) { |
|
|
|
|
|
|
|
propertyItemMap.get(KEY_CONFIGURED_ROLES).replaceContentPane(pane); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public JComponent getConfiguredRolesPane() { |
|
|
|
|
|
|
|
return propertyItemMap.get(KEY_CONFIGURED_ROLES).getContentPane(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void addParameterPane(JComponent paraPane) { |
|
|
|
public void addParameterPane(JComponent paraPane) { |
|
|
|
propertyItemList.get(2).replaceContentPane(paraPane); |
|
|
|
// propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(paraPane);
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setParameterHeight(int height) { |
|
|
|
public void setParameterHeight(int height) { |
|
|
@ -209,17 +334,29 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
* 刷新右面板 |
|
|
|
* 刷新右面板 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void refreshRightPane() { |
|
|
|
public void refreshRightPane() { |
|
|
|
|
|
|
|
boolean hasAvailableTab = false; |
|
|
|
if (this.getRightPane() instanceof DockingView) { |
|
|
|
for (String name : propertyItemMap.keySet()) { |
|
|
|
((DockingView) this.getRightPane()).refreshDockingView(); |
|
|
|
PropertyItem propertyItem = propertyItemMap.get(name); |
|
|
|
|
|
|
|
if (propertyItem.isVisible() && !propertyItem.isPoppedOut() && propertyItem.isEnabled()) { |
|
|
|
|
|
|
|
propertyCard.show(rightPane, name); // 显示第一个可用tab
|
|
|
|
|
|
|
|
hasAvailableTab = true; |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
if (!hasAvailableTab) { |
|
|
|
|
|
|
|
propertyCard.show(rightPane, DEFAULT_PANE); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void refreshDownPane() { |
|
|
|
// if (this.getRightPane() instanceof DockingView) {
|
|
|
|
JComponent pane = propertyItemList.get(1).getContentPane(); |
|
|
|
// ((DockingView) this.getRightPane()).refreshDockingView();
|
|
|
|
if (pane instanceof DockingView) { |
|
|
|
// }
|
|
|
|
((DockingView) pane).refreshDockingView(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void refreshDownPane() { |
|
|
|
|
|
|
|
// JComponent pane = propertyItemList.get(1).getContentPane();
|
|
|
|
|
|
|
|
// if (pane instanceof DockingView) {
|
|
|
|
|
|
|
|
// ((DockingView) pane).refreshDockingView();
|
|
|
|
|
|
|
|
// }
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void refreshContainer() { |
|
|
|
private void refreshContainer() { |
|
|
@ -235,7 +372,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class PropertyItem { |
|
|
|
class PropertyItem { |
|
|
|
// private UIButton button;
|
|
|
|
|
|
|
|
private UIButton button; |
|
|
|
private UIButton button; |
|
|
|
private String name; // 用于 card 切换
|
|
|
|
private String name; // 用于 card 切换
|
|
|
|
private String title; // 用于显示
|
|
|
|
private String title; // 用于显示
|
|
|
@ -244,21 +380,54 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
private FixedPopupPane popupPane; // 左侧固定弹出框
|
|
|
|
private FixedPopupPane popupPane; // 左侧固定弹出框
|
|
|
|
private PopupToolPane popupToolPane; // 弹出工具条
|
|
|
|
private PopupToolPane popupToolPane; // 弹出工具条
|
|
|
|
private PopupDialog popupDialog; // 弹出框
|
|
|
|
private PopupDialog popupDialog; // 弹出框
|
|
|
|
private int x, y; // 弹出框的坐标
|
|
|
|
|
|
|
|
private int height; // 弹出框的高度
|
|
|
|
|
|
|
|
private boolean isPoppedOut = false; // 是否弹出
|
|
|
|
private boolean isPoppedOut = false; // 是否弹出
|
|
|
|
private Dimension fixedSize; |
|
|
|
private boolean isVisible = true; // 是否可见
|
|
|
|
|
|
|
|
private boolean isEnabled = true; // 是否可用
|
|
|
|
|
|
|
|
private Set<PropertyMode> visibleModes; |
|
|
|
|
|
|
|
private Set<PropertyMode> enableModes; |
|
|
|
|
|
|
|
|
|
|
|
public PropertyItem(String name, String title, String btnUrl) { |
|
|
|
public PropertyItem(String name, String title, String btnUrl, PropertyMode[] visibleModes, PropertyMode[] enableModes) { |
|
|
|
this.name = name; |
|
|
|
this.name = name; |
|
|
|
this.title = title; |
|
|
|
this.title = title; |
|
|
|
initButton(btnUrl); |
|
|
|
initButton(btnUrl); |
|
|
|
initPropertyPanel(); |
|
|
|
initPropertyPanel(); |
|
|
|
|
|
|
|
// this.visibleModes = new ArrayList<PropertyMode>(visibleModes);
|
|
|
|
|
|
|
|
initModes(visibleModes, enableModes); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initModes(PropertyMode[] visibleModes, PropertyMode[] enableModes) { |
|
|
|
|
|
|
|
this.enableModes = new HashSet<>(); |
|
|
|
|
|
|
|
this.visibleModes = new HashSet<>(); |
|
|
|
|
|
|
|
for (PropertyMode enableMode : enableModes) { |
|
|
|
|
|
|
|
this.enableModes.add(enableMode); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
for (PropertyMode visibleMode : visibleModes) { |
|
|
|
|
|
|
|
this.visibleModes.add(visibleMode); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
this.visibleModes.addAll(this.enableModes); // 可用必可见
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void updateStatus() { |
|
|
|
|
|
|
|
setEnabled(enableModes.contains(currentMode)); |
|
|
|
|
|
|
|
setVisible(visibleModes.contains(currentMode)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isVisible() { |
|
|
|
|
|
|
|
return isVisible; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void setVisible(boolean isVisible) { |
|
|
|
|
|
|
|
this.isVisible = isVisible; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isEnabled() { |
|
|
|
|
|
|
|
return isEnabled; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 选项不可用
|
|
|
|
// 选项不可用
|
|
|
|
public void setEnabled(boolean enabled) { |
|
|
|
public void setEnabled(boolean isEnabled) { |
|
|
|
button.setEnabled(enabled); |
|
|
|
this.isEnabled = isEnabled; |
|
|
|
|
|
|
|
button.setEnabled(isEnabled); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initPropertyPanel() { |
|
|
|
private void initPropertyPanel() { |
|
|
@ -271,10 +440,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer { |
|
|
|
propertyPanel.add(contentPane, BorderLayout.CENTER); |
|
|
|
propertyPanel.add(contentPane, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setIsPoppedOut(boolean isPoppedOut) { |
|
|
|
|
|
|
|
this.isPoppedOut = isPoppedOut; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isPoppedOut() { |
|
|
|
public boolean isPoppedOut() { |
|
|
|
return isPoppedOut; |
|
|
|
return isPoppedOut; |
|
|
|
} |
|
|
|
} |
|
|
|