Browse Source

Merge remote-tracking branch 'origin/9.0' into 9.0

master
MoMeak 7 years ago
parent
commit
70684914fa
  1. 2
      designer/src/com/fr/design/mainframe/ElementCasePane.java
  2. 17
      designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java
  3. 5
      designer/src/com/fr/design/mainframe/JPolyWorkBook.java
  4. 10
      designer/src/com/fr/design/mainframe/JWorkBook.java
  5. 9
      designer/src/com/fr/poly/PolyDesigner.java
  6. 2
      designer/src/com/fr/poly/creator/ECBlockEditor.java
  7. 2
      designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java
  8. 1
      designer_base/src/com/fr/design/locale/designer.properties
  9. 1
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  10. 3
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  11. 3
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  12. 1
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  13. 1
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties
  14. 5
      designer_base/src/com/fr/design/mainframe/DesignerFrame.java
  15. 263
      designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java
  16. 3
      designer_base/src/com/fr/design/mainframe/JTemplate.java
  17. 2
      designer_base/src/com/fr/design/roleAuthority/RoleTree.java
  18. 5
      designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java
  19. 25
      designer_form/src/com/fr/design/mainframe/JForm.java

2
designer/src/com/fr/design/mainframe/ElementCasePane.java

@ -502,7 +502,7 @@ public abstract class ElementCasePane<T extends TemplateElementCase> extends Tar
*/
public void setSelection(Selection selection) {
if (!ComparatorUtils.equals(this.selection, selection) ||
!ComparatorUtils.equals(EastRegionContainerPane.getInstance().getDownPane(), CellElementPropertyPane.getInstance())) {
!ComparatorUtils.equals(EastRegionContainerPane.getInstance().getCellAttrPane(), CellElementPropertyPane.getInstance())) {
this.selection = selection;
fireSelectionChanged();
}

17
designer/src/com/fr/design/mainframe/ElementCasePaneDelegate.java

@ -4,6 +4,7 @@ import com.fr.base.BaseUtils;
import com.fr.design.fun.MenuHandler;
import com.fr.design.menu.KeySetUtils;
import com.fr.general.Inter;
import com.fr.grid.selection.FloatSelection;
import com.fr.page.ReportSettingsProvider;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.DesignState;
@ -47,8 +48,9 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
if (BaseUtils.isAuthorityEditing()) {
AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(ElementCasePaneDelegate.this);
authorityPropertyPane.populate();
EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION);
EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane);
EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance());
return;
}
@ -56,8 +58,15 @@ public class ElementCasePaneDelegate extends ElementCasePane<WorkSheet> {
QuickEditorRegion.getInstance().populate(getCurrentEditor());
JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate();
if (editingTemplate != null && !editingTemplate.isUpMode()) {
EastRegionContainerPane.getInstance().replaceDownPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceUpPane(QuickEditorRegion.getInstance());
if (((ElementCasePaneDelegate)e.getSource()).getSelection() instanceof FloatSelection) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT);
// EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceFloatElementPane(QuickEditorRegion.getInstance());
} else {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance());
}
EastRegionContainerPane.getInstance().removeParameterPane();
}
}

5
designer/src/com/fr/design/mainframe/JPolyWorkBook.java

@ -38,4 +38,9 @@ public class JPolyWorkBook extends JWorkBook {
public SheetNameTabPane createSheetNameTabPane(ReportComponentComposite reportCompositeX){
return new PolySheetNameTabPane(reportCompositeX);
}
@Override
public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
}
}

10
designer/src/com/fr/design/mainframe/JWorkBook.java

@ -104,6 +104,13 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
populateReportParameterAttr();
}
@Override
public void refreshEastPropertiesPane() {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT);
EastRegionContainerPane.getInstance().replaceCellElementPane(getEastUpPane());
EastRegionContainerPane.getInstance().replaceCellAttrPane(getEastDownPane());
}
@Override
protected UIModeControlContainer createCenterPane() {
parameterPane = ModuleContext.isModuleStarted(Module.FORM_MODULE) ? new ParameterDefinitePane() : null;
@ -777,7 +784,8 @@ public class JWorkBook extends JTemplate<WorkBook, WorkBookUndoState> {
if (delegate4ToolbarMenuAdapter() instanceof PolyDesigner) {
PolyDesigner polyDesigner = (PolyDesigner) delegate4ToolbarMenuAdapter();
if (polyDesigner.getSelectionType() == PolyDesigner.SelectionType.NONE || polyDesigner.getSelection() == null) {
EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
// EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
QuickEditorRegion.getInstance().populate(QuickEditor.DEFAULT_EDITOR);
} else {
EastRegionContainerPane.getInstance().replaceDownPane(CellElementPropertyPane.getInstance());

9
designer/src/com/fr/poly/PolyDesigner.java

@ -842,11 +842,14 @@ public class PolyDesigner extends ReportComponent<PolyWorkSheet, PolyElementCase
if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance());
} else if (isChooseBlock()) {
EastRegionContainerPane.getInstance().replaceDownPane(PolyBlockProperPane.getInstance(PolyDesigner.this));
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_CHART);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(PolyBlockProperPane.getInstance(PolyDesigner.this));
} else if (type != SelectionType.NONE) {
EastRegionContainerPane.getInstance().replaceDownPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY_REPORT);
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
} else {
EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.POLY);
// EastRegionContainerPane.getInstance().replaceDownPane(new JPanel());
}
}
}

2
designer/src/com/fr/poly/creator/ECBlockEditor.java

@ -142,6 +142,6 @@ public class ECBlockEditor extends BlockEditor<ECBlockPane, PolyECBlock> {
}
QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor());
CellElementPropertyPane.getInstance().populate(editComponent);
EastRegionContainerPane.getInstance().replaceDownPane(CellElementPropertyPane.getInstance());
EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance());
}
}

2
designer_base/src/com/fr/design/actions/AllowAuthorityEditAction.java

@ -1 +1 @@
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().replaceUpPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }
package com.fr.design.actions; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.menu.KeySetUtils; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.design.designer.TargetComponent; import com.fr.design.file.HistoryTemplateListPane; import com.fr.design.mainframe.*; /** * Author : daisy * Date: 13-8-30 * Time: 上午10:12 */ public class AllowAuthorityEditAction extends TemplateComponentAction { public AllowAuthorityEditAction(TargetComponent t) { super(t); this.setMenuKeySet(KeySetUtils.ALLOW_AUTHORITY_EDIT); this.setName(getMenuKeySet().getMenuName()); this.setMnemonic(getMenuKeySet().getMnemonic()); this.setSmallIcon(BaseUtils.readIcon("/com/fr/design/images/m_report/allow_authority_edit.png")); } /** * 撤销 */ public void prepare4Undo() { HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().iniAuthorityUndoState(); } /** * 执行动作 * * @return 是否执行成功 */ public boolean executeActionReturnUndoRecordNeeded() { TargetComponent tc = getEditingComponent(); if (tc == null) { return false; } cleanAuthorityCondition(); //进入时是格式刷则取消格式刷 if (DesignerContext.getFormatState() != DesignerContext.FORMAT_STATE_NULL) { tc.cancelFormat(); } BaseUtils.setAuthorityEditing(true); ReportAndFSManagePane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); WestRegionContainerPane.getInstance().replaceDownPane(ReportAndFSManagePane.getInstance()); DesignerContext.getDesignerFrame().setCloseMode(UIConstants.CLOSE_OF_AUTHORITY); DesignerContext.getDesignerFrame().resetToolkitByPlus(tc.getToolBarMenuDockPlus()); DesignerContext.getDesignerFrame().needToAddAuhtorityPaint(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(tc.getEastUpPane()); DesignerContext.getDesignerFrame().refreshDottedLine(); EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); EastRegionContainerPane.getInstance().removeParameterPane(); //画虚线 return true; } /** * 进入权限编辑之前将权限编辑界面重置一下工具栏 */ private void cleanAuthorityCondition() { java.util.List<JTemplate<?, ?>> opendedTemplate = HistoryTemplateListPane.getInstance().getHistoryList(); for (int i = 0; i < opendedTemplate.size(); i++) { opendedTemplate.get(i).cleanAuthorityUndo(); } } }

1
designer_base/src/com/fr/design/locale/designer.properties

@ -2010,3 +2010,4 @@ FR-Designer_Cell_Attributes=Cell Attributes
FR-Designer_Float_Element=Float Element
FR-Designer_Widget_Library=Widget Library
FR-Designer_No_Settings_Available=No Settings Available!
FR-Designer_Configured_Roles=Configured role

1
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -2010,3 +2010,4 @@ FR-Designer_Cell_Attributes=Cell Attributes
FR-Designer_Float_Element=Float Element
FR-Designer_Widget_Library=Widget Library
FR-Designer_No_Settings_Available=No Settings Available!
FR-Designer_Configured_Roles=Configured role

3
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -1986,4 +1986,5 @@ FR-Designer_Cell_Element=\u30BB\u30EB\u8981\u7D20
FR-Designer_Cell_Attributes=\u30BB\u30EB\u5C5E\u6027
FR-Designer_Float_Element=\u30D5\u30ED\u30FC\u30C8\u8981\u7D20
FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available=
FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\u69CB\u6210\u3055\u308C\u305F\u5F79\u5272

3
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -1986,4 +1986,5 @@ FR-Designer_Cell_Element=\uC140\uC694\uC18C
FR-Designer_Cell_Attributes=\uC140\uC18D\uC131
FR-Designer_Float_Element=\uD638\uBC84\uC694\uC18C
FR-Designer_Widget_Library=
FR-Designer_No_Settings_Available=
FR-Designer_No_Settings_Available=
FR-Designer_Configured_Roles=\uC5ED\uD560\uC774\uAD6C\uC131\uB418\uC5C8\uC2B5\uB2C8\uB2E4.

1
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -2008,3 +2008,4 @@ FR-Designer_Cell_Attributes=\u5355\u5143\u683C\u5C5E\u6027
FR-Designer_Float_Element=\u60AC\u6D6E\u5143\u7D20
FR-Designer_Widget_Library=\u7EC4\u4EF6\u5E93
FR-Designer_No_Settings_Available=\u65E0\u53EF\u7528\u914D\u7F6E\u9879\uFF01
FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272

1
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -2009,3 +2009,4 @@ FR-Designer_Cell_Attributes=\u5132\u5B58\u683C\u5C6C\u6027
FR-Designer_Float_Element=\u61F8\u6D6E\u5143\u7D20
FR-Designer_Widget_Library=\u7D44\u4EF6\u5EAB
FR-Designer_No_Settings_Available=\u7121\u53EF\u7528\u914D\u5BD8\u9805\uFF01
FR-Designer_Configured_Roles=\u5DF2\u914D\u7F6E\u89D2\u8272

5
designer_base/src/com/fr/design/mainframe/DesignerFrame.java

@ -426,10 +426,7 @@ public class DesignerFrame extends JFrame implements JTemplateActionListener, Ta
BaseUtils.setAuthorityEditing(false);
WestRegionContainerPane.getInstance().replaceDownPane(
TableDataTreePane.getInstance(DesignModelAdapter.getCurrentModelAdapter()));
EastRegionContainerPane.getInstance().replaceUpPane(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEastUpPane());
EastRegionContainerPane.getInstance().replaceDownPane(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getEastDownPane());
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().refreshEastPropertiesPane();
DesignerContext.getDesignerFrame().resetToolkitByPlus(
HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().getToolBarMenuDockPlus());
needToAddAuhtorityPaint();

263
designer_base/src/com/fr/design/mainframe/EastRegionContainerPane.java

@ -15,12 +15,11 @@ import javax.swing.*;
import javax.swing.border.EmptyBorder;
import java.awt.*;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
public class EastRegionContainerPane extends UIEastResizableContainer {
private static EastRegionContainerPane THIS;
private List<PropertyItem> propertyItemList;
private Map<String, PropertyItem> propertyItemMap;
private CardLayout propertyCard;
private JPanel leftPane;
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 POPUP_TOOLPANE_HEIGHT = 25;
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();
// setVerticalDragEnabled(false);
initPropertyItemList();
initContentPane();
switchMode(PropertyMode.REPORT);
// initContentPane();
// super(leftPane, rightPane);
setContainerWidth(CONTAINER_WIDTH);
}
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");
propertyItemList.add(cellElement);
propertyItemList.add(cellAttr);
propertyItemList.add(floatElement);
propertyItemList.add(widgetSettings);
propertyItemList.add(conditionAttr);
propertyItemList.add(hyperlink);
propertyItemList.add(widgetLib);
PropertyItem widgetLib = new PropertyItem(KEY_WIDGET_LIB, Inter.getLocText("FR-Designer_Widget_Library"),
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.FORM},
new PropertyMode[]{PropertyMode.FORM});
// 权限编辑
PropertyItem authorityEdition = new PropertyItem(KEY_AUTHORITY_EDITION, Inter.getLocText("FR-Designer_Permissions_Edition"),
"/com/fr/design/images/buttonicon/add.png", new PropertyMode[]{PropertyMode.AUTHORITY_EDITION},
new PropertyMode[]{PropertyMode.AUTHORITY_EDITION});
// 已配置角色
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();
rightPane.setBackground(Color.green);
rightPane.setLayout(propertyCard);
for (PropertyItem item : propertyItemList) {
if (item.isPoppedOut()) {
for (PropertyItem item : propertyItemMap.values()) {
if (item.isPoppedOut() || !item.isVisible()) {
continue;
}
rightPane.add(item.getName(), item.getPropertyPanel());
}
rightPane.add(getDefaultPane());
rightPane.add(DEFAULT_PANE, getDefaultPane());
replaceRightPane(rightPane);
refreshRightPane();
}
// 左侧按钮面板
private void initLeftPane() {
leftPane = new JPanel();
leftPane.setLayout(new VerticalFlowLayout(VerticalFlowLayout.TOP, 0, 0));
for (PropertyItem item : propertyItemList) {
if (item.isPoppedOut()) {
for (PropertyItem item : propertyItemMap.values()) {
if (item.isPoppedOut() || !item.isVisible()) {
continue;
}
leftPane.add(item.getButton());
@ -126,16 +175,36 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
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) {
leftPane.remove(propertyItem.getButton());
rightPane.remove(propertyItem.getPropertyPanel());
refreshRightPane();
refreshContainer();
}
@Override
public void onResize() {
for (PropertyItem item : propertyItemList) {
for (PropertyItem item : propertyItemMap.values()) {
item.onResize();
}
}
@ -147,23 +216,79 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
}
public void replaceUpPane(JComponent pane) {
propertyItemList.get(0).replaceContentPane(pane);
replaceCellElementPane(pane);
}
public void replaceDownPane(JComponent pane) {
propertyItemList.get(1).replaceContentPane(pane);
replaceCellAttrPane(pane);
}
public JComponent getUpPane() {
return propertyItemList.get(0).getContentPane();
return getCellElementPane();
}
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) {
propertyItemList.get(2).replaceContentPane(paraPane);
// propertyItemMap.get(KEY_HYPERLINK).replaceContentPane(paraPane);
}
public void setParameterHeight(int height) {
@ -209,17 +334,29 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
* 刷新右面板
*/
public void refreshRightPane() {
if (this.getRightPane() instanceof DockingView) {
((DockingView) this.getRightPane()).refreshDockingView();
boolean hasAvailableTab = false;
for (String name : propertyItemMap.keySet()) {
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);
}
// if (this.getRightPane() instanceof DockingView) {
// ((DockingView) this.getRightPane()).refreshDockingView();
// }
}
public void refreshDownPane() {
JComponent pane = propertyItemList.get(1).getContentPane();
if (pane instanceof DockingView) {
((DockingView) pane).refreshDockingView();
}
// JComponent pane = propertyItemList.get(1).getContentPane();
// if (pane instanceof DockingView) {
// ((DockingView) pane).refreshDockingView();
// }
}
private void refreshContainer() {
@ -235,7 +372,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
class PropertyItem {
// private UIButton button;
private UIButton button;
private String name; // 用于 card 切换
private String title; // 用于显示
@ -244,21 +380,54 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
private FixedPopupPane popupPane; // 左侧固定弹出框
private PopupToolPane popupToolPane; // 弹出工具条
private PopupDialog popupDialog; // 弹出框
private int x, y; // 弹出框的坐标
private int height; // 弹出框的高度
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.title = title;
initButton(btnUrl);
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) {
button.setEnabled(enabled);
public void setEnabled(boolean isEnabled) {
this.isEnabled = isEnabled;
button.setEnabled(isEnabled);
}
private void initPropertyPanel() {
@ -271,10 +440,6 @@ public class EastRegionContainerPane extends UIEastResizableContainer {
propertyPanel.add(contentPane, BorderLayout.CENTER);
}
public void setIsPoppedOut(boolean isPoppedOut) {
this.isPoppedOut = isPoppedOut;
}
public boolean isPoppedOut() {
return isPoppedOut;
}

3
designer_base/src/com/fr/design/mainframe/JTemplate.java

@ -109,6 +109,9 @@ public abstract class JTemplate<T extends IOFile, U extends BaseUndoState<?>> ex
}
}
// 刷新右侧属性面板
public abstract void refreshEastPropertiesPane();
// 为收集模版信息作准备
private void initForCollect() {
template.initTemplateID(); // 为新模板设置 templateID 属性

2
designer_base/src/com/fr/design/roleAuthority/RoleTree.java

File diff suppressed because one or more lines are too long

5
designer_form/src/com/fr/design/form/parameter/FormParaDesigner.java

@ -109,12 +109,13 @@ public class FormParaDesigner extends FormDesigner implements ParameterDesignerP
*/
public void initBeforeUpEdit() {
WidgetToolBarPane.getInstance(this);
EastRegionContainerPane.getInstance().replaceDownPane(
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_PARA);
EastRegionContainerPane.getInstance().replaceWidgetLibPane(
FormWidgetDetailPane.getInstance(this));
if (!BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(this));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(this).getPreferredSize().height);
EastRegionContainerPane.getInstance().replaceUpPane(
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(
WidgetPropertyPane.getInstance(this));
} else {
EastRegionContainerPane.getInstance().removeParameterPane();

25
designer_form/src/com/fr/design/mainframe/JForm.java

@ -88,6 +88,10 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
super(form, file);
}
@Override
public void refreshEastPropertiesPane() {
}
public int getMenuState() {
return DesignState.JFORM;
@ -267,12 +271,12 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
return;
}
editingComponent = comp.createToolPane(this, formDesign);
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
if (BaseUtils.isAuthorityEditing()) {
EastRegionContainerPane.getInstance().replaceUpPane(
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(
ComparatorUtils.equals(editingComponent.getClass(), NoSupportAuthorityEdit.class) ? editingComponent : createAuthorityEditPane());
} else {
EastRegionContainerPane.getInstance().replaceUpPane(editingComponent);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(editingComponent);
}
}
@ -627,17 +631,19 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
if (formDesign.isReportBlockEditing()) {
if (elementCaseDesign != null) {
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM_REPORT);
EastRegionContainerPane.getInstance().removeParameterPane();
EastRegionContainerPane.getInstance().replaceDownPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceUpPane(elementCaseDesign.getEastUpPane());
EastRegionContainerPane.getInstance().replaceCellAttrPane(elementCaseDesign.getEastDownPane());
EastRegionContainerPane.getInstance().replaceCellElementPane(elementCaseDesign.getEastUpPane());
return;
}
}
EastRegionContainerPane.getInstance().replaceUpPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.FORM);
EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(WidgetPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().addParameterPane(ParameterPropertyPane.getInstance(formDesign));
EastRegionContainerPane.getInstance().setParameterHeight(ParameterPropertyPane.getInstance(formDesign).getPreferredSize().height);
if (EastRegionContainerPane.getInstance().getDownPane() == null) {
if (EastRegionContainerPane.getInstance().getWidgetLibPane() == null) {
new Thread() {
public void run() {
try {
@ -648,15 +654,14 @@ public class JForm extends JTemplate<Form, FormUndoState> implements BaseJForm {
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane);
EastRegionContainerPane.getInstance().replaceWidgetLibPane(pane);
}
}.start();
} else {
JPanel pane = new JPanel();
pane.setLayout(new BorderLayout());
pane.add(FormWidgetDetailPane.getInstance(formDesign), BorderLayout.CENTER);
EastRegionContainerPane.getInstance().replaceDownPane(pane);
EastRegionContainerPane.getInstance().replaceWidgetLibPane(pane);
}
}

Loading…
Cancel
Save