diff --git a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java index f403fcb9c..a7b22cfbe 100644 --- a/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java +++ b/designer/src/com/fr/design/actions/cell/CleanAuthorityAction.java @@ -1 +1 @@ -package com.fr.design.actions.cell; import java.awt.Rectangle; import java.awt.event.ActionEvent; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file +package com.fr.design.actions.cell; import java.awt.Rectangle; import java.awt.event.ActionEvent; import com.fr.design.actions.ElementCaseAction; import com.fr.design.mainframe.AuthorityPropertyPane; import com.fr.design.mainframe.EastRegionContainerPane; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.roleAuthority.ReportAndFSManagePane; import com.fr.design.roleAuthority.RolesAlreadyEditedPane; import com.fr.general.Inter; import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.FloatSelection; import com.fr.grid.selection.Selection; import com.fr.report.cell.FloatElement; import com.fr.report.cell.TemplateCellElement; import com.fr.report.elementcase.TemplateElementCase; /** * Author : daisy * Date: 13-9-23 * Time: 下午2:41 */ public class CleanAuthorityAction extends ElementCaseAction { public CleanAuthorityAction(ElementCasePane t) { super(t); this.setName(Inter.getLocText(new String[]{"Clear", "DashBoard-Potence"})); } /** * 清楚权限动作 * * @param evt 事件 */ public void actionPerformed(ActionEvent evt) { ElementCasePane reportPane = getEditingComponent(); Selection selection = reportPane.getSelection(); String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); if (selection instanceof FloatSelection) { String name = ((FloatSelection) selection).getSelectedFloatName(); TemplateElementCase ec = reportPane.getEditingElementCase(); FloatElement fe = ec.getFloatElement(name); if (fe.isDoneAuthority(selectedRoles)) { fe.cleanAuthority(selectedRoles); } doAfterAuthority(reportPane); return; } CellSelection cellSelection = (CellSelection) selection; boolean isChooseColumnRow = cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN || cellSelection.getSelectedType() == CellSelection.CHOOSE_ROW; if (isChooseColumnRow && cellSelection.getCellRectangleCount() == 1) { cleanColumnRow(cellSelection, reportPane, selectedRoles); } else { cleanCell(cellSelection, reportPane, selectedRoles); } doAfterAuthority(reportPane); } private void doAfterAuthority(ElementCasePane reportPane) { reportPane.repaint(); reportPane.fireTargetModified(); RolesAlreadyEditedPane.getInstance().refreshDockingView(); RolesAlreadyEditedPane.getInstance().repaint(); if (EastRegionContainerPane.getInstance().getUpPane() instanceof AuthorityPropertyPane) { AuthorityPropertyPane authorityPropertyPane = (AuthorityPropertyPane) EastRegionContainerPane.getInstance().getUpPane(); authorityPropertyPane.populate(); EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } } /** * 清除单元格对应的角色的权限 * * @param cellSelection * @param reportPane */ private void cleanCell(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); int cellRectangleCount = cellSelection.getCellRectangleCount(); for (int rect = 0; rect < cellRectangleCount; rect++) { Rectangle cellRectangle = cellSelection.getCellRectangle(rect); for (int j = 0; j < cellRectangle.height; j++) { for (int i = 0; i < cellRectangle.width; i++) { int column = i + cellRectangle.x; int row = j + cellRectangle.y; TemplateCellElement cellElement = elementCase.getTemplateCellElement(column, row); if (cellElement == null) { continue; } //清除权限 if (cellElement.isDoneAuthority(selectedRoles) || cellElement.isDoneNewValueAuthority(selectedRoles)) { cellElement.cleanAuthority(selectedRoles); } if (cellElement.getWidget() == null) { continue; } boolean isDoneAuthority = cellElement.getWidget().isDoneVisibleAuthority(selectedRoles) || cellElement.getWidget().isDoneUsableAuthority(selectedRoles); if (isDoneAuthority) { cellElement.getWidget().cleanAuthority(selectedRoles); } } } } } private void cleanColumnRow(CellSelection cellSelection, ElementCasePane reportPane, String selectedRoles) { if (selectedRoles == null) { return; } TemplateElementCase elementCase = reportPane.getEditingElementCase(); if (cellSelection.getSelectedType() == CellSelection.CHOOSE_COLUMN) { for (int col = cellSelection.getColumn(); col < cellSelection.getColumn() + cellSelection.getColumnSpan(); col++) { elementCase.removeColumnPrivilegeControl(col, selectedRoles); } } else { for (int row = cellSelection.getRow(); row < cellSelection.getRow() + cellSelection.getRowSpan(); row++) { elementCase.removeRowPrivilegeControl(row, selectedRoles); } } } /** * 是否需要撤销动作 * * @return 不需要 */ public boolean executeActionReturnUndoRecordNeeded() { return false; } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java index a760e0043..317bed8d9 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityEditToolBarPane.java @@ -31,6 +31,7 @@ import java.util.List; public class AuthorityEditToolBarPane extends AuthorityPropertyPane { private static final int TITLE_HEIGHT = 19; + private static final int RIGHT_GAP = 10; private AuthorityEditPane authorityEditPane = null; private AuthorityToolBarPane authorityToolBarPane; private String[] selectedPathArray; @@ -51,7 +52,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); - this.add(northPane, BorderLayout.NORTH); +// this.add(northPane, BorderLayout.NORTH); authorityEditPane = new AuthorityEditPane(buttonlists); this.add(authorityEditPane, BorderLayout.CENTER); } @@ -81,13 +82,13 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { private class AuthorityEditPane extends JPanel { private static final int TOP_GAP = 11; - private static final int LEFT_GAP = 8; - private static final int ALIGNMENT_GAP = -3; + private static final int LEFT_GAP = 4; + private static final int LEFT_CHECKPANE = 3; private UILabel type = null; private UILabel name = null; private JPanel checkPane = null; private List buttonlists; - private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); + private UICheckBox buttonVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible")); private ItemListener itemListener = new ItemListener() { public void itemStateChanged(ItemEvent e) { String selectedRole = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); @@ -143,43 +144,30 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { public AuthorityEditPane(List buttonlists) { setLayout(new BorderLayout()); type = new UILabel(); + type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); + name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); - this.add(layoutText(), BorderLayout.WEST); - this.add(layoutPane(), BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); + this.add(centerPane(), BorderLayout.NORTH); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); this.buttonlists = buttonlists; buttonVisible.addItemListener(itemListener); } - private JPanel layoutText() { - double p = TableLayout.PREFERRED; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Type") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer_WF_Name") + ":", SwingConstants.RIGHT)}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Permissions") + ":", SwingConstants - .RIGHT)}, - }; - double[] rowSize = {p, p, p}; - double[] columnSize = {p}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - } - - - private JPanel layoutPane() { + private JPanel centerPane() { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ - new Component[]{type}, - new Component[]{name}, - new Component[]{checkPane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{checkPane, null}, }; - double[] rowSize = {p, p, p}; - double[] columnSize = {f}; - int[][] rowCount = {{1}, {1}, {1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** @@ -212,7 +200,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (name.getText() == "") { type.setText(""); } else { - type.setText(Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); + type.setText(" " + Inter.getLocText(new String[]{"ReportServerP-Toolbar", "FR-Designer_Form_Button"})); } } @@ -226,7 +214,7 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { if (names != "") { names = names.substring(1); } - name.setText(names); + name.setText(" " + names); } public void populateCheckPane() { @@ -237,15 +225,14 @@ public class AuthorityEditToolBarPane extends AuthorityPropertyPane { double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Form_Button"), SwingConstants.LEFT), - buttonVisible}, + new Component[]{buttonVisible}, }; - double[] rowSize = {p, p}; - double[] columnSize = {p, p, f}; - int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; - JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + double[] rowSize = {p}; + double[] columnSize = {p}; + int[][] rowCount = {{1}}; + JPanel check = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL); checkPane.add(check, BorderLayout.CENTER); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } } } \ No newline at end of file diff --git a/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java b/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java index aba809df5..7d4aca1a6 100644 --- a/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java +++ b/designer/src/com/fr/design/mainframe/AuthoritySheetEditedPane.java @@ -41,7 +41,7 @@ public class AuthoritySheetEditedPane extends AuthorityPropertyPane { JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); - this.add(northPane, BorderLayout.NORTH); +// this.add(northPane, BorderLayout.NORTH); authorityEditPane = new SheetAuthorityEditPane(editingWorkBook, selectedIndex); this.add(authorityEditPane, BorderLayout.CENTER); diff --git a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java index fcb6988b9..79e52bfe1 100644 --- a/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java +++ b/designer/src/com/fr/design/mainframe/AuthorityToolBarPane.java @@ -76,7 +76,9 @@ public class AuthorityToolBarPane extends BasicBeanPane extends BasicBeanPane { } } if (BaseUtils.isAuthorityEditing()) { - EastRegionContainerPane.getInstance().replaceUpPane(allowAuthorityUpPane()); - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(allowAuthorityUpPane()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } centerPane.needToShowCoverAndHidPane(); diff --git a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java index c6ed73719..871b51cc6 100644 --- a/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java +++ b/designer/src/com/fr/design/mainframe/SheetAuthorityEditPane.java @@ -28,10 +28,10 @@ import java.awt.event.ItemListener; */ public class SheetAuthorityEditPane extends AuthorityEditPane { private static final int TOP_GAP = 11; - private static final int LEFT_GAP = 8; + private static final int LEFT_GAP = 4; private static final int ALIGNMENT_GAP = -3; - private UICheckBox sheetVisible = new UICheckBox(Inter.getLocText("Widget-Visible")); + private UICheckBox sheetVisible = new UICheckBox("sheet" + Inter.getLocText("Widget-Visible")); private WorkBook workBook = null; private int selectedIndex = -1; @@ -66,17 +66,34 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { super(HistoryTemplateListPane.getInstance().getCurrentEditingTemplate()); setLayout(new BorderLayout()); type = new UILabel(); + type.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); + name.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); - this.add(layoutText(), BorderLayout.WEST); - this.add(layoutPane(), BorderLayout.CENTER); - this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); +// this.add(layoutText(), BorderLayout.WEST); +// this.add(layoutPane(), BorderLayout.CENTER); + this.add(centerPane(), BorderLayout.CENTER); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); this.workBook = editingWorkBook; sheetVisible.addItemListener(itemListener); this.selectedIndex = selectedIndex; } + private JPanel centerPane() { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p, p, p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Type") + " ", SwingConstants.LEFT), type}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), name}, + new Component[]{checkPane, null}, + }; + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + } private JPanel layoutText() { double p = TableLayout.PREFERRED; @@ -121,7 +138,7 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { return; } checkPane.add(populateCheckPane(), BorderLayout.CENTER); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); checkVisibleCheckBoxes(); } @@ -129,14 +146,14 @@ public class SheetAuthorityEditPane extends AuthorityEditPane { * 刷新类型 */ public void populateType() { - type.setText("sheet"); + type.setText(" " + "sheet"); } /** * 更新名字 */ public void populateName() { - name.setText(workBook.getReportName(selectedIndex)); + name.setText(" " + workBook.getReportName(selectedIndex)); } /** diff --git a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java index aac628037..cbb0309ee 100644 --- a/designer/src/com/fr/design/mainframe/SheetNameTabPane.java +++ b/designer/src/com/fr/design/mainframe/SheetNameTabPane.java @@ -215,8 +215,9 @@ public class SheetNameTabPane extends JComponent implements MouseListener, Mouse private void doWithAuthority() { AuthoritySheetEditedPane sheetEditedPane = new AuthoritySheetEditedPane(reportComposite.getEditingWorkBook(), selectedIndex); sheetEditedPane.populate(); - EastRegionContainerPane.getInstance().replaceUpPane(sheetEditedPane); - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(sheetEditedPane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java index 3ca8bff0c..9de87e092 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellExpandAttrPane.java @@ -84,8 +84,8 @@ public class CellExpandAttrPane extends AbstractCellAttrPane { layoutPane = new JPanel(new BorderLayout()); basicPane = new JPanel(); seniorPane = new JPanel(); - basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,20,basicPane()); - seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,20,seniorPane()); + basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"),290,24,basicPane()); + seniorPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"),290,24,seniorPane()); layoutPane.add(basicPane,BorderLayout.NORTH); layoutPane.add(seniorPane,BorderLayout.CENTER); return layoutPane; diff --git a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java index 33d11b5e5..26f4918ff 100644 --- a/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java +++ b/designer/src/com/fr/design/mainframe/cell/settingpane/CellOtherSetPane.java @@ -36,7 +36,7 @@ import java.awt.event.ItemListener; public class CellOtherSetPane extends AbstractCellAttrPane { private static final int HEAD_WDITH = 290; - private static final int HEAD_HEIGTH = 20; + private static final int HEAD_HEIGTH = 24; // normal private UIButtonGroup autoshrik; diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index 088ef95e0..d5d1b063a 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -395,7 +395,8 @@ public class PolyDesigner extends ReportComponent= 0) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); TreePath path = parent.pathByAddingChild(n); expandAll(tree, path, expand); } } if (expand) { tree.expandPath(parent); } else { tree.collapsePath(parent); } } } } \ No newline at end of file +package com.fr.design.roleAuthority; import com.fr.base.BaseUtils; import com.fr.design.constants.UIConstants; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.itree.refreshabletree.ExpandMutableTreeNode; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.DockingView; import com.fr.general.Inter; import com.fr.general.NameObject; import javax.swing.*; import javax.swing.tree.DefaultTreeCellRenderer; import javax.swing.tree.TreeNode; import javax.swing.tree.TreePath; import java.awt.*; import java.util.Enumeration; /** * Author : daisy * Date: 13-9-25 * Time: 下午4:34 */ public class RolesAlreadyEditedPane extends JPanel { private static final int TITLE_HEIGHT = 19; private static final int LEFT_GAP = 8; private static final int TOP_GAP = -1; private static RolesAlreadyEditedPane THIS; private RolesEditedPane rolesEditedPane; /** * 得到实例 * * @return */ public static final RolesAlreadyEditedPane getInstance() { if (THIS == null) { THIS = new RolesAlreadyEditedPane(); } return THIS; } public RolesAlreadyEditedPane() { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText("roles_already_authority_edited")) { @Override public Dimension getPreferredSize() { return new Dimension(super.getPreferredSize().width, TITLE_HEIGHT); } }; authorityTitle.setHorizontalAlignment(SwingConstants.CENTER); authorityTitle.setVerticalAlignment(SwingConstants.CENTER); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); northPane.add(authorityTitle, BorderLayout.CENTER); northPane.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, UIConstants.LINE_COLOR)); // this.add(northPane, BorderLayout.NORTH); rolesEditedPane = new RolesEditedPane(); this.add(rolesEditedPane, BorderLayout.CENTER); } public RoleTree getRoleTree() { return rolesEditedPane.roleTree; } public void refreshDockingView() { rolesEditedPane.refreshDockingView(); } public void setReportAndFSSelectedRoles() { rolesEditedPane.setSelectedRole(); } private class RolesEditedPane extends DockingView { private RoleTree roleTree; private RolesEditedSourceOP op; private DefaultTreeCellRenderer roleTreeRenderer = new DefaultTreeCellRenderer() { private static final long serialVersionUID = 2L; public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) { super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus); ExpandMutableTreeNode treeNode = (ExpandMutableTreeNode) value; Object userObj = treeNode.getUserObject(); if (userObj instanceof String) { // p:这个是column field. this.setIcon(null); this.setText((String) userObj); } else if (userObj instanceof NameObject) { NameObject nameObject = (NameObject) userObj; this.setText(nameObject.getName()); if (nameObject.getName() == Inter.getLocText("M_Server-Platform_Manager")) { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/platform_16_16.png")); } else { this.setIcon(BaseUtils.readIcon("/com/fr/web/images/platform/demo.png")); } } // 这里新建一个Label作为render是因为JTree在动态刷新的时候,节点上render画布的的宽度不会变,会使得一部分比较长的数据显示为"..." this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; } }; public RolesEditedPane() { roleTree = new RoleTree() { public void refreshRoleTree(String selectedRole) { super.refreshRoleTree(selectedRole); RoleTree roleTree = ReportAndFSManagePane.getInstance().getRoleTree(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(selectedRole, parent); } }; roleTree.setCellRenderer(roleTreeRenderer); roleTree.setEditable(false); op = new RolesEditedSourceOP(); UIScrollPane scrollPane = new UIScrollPane(roleTree) { public Dimension getPreferredSize() { return new Dimension(RolesEditedPane.this.getWidth(), RolesEditedPane.this.getHeight()); } }; scrollPane.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, 0)); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); scrollPane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void refreshDockingView() { this.op = new RolesEditedSourceOP(); roleTree.populate(op); expandTree(roleTree, true); } private void setSelectedRole() { String name = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); TreeNode root = (TreeNode) roleTree.getModel().getRoot(); TreePath parent = new TreePath(root); roleTree.setSelectedRole(name, parent); } public String getViewTitle() { return null; } public Icon getViewIcon() { return null; } public Location preferredLocation() { return null; } public void expandTree(JTree tree, boolean isExpand) { TreeNode root = (TreeNode) tree.getModel().getRoot(); expandAll(tree, new TreePath(root), isExpand); } private void expandAll(JTree tree, TreePath parent, boolean expand) { TreeNode node = (TreeNode) parent.getLastPathComponent(); if (node.getChildCount() >= 0) { for (Enumeration e = node.children(); e.hasMoreElements(); ) { TreeNode n = (TreeNode) e.nextElement(); TreePath path = parent.pathByAddingChild(n); expandAll(tree, path, expand); } } if (expand) { tree.expandPath(parent); } else { tree.collapsePath(parent); } } } } \ No newline at end of file diff --git a/designer_base/src/com/fr/start/BaseDesigner.java b/designer_base/src/com/fr/start/BaseDesigner.java index f79baf460..76d7aec45 100644 --- a/designer_base/src/com/fr/start/BaseDesigner.java +++ b/designer_base/src/com/fr/start/BaseDesigner.java @@ -57,10 +57,10 @@ public abstract class BaseDesigner extends ToolBarMenuDock { DesignUtils.setPort(getStartPort()); // 如果端口被占用了 说明程序已经运行了一次,也就是说,已经建立一个监听服务器,现在只要给服务器发送命令就好了 - if (DesignUtils.isStarted()) { - DesignUtils.clientSend(args); - return; - } +// if (DesignUtils.isStarted()) { +// DesignUtils.clientSend(args); +// return; +// } BuildContext.setBuildFilePath(buildPropertiesPath()); //下面这两句的位置不能随便调换,因为会影响语言切换的问题 diff --git a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java index 64decd2af..38c33c444 100644 --- a/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java +++ b/designer_form/src/com/fr/design/designer/properties/FormWidgetAuthorityEditPane.java @@ -34,8 +34,8 @@ import com.fr.general.Inter; public class FormWidgetAuthorityEditPane extends AuthorityEditPane { private FormDesigner designer; private Widget[] widgets = null; - private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Visible")); - private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Enabled")); + private UICheckBox widgetVisible = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Visible")); + private UICheckBox widgetAvailable = new UICheckBox(Inter.getLocText("FR-Designer_Widget_Enabled")); private ItemListener visibleItemListener = new ItemListener() { public void itemStateChanged(ItemEvent e) { String selectedRoles = ReportAndFSManagePane.getInstance().getRoleTree().getSelectedRoleName(); @@ -88,23 +88,19 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { } /** - * 更新类型面板 - * - * - * @date 2014-12-21-下午6:19:43 - * - */ + * 更新类型面板 + * + * @date 2014-12-21-下午6:19:43 + */ public void populateType() { - type.setText(Inter.getLocText("Widget-Form_Widget_Config")); + type.setText(" " + Inter.getLocText("Widget-Form_Widget_Config")); } /** - * 更新名称面板 - * - * - * @date 2014-12-21-下午7:12:27 - * - */ + * 更新名称面板 + * + * @date 2014-12-21-下午7:12:27 + */ public void populateName() { String nameText = ""; if (widgets == null || widgets.length <= 0) { @@ -113,33 +109,31 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { for (int i = 0; i < widgets.length; i++) { nameText += "," + widgets[i].getClass().getSimpleName(); } - name.setText(nameText.substring(1)); + name.setText(" " + nameText.substring(1)); } /** - * 更新checkbox所在的面板 - * - * @return 面板 - * - * - * @date 2014-12-21-下午6:19:03 - * - */ + * 更新checkbox所在的面板 + * + * @return 面板 + * @date 2014-12-21-下午6:19:03 + */ public JPanel populateCheckPane() { - checkPane.add(populateWidgetCheckPane(), BorderLayout.WEST); + checkPane.add(populateWidgetCheckPane(), BorderLayout.CENTER); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); return checkPane; } private JPanel populateWidgetCheckPane() { - double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget"), SwingConstants.LEFT), widgetVisible, widgetAvailable} + new Component[]{widgetVisible}, + new Component[]{widgetAvailable} }; - double[] rowSize = {p}; - double[] columnSize = {p, p, f}; - int[][] rowCount = {{1, 1, 1}}; - return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); + double[] rowSize = {p, p}; + double[] columnSize = {p}; + int[][] rowCount = {{1},{1}}; + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_SMALL); } @@ -157,7 +151,7 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { populateName(); checkPane.removeAll(); populateCheckPane(); - checkPane.setBorder(BorderFactory.createEmptyBorder(ALIGNMENT_GAP, 0, 0, 0)); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); checkCheckBoxes(); } @@ -169,25 +163,25 @@ public class FormWidgetAuthorityEditPane extends AuthorityEditPane { widgetVisible.addItemListener(visibleItemListener); widgetAvailable.addItemListener(usableItemListener); } - - private void populateWidgetButton(String selected){ + + private void populateWidgetButton(String selected) { if (widgets == null || widgets.length == 0) { - return; + return; } - + //选中多个, 界面上只取第一个 Widget widget = widgets[0]; - - if(widget.isVisible()){ - widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); - }else{ - widgetVisible.setSelected(widget.isVisibleAuthority(selected)); + + if (widget.isVisible()) { + widgetVisible.setSelected(!widget.isDoneVisibleAuthority(selected)); + } else { + widgetVisible.setSelected(widget.isVisibleAuthority(selected)); } - - if(widget.isEnabled()){ - widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); - }else{ - widgetAvailable.setSelected(widget.isUsableAuthority(selected)); + + if (widget.isEnabled()) { + widgetAvailable.setSelected(!widget.isDoneUsableAuthority(selected)); + } else { + widgetAvailable.setSelected(widget.isUsableAuthority(selected)); } } diff --git a/designer_form/src/com/fr/design/mainframe/FormDesigner.java b/designer_form/src/com/fr/design/mainframe/FormDesigner.java index 986b91f0b..7572cc204 100644 --- a/designer_form/src/com/fr/design/mainframe/FormDesigner.java +++ b/designer_form/src/com/fr/design/mainframe/FormDesigner.java @@ -475,7 +475,7 @@ public class FormDesigner extends TargetComponent
implements TreeSelection paraHeight = 0; paraComponent = null; formLayoutContainer.setSize(rootComponent.getWidth(), rootComponent.getHeight()); - EastRegionContainerPane.getInstance().replaceDownPane(this.getEastDownPane()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(this.getEastDownPane()); //atat //EastRegionContainerPane.getInstance().addTitlePane(ParameterPropertyPane.getInstance(FormDesigner.this)); //删除后重绘下 @@ -1042,11 +1042,13 @@ public class FormDesigner extends TargetComponent implements TreeSelection if (isSupportAuthority()) { AuthorityPropertyPane authorityPropertyPane = new AuthorityPropertyPane(this); authorityPropertyPane.populate(); - EastRegionContainerPane.getInstance().replaceUpPane(authorityPropertyPane); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(authorityPropertyPane); } else { - EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit()); } - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); } /** @@ -1259,13 +1261,13 @@ public class FormDesigner extends TargetComponent implements TreeSelection pane.setLayout(new BorderLayout()); pane.add(FormWidgetDetailPane.getInstance(FormDesigner.this), BorderLayout.CENTER); - EastRegionContainerPane.getInstance().replaceDownPane(pane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane); } }.start(); } else { pane.setLayout(new BorderLayout()); pane.add(FormWidgetDetailPane.getInstance(this), BorderLayout.CENTER); - EastRegionContainerPane.getInstance().replaceDownPane(pane); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(pane); } return pane; diff --git a/designer_form/src/com/fr/design/mainframe/JForm.java b/designer_form/src/com/fr/design/mainframe/JForm.java index 23299f30b..93b51fbf6 100644 --- a/designer_form/src/com/fr/design/mainframe/JForm.java +++ b/designer_form/src/com/fr/design/mainframe/JForm.java @@ -649,11 +649,13 @@ public class JForm extends JTemplate implements BaseJForm { WidgetToolBarPane.getInstance(formDesign); if (BaseUtils.isAuthorityEditing()) { if (formDesign.isSupportAuthority()) { - EastRegionContainerPane.getInstance().replaceUpPane(new AuthorityPropertyPane(this)); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new AuthorityPropertyPane(this)); } else { - EastRegionContainerPane.getInstance().replaceUpPane(new NoSupportAuthorityEdit()); + EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.AUTHORITY_EDITION_DISABLED); + EastRegionContainerPane.getInstance().replaceAuthorityEditionPane(new NoSupportAuthorityEdit()); } - EastRegionContainerPane.getInstance().replaceDownPane(RolesAlreadyEditedPane.getInstance()); + EastRegionContainerPane.getInstance().replaceConfiguredRolesPane(RolesAlreadyEditedPane.getInstance()); return; }