From 92d520eeb42166d5665c4be93a98f03f340cccc8 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Thu, 3 Aug 2017 11:51:01 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-2897=209.0=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E4=BF=AE=E6=94=B9=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=E7=AC=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/mainframe/AuthorityEditPane.java | 86 ++++++++++++++++++- .../mainframe/AuthorityPropertyPane.java | 50 ++++++++++- 2 files changed, 134 insertions(+), 2 deletions(-) diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java index 25b5912551..5dea2fab91 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityEditPane.java @@ -1 +1,85 @@ -package com.fr.design.mainframe; import com.fr.design.constants.LayoutConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:21 */ public abstract class AuthorityEditPane extends JPanel { protected static final int TOP_GAP = 11; protected static final int LEFT_GAP = 4; protected static final int RIGHT_GAP = 10; protected static final int ALIGNMENT_GAP = -3; protected static final int LEFT_CHECKPANE = 3; protected UILabel type = null; protected UILabel name = null; protected JPanel checkPane = null; private TargetComponent target; private JPanel typePane; private JPanel namePane; public AuthorityEditPane(TargetComponent target) { this.target = target; setLayout(new BorderLayout()); type = new UILabel(); typePane = new JPanel(new BorderLayout()); typePane.add(type, BorderLayout.CENTER); type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); name = new UILabel(); namePane = new JPanel(new BorderLayout()); namePane.add(name, BorderLayout.CENTER); name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); checkPane = new JPanel(); checkPane.setLayout(new BorderLayout()); // this.add(layoutText(), BorderLayout.WEST); // this.add(layoutPane(), BorderLayout.CENTER); this.add(centerPane(), BorderLayout.NORTH); this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); } 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), typePane}, new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, new Component[]{checkPane, null}, }; return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); } /** * 更新权限编辑面板的具体内容:类型、名称、权限面板 */ public void populateDetials() { populateType(); populateName(); checkPane.removeAll(); populateCheckPane(); checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); } public abstract void populateType(); public abstract void populateName(); public abstract JPanel populateCheckPane(); } \ No newline at end of file +package com.fr.design.mainframe; + +import com.fr.design.constants.LayoutConstants; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : daisy + * Date: 13-9-12 + * Time: 下午6:21 + */ +public abstract class AuthorityEditPane extends JPanel { + protected static final int TOP_GAP = 11; + protected static final int LEFT_GAP = 4; + protected static final int RIGHT_GAP = 10; + protected static final int ALIGNMENT_GAP = -3; + protected static final int LEFT_CHECKPANE = 3; + + protected UILabel type = null; + protected UILabel name = null; + protected JPanel checkPane = null; + private TargetComponent target; + private JPanel typePane; + private JPanel namePane; + + public AuthorityEditPane(TargetComponent target) { + this.target = target; + setLayout(new BorderLayout()); + type = new UILabel(); + typePane = new JPanel(new BorderLayout()); + typePane.add(type, BorderLayout.CENTER); + type.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + typePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + name = new UILabel(); + namePane = new JPanel(new BorderLayout()); + namePane.add(name, BorderLayout.CENTER); + name.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,0,0)); + namePane.setBorder(BorderFactory.createLineBorder(Color.lightGray)); + checkPane = new JPanel(); + checkPane.setLayout(new BorderLayout()); +// this.add(layoutText(), BorderLayout.WEST); +// this.add(layoutPane(), BorderLayout.CENTER); + this.add(centerPane(), BorderLayout.NORTH); + this.setBorder(BorderFactory.createEmptyBorder(TOP_GAP, LEFT_GAP, 0, RIGHT_GAP)); + } + + 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), typePane}, + new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_WF_Name") + " ", SwingConstants.LEFT), namePane}, + new Component[]{checkPane, null}, + }; + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); + } + + /** + * 更新权限编辑面板的具体内容:类型、名称、权限面板 + */ + public void populateDetials() { + populateType(); + populateName(); + checkPane.removeAll(); + populateCheckPane(); + checkPane.setBorder(BorderFactory.createEmptyBorder(0, LEFT_CHECKPANE, 0, 0)); + } + + public abstract void populateType(); + + public abstract void populateName(); + + public abstract JPanel populateCheckPane(); + +} \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java index 162e2603cc..d802b7f9a1 100644 --- a/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java +++ b/designer_base/src/com/fr/design/mainframe/AuthorityPropertyPane.java @@ -1 +1,49 @@ -package com.fr.design.mainframe; import com.fr.design.constants.UIConstants; import com.fr.design.designer.TargetComponent; import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : daisy * Date: 13-9-12 * Time: 下午6:14 */ public class AuthorityPropertyPane extends JPanel { private static final int TITLE_HEIGHT = 19; private AuthorityEditPane authorityEditPane = null; public AuthorityPropertyPane(TargetComponent t) { this.setLayout(new BorderLayout()); this.setBorder(null); UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { @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); authorityEditPane = t.createAuthorityEditPane(); UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); scrollPane.setBorder(null); scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); this.add(scrollPane, BorderLayout.CENTER); } public void populate() { authorityEditPane.populateDetials(); } } \ No newline at end of file +package com.fr.design.mainframe; + +import com.fr.design.constants.UIConstants; +import com.fr.design.designer.TargetComponent; +import com.fr.design.gui.icontainer.UIScrollPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Author : daisy + * Date: 13-9-12 + * Time: 下午6:14 + */ +public class AuthorityPropertyPane extends JPanel { + private static final int TITLE_HEIGHT = 19; + private AuthorityEditPane authorityEditPane = null; + + public AuthorityPropertyPane(TargetComponent t) { + this.setLayout(new BorderLayout()); + this.setBorder(null); + UILabel authorityTitle = new UILabel(Inter.getLocText(new String[]{"DashBoard-Potence", "Edit"})) { + @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); + authorityEditPane = t.createAuthorityEditPane(); + UIScrollPane scrollPane = new UIScrollPane(authorityEditPane); + scrollPane.setBorder(null); + scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED); + this.add(scrollPane, BorderLayout.CENTER); + } + + public void populate() { + authorityEditPane.populateDetials(); + } + + +} \ No newline at end of file