From a5b5311004861a2c762aa1d3859f63a37c746384 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 7 Aug 2017 09:25:39 +0800 Subject: [PATCH 01/10] REPORT-3410 --- designer_base/src/com/fr/design/constants/UIConstants.java | 2 +- .../src/com/fr/design/data/datapane/TableDataTree.java | 2 +- designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java | 2 +- designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java | 2 -- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index 787df8ff9..d9eca5357 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -81,7 +81,7 @@ public interface UIConstants { public static final Color AUTHORITY_SHEET_DARK = new Color(86, 120, 143); public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238); public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225); - public static final Color ATTRIBUTE_PRESS = new Color(0xD8F2FD); + public static final Color ATTRIBUTE_PRESS = new Color(0x419BF9); public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD); public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD); public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0); diff --git a/designer_base/src/com/fr/design/data/datapane/TableDataTree.java b/designer_base/src/com/fr/design/data/datapane/TableDataTree.java index bb8553d30..8082d8c1e 100644 --- a/designer_base/src/com/fr/design/data/datapane/TableDataTree.java +++ b/designer_base/src/com/fr/design/data/datapane/TableDataTree.java @@ -74,7 +74,7 @@ public class TableDataTree extends UserObjectRefreshJTree { dim.height += 2; this.setSize(dim); this.setPreferredSize(dim); - this.setBackgroundNonSelectionColor(UIConstants.NORMAL_BACKGROUND); + this.setBackgroundNonSelectionColor(UIConstants.TREE_BACKGROUND); this.setForeground(UIConstants.FONT_COLOR); this.setBackgroundSelectionColor(UIConstants.FLESH_BLUE); return this; diff --git a/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java b/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java index c1b843355..3b2a015d6 100644 --- a/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java +++ b/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java @@ -30,7 +30,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { private int addY = -1; private int rollover = -1; private Color tabBorderColor = new Color(143, 160, 183); - private Color[] tabSelectedColor = {new Color(255, 199, 59), new Color(187, 142, 33), new Color(214, 191, 137)}; + private Color[] tabSelectedColor = {new Color(0x419BF9), new Color(187, 142, 33), new Color(214, 191, 137)}; /** * 创建UI对象 diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java b/designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java index 40a0b8e8a..8c93e76f4 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIRadioButton.java @@ -43,6 +43,4 @@ public class UIRadioButton extends JRadioButton { public UIRadioButton(String text, Icon icon, boolean selected) { super(text, icon, selected); } - - } \ No newline at end of file From c7f613318e07ea3993fe4ae2576b4b1f4ab6edb8 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 7 Aug 2017 10:20:29 +0800 Subject: [PATCH 02/10] fix --- designer_base/src/com/fr/design/constants/UIConstants.java | 1 + designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index e4201cec3..f260ed748 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -84,6 +84,7 @@ public interface UIConstants { public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238); public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225); public static final Color ATTRIBUTE_PRESS = new Color(0x419BF9); + public static final Color NORMAL_BLUE = new Color(0x419BF9); public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD); public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD); public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0); diff --git a/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java b/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java index 3b2a015d6..342fc6e46 100644 --- a/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java +++ b/designer_base/src/com/fr/design/gui/frpane/UITabbedPaneUI.java @@ -30,7 +30,7 @@ public class UITabbedPaneUI extends BasicTabbedPaneUI { private int addY = -1; private int rollover = -1; private Color tabBorderColor = new Color(143, 160, 183); - private Color[] tabSelectedColor = {new Color(0x419BF9), new Color(187, 142, 33), new Color(214, 191, 137)}; + private Color[] tabSelectedColor = {UIConstants.NORMAL_BLUE, new Color(187, 142, 33), new Color(214, 191, 137)}; /** * 创建UI对象 From 6d57f673f71979d4c0d39f829b0bdaaa15860fb5 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 7 Aug 2017 11:39:48 +0800 Subject: [PATCH 03/10] tree background --- .../src/com/fr/design/mainframe/widget/UITreeComboBox.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java index 342892384..7979e7ae3 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java +++ b/designer_form/src/com/fr/design/mainframe/widget/UITreeComboBox.java @@ -11,6 +11,7 @@ import javax.swing.plaf.basic.*; import javax.swing.plaf.metal.*; import javax.swing.tree.*; +import com.fr.design.constants.UIConstants; import com.fr.design.designer.beans.*; import com.fr.design.designer.beans.events.DesignerEditListener; import com.fr.design.designer.beans.events.DesignerEvent; @@ -221,7 +222,7 @@ class TreePopup extends JPopupMenu implements ComboPopup{ JTree tree = this.comboBox.getTree(); if(tree != null){ scrollPane = new UIScrollPane(tree); - scrollPane.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); + scrollPane.setBorder(null); add(scrollPane, BorderLayout.CENTER); } } @@ -230,6 +231,8 @@ class TreePopup extends JPopupMenu implements ComboPopup{ updatePopup(); show(comboBox, 0, comboBox.getHeight()); comboBox.getTree().requestFocus(); + comboBox.getTree().setBackground(UIConstants.TREE_BACKGROUND); + comboBox.getTree().setOpaque(true); } public void hide(){ From 69a6fea2fec611ad058f3ee2d3da58b28727acc3 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 11:47:08 +0800 Subject: [PATCH 04/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E5=9D=90=E6=A0=87=E5=B0=BA?= =?UTF-8?q?=E5=AF=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/poly/PolyBlockProperTable.java | 94 +++++++++++++++++-- .../widget/WidgetBoundsPaneFactory.java | 52 ++++++++++ .../component/WidgetAbsoluteBoundPane.java | 27 +----- .../designer/component/WidgetBoundPane.java | 24 +---- 4 files changed, 143 insertions(+), 54 deletions(-) create mode 100644 designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java diff --git a/designer/src/com/fr/poly/PolyBlockProperTable.java b/designer/src/com/fr/poly/PolyBlockProperTable.java index 9b352f56e..e0f39959a 100644 --- a/designer/src/com/fr/poly/PolyBlockProperTable.java +++ b/designer/src/com/fr/poly/PolyBlockProperTable.java @@ -1,17 +1,80 @@ package com.fr.poly; +import java.awt.*; import java.util.ArrayList; +import javax.swing.*; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; import javax.swing.table.TableModel; +import com.fr.design.dialog.BasicPane; +import com.fr.design.event.UIObserver; +import com.fr.design.event.UIObserverListener; +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.PropertyGroup; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.WidgetBoundsPaneFactory; +import com.fr.general.Inter; import com.fr.poly.group.PolyBoundsGroup; import com.fr.poly.group.PolyNameGroup; import com.fr.report.poly.TemplateBlock; -public class PolyBlockProperTable extends AbstractPropertyTable { +public class PolyBlockProperTable extends JPanel { private PolyDesigner designer; + private UISpinner x; + private UISpinner y; + private UISpinner width; + private UISpinner height; + + public PolyBlockProperTable() { + initPropertyPane(); + initListener(this); + } + + private void initPropertyPane() { + x = new UISpinner(0, 1200, 1); + y = new UISpinner(0, 1200, 1); + width = new UISpinner(0, 1200, 1); + height = new UISpinner(0, 1200, 1); + UIExpandablePane uiExpandablePane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height); + + this.setLayout(new BorderLayout()); + this.add(uiExpandablePane, BorderLayout.CENTER); + } + + private void initListener(Container parentComponent) { + for (int i = 0; i < parentComponent.getComponentCount(); i++) { + Component tmpComp = parentComponent.getComponent(i); + + if (tmpComp instanceof Container) { + initListener((Container) tmpComp); + } +// if (tmpComp instanceof GlobalNameObserver) { +// ((GlobalNameObserver) tmpComp).registerNameListener(new GlobalNameListener() { +// public void setGlobalName(String name) { +// globalName = name; +// } +// +// public String getGlobalName() { +// return globalName; +// } +// }); +// } + if (tmpComp instanceof UIObserver) { + ((UIObserver) tmpComp).registerChangeListener(new UIObserverListener() { + @Override + public void doChange() { + update(); + } + }); + } + } + } /** * 初始化属性表 @@ -20,16 +83,21 @@ public class PolyBlockProperTable extends AbstractPropertyTable { * */ public void initPropertyGroups(Object source) { - groups = new ArrayList(); +// groups = new ArrayList(); if (source instanceof TemplateBlock) { TemplateBlock block = (TemplateBlock) source; PolyNameGroup namegroup = new PolyNameGroup(block); - groups.add(new PropertyGroup(namegroup)); - PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); - groups.add(new PropertyGroup(boundsgroup)); +// groups.add(new PropertyGroup(namegroup)); + final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); + + x.setValue((int)boundsgroup.getValue(0, 1)); + y.setValue((int)boundsgroup.getValue(1, 1)); + width.setValue((int)boundsgroup.getValue(2, 1)); + height.setValue((int)boundsgroup.getValue(3, 1)); +// groups.add(new PropertyGroup(boundsgroup)); } - TableModel model = new BeanTableModel(); - setModel(model); +// TableModel model = new BeanTableModel(); +// setModel(model); this.repaint(); } @@ -46,4 +114,16 @@ public class PolyBlockProperTable extends AbstractPropertyTable { initPropertyGroups(this.designer.getEditingTarget()); } + public void update() { + TemplateBlock block = this.designer.getEditingTarget(); + if (block == null) { + return; + } + PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); + boundsgroup.setValue(x.getValue(), 0, 1); + boundsgroup.setValue(y.getValue(), 1, 1); + boundsgroup.setValue(width.getValue(), 2, 1); + boundsgroup.setValue(height.getValue(), 3, 1); + firePropertyEdit(); + } } \ No newline at end of file diff --git a/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java new file mode 100644 index 000000000..7cfd6218c --- /dev/null +++ b/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -0,0 +1,52 @@ +package com.fr.design.widget; + +import com.fr.design.foldablepane.UIExpandablePane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by plough on 2017/8/7. + */ +public class WidgetBoundsPaneFactory { + + public static UIExpandablePane createBoundsPane(UISpinner width, UISpinner height) { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, + new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, + }; + double[] rowSize = {p, p}; + double[] columnSize = {p, f, f}; + int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; + final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + return new UIExpandablePane("尺寸", 280, 20, panel); + } + + public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y}, + new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, + new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, + }; + double[] rowSize = {p, p, p, p}; + double[] columnSize = {p, f, f}; + int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; + final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + + return new UIExpandablePane(Inter.getLocText("Form-Component_Bounds"), 280, 20, panel); + } +} diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java index 975e224d2..7cf0493de 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetAbsoluteBoundPane.java @@ -3,15 +3,10 @@ package com.fr.design.widget.ui.designer.component; import com.fr.design.designer.creator.XCreator; import com.fr.design.designer.creator.XLayoutContainer; import com.fr.design.designer.creator.XWAbsoluteLayout; -import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.form.ui.container.WAbsoluteLayout; -import com.fr.general.Inter; -import javax.swing.*; import java.awt.*; /** @@ -26,32 +21,14 @@ public class WidgetAbsoluteBoundPane extends WidgetBoundPane { super(source); XLayoutContainer xLayoutContainer = getParent(source); this.parent = (XWAbsoluteLayout) xLayoutContainer; - } public void initBoundPane() { - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; x = new UISpinner(0, 1200, 1); y = new UISpinner(0, 1200, 1); - width = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1); - - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Position")), x, y}, - new Component[]{null, new UILabel(Inter.getLocText("FR-Designer_X_Coordinate"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer_Y_Coordinate"), SwingConstants.CENTER)}, - new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, - new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, - }; - double[] rowSize = {p, p, p, p}; - double[] columnSize = {p, f, f}; - int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; - final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - - UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("Form-Component_Bounds"), 280, 20, panel); - this.add(uiExpandablePane); + this.add(WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height)); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java index 83d3f4ac7..da5334cc2 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/component/WidgetBoundPane.java @@ -2,15 +2,10 @@ package com.fr.design.widget.ui.designer.component; import com.fr.design.designer.creator.*; import com.fr.design.dialog.BasicPane; -import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.Inter; +import com.fr.design.widget.WidgetBoundsPaneFactory; -import javax.swing.*; import java.awt.*; /** @@ -36,25 +31,10 @@ public class WidgetBoundPane extends BasicPane { return container; } - public void initBoundPane() { - - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; width = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1); - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("FR-Designer-Widget_Size")), width, height}, - new Component[]{null, new UILabel(Inter.getLocText("FR-Designer-Tree_Width"), SwingConstants.CENTER), new UILabel(Inter.getLocText("FR-Designer-Tree_Height"), SwingConstants.CENTER)}, - }; - double[] rowSize = {p, p}; - double[] columnSize = {p, f, f}; - int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; - final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); - - UIExpandablePane uiExpandablePane = new UIExpandablePane("尺寸", 280, 20, panel); - this.add(uiExpandablePane); + this.add(WidgetBoundsPaneFactory.createBoundsPane(width, height)); } From c987fc5cd284bdde10fc0c896481778a4c350d01 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 12:42:03 +0800 Subject: [PATCH 05/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E6=8E=A7=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=A7=B0=E9=9D=A2=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/poly/PolyBlockProperTable.java | 24 ++++++--- .../mainframe/widget/BasicPropertyPane.java | 50 +++++++++++++++++++ .../widget/ui/FormBasicPropertyPane.java | 41 +-------------- 3 files changed, 70 insertions(+), 45 deletions(-) create mode 100644 designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java diff --git a/designer/src/com/fr/poly/PolyBlockProperTable.java b/designer/src/com/fr/poly/PolyBlockProperTable.java index e0f39959a..f446c25ad 100644 --- a/designer/src/com/fr/poly/PolyBlockProperTable.java +++ b/designer/src/com/fr/poly/PolyBlockProperTable.java @@ -18,6 +18,7 @@ import com.fr.design.gui.itable.AbstractPropertyTable; import com.fr.design.gui.itable.PropertyGroup; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.general.Inter; import com.fr.poly.group.PolyBoundsGroup; @@ -30,6 +31,9 @@ public class PolyBlockProperTable extends JPanel { private UISpinner y; private UISpinner width; private UISpinner height; + private BasicPropertyPane blockPropertyPane; + + private boolean isPopulating = false; public PolyBlockProperTable() { initPropertyPane(); @@ -37,14 +41,18 @@ public class PolyBlockProperTable extends JPanel { } private void initPropertyPane() { + this.setLayout(new BorderLayout()); + + blockPropertyPane = new BasicPropertyPane(); + UIExpandablePane basicPane = new UIExpandablePane("基本", 280, 20, blockPropertyPane); + this.add(basicPane, BorderLayout.NORTH); + x = new UISpinner(0, 1200, 1); y = new UISpinner(0, 1200, 1); width = new UISpinner(0, 1200, 1); height = new UISpinner(0, 1200, 1); - UIExpandablePane uiExpandablePane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height); - - this.setLayout(new BorderLayout()); - this.add(uiExpandablePane, BorderLayout.CENTER); + UIExpandablePane boundsPane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height); + this.add(boundsPane, BorderLayout.CENTER); } private void initListener(Container parentComponent) { @@ -86,7 +94,8 @@ public class PolyBlockProperTable extends JPanel { // groups = new ArrayList(); if (source instanceof TemplateBlock) { TemplateBlock block = (TemplateBlock) source; - PolyNameGroup namegroup = new PolyNameGroup(block); +// PolyNameGroup namegroup = new PolyNameGroup(block); + blockPropertyPane.getWidgetNameField().setText(block.getBlockName()); // groups.add(new PropertyGroup(namegroup)); final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); @@ -110,15 +119,18 @@ public class PolyBlockProperTable extends JPanel { } public void populate(PolyDesigner designer) { + isPopulating = true; this.designer = designer; initPropertyGroups(this.designer.getEditingTarget()); + isPopulating = false; } public void update() { TemplateBlock block = this.designer.getEditingTarget(); - if (block == null) { + if (isPopulating || block == null) { return; } + block.setBlockName(blockPropertyPane.getWidgetNameField().getText()); PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); boundsgroup.setValue(x.getValue(), 0, 1); boundsgroup.setValue(y.getValue(), 1, 1); diff --git a/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java new file mode 100644 index 000000000..7cc97eaf6 --- /dev/null +++ b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java @@ -0,0 +1,50 @@ +package com.fr.design.mainframe.widget; + +import com.fr.design.dialog.BasicPane; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.general.Inter; + +import javax.swing.*; +import java.awt.*; + +/** + * Created by plough on 2017/8/7. + */ +public class BasicPropertyPane extends BasicPane { + protected UITextField widgetName; + + public BasicPropertyPane(){ + initContentPane(); + } + + protected void initContentPane() { + this.setLayout(FRGUIPaneFactory.createBorderLayout()); + widgetName = new UITextField(); + + double f = TableLayout.FILL; + double p = TableLayout.PREFERRED; + double[] rowSize = {p}; + double[] columnSize = {p, f}; + int[][] rowCount = {{1, 1}}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName}, + }; + JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); + panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + this.add(panel, BorderLayout.NORTH); + } + + public UITextField getWidgetNameField() { + return widgetName; + } + + + @Override + public String title4PopupWindow() { + return "basicProperty"; + } +} diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java index 22cbd0eb9..42d398416 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormBasicPropertyPane.java @@ -1,49 +1,12 @@ package com.fr.design.mainframe.widget.ui; -import com.fr.design.dialog.BasicPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UITextField; -import com.fr.design.layout.FRGUIPaneFactory; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.form.ui.Widget; -import com.fr.general.Inter; - -import javax.swing.*; -import java.awt.*; /** * Created by ibm on 2017/8/4. */ -public class FormBasicPropertyPane extends BasicPane { - private UITextField widgetName; - - public FormBasicPropertyPane(){ - initContentPane(); - } - - protected void initContentPane() { - this.setLayout(FRGUIPaneFactory.createBorderLayout()); - widgetName = new UITextField(); - - double f = TableLayout.FILL; - double p = TableLayout.PREFERRED; - double[] rowSize = {p}; - double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName}, - }; - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); - panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); - this.add(panel, BorderLayout.NORTH); - } - - - @Override - public String title4PopupWindow() { - return "basicProperty"; - } +public class FormBasicPropertyPane extends BasicPropertyPane { public void populate(Widget widget) { widgetName.setText(widget.getWidgetName()); From cca91e4f591e3164257fa453ca48875bbfe051a3 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 13:44:42 +0800 Subject: [PATCH 06/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E5=9B=BD=E9=99=85=E5=8C=96?= =?UTF-8?q?=EF=BC=9B=E8=BE=B9=E8=B7=9D=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/PolyBlockProperTable.java | 2 +- .../src/com/fr/design/locale/designer.properties | 2 ++ .../src/com/fr/design/locale/designer_en_US.properties | 4 +++- .../src/com/fr/design/locale/designer_ja_JP.properties | 2 ++ .../src/com/fr/design/locale/designer_ko_KR.properties | 2 ++ .../src/com/fr/design/locale/designer_zh_CN.properties | 2 ++ .../src/com/fr/design/locale/designer_zh_TW.properties | 4 +++- .../com/fr/design/mainframe/widget/BasicPropertyPane.java | 4 ++-- .../src/com/fr/design/widget/WidgetBoundsPaneFactory.java | 8 ++++---- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/designer/src/com/fr/poly/PolyBlockProperTable.java b/designer/src/com/fr/poly/PolyBlockProperTable.java index f446c25ad..3ce710f0b 100644 --- a/designer/src/com/fr/poly/PolyBlockProperTable.java +++ b/designer/src/com/fr/poly/PolyBlockProperTable.java @@ -44,7 +44,7 @@ public class PolyBlockProperTable extends JPanel { this.setLayout(new BorderLayout()); blockPropertyPane = new BasicPropertyPane(); - UIExpandablePane basicPane = new UIExpandablePane("基本", 280, 20, blockPropertyPane); + UIExpandablePane basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, blockPropertyPane); this.add(basicPane, BorderLayout.NORTH); x = new UISpinner(0, 1200, 1); diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index d6f90cadb..3e146ad18 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -2116,3 +2116,5 @@ FR-Designer_Widget_Error_Tip=error tip FR-Designer_Widget_Return_Leaf=return leaf FR-Designer_Widget_Return_Path=return path FR-Designer_Widget_Display_Position=Display Position +FR-Designer_Widget_Name=Widget Name +FR-Designer_Coords_And_Size=Coords & Size diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 0d44c3036..1009ae9c5 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -2111,4 +2111,6 @@ FR-Designer_Widget_No_Repeat=no repeat FR-Designer_Widget_Error_Tip=error tip FR-Designer_Widget_Return_Leaf=return leaf FR-Designer_Widget_Return_Path=return path -FR-Designer_Widget_Display_Position=Display Position \ No newline at end of file +FR-Designer_Widget_Display_Position=Display Position +FR-Designer_Widget_Name=Widget Name +FR-Designer_Coords_And_Size=Coords & Size \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index f456a229b..2d51d39b0 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -2115,3 +2115,5 @@ FR-Designer_Widget_Error_Tip= FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Path= FR-Designer_Widget_Display_Position= +FR-Designer_Widget_Name= +FR-Designer_Coords_And_Size= diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 444d54824..25c8d5561 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -2115,3 +2115,5 @@ FR-Designer_Widget_Error_Tip= FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Path= FR-Designer_Widget_Display_Position= +FR-Designer_Widget_Name= +FR-Designer_Coords_And_Size= diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 0ec66bd02..7e6e315fa 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -2123,3 +2123,5 @@ FR-Designer_Widget_Error_Tip=\u9519\u8BEF\u63D0\u793A FR-Designer_Widget_Return_Leaf=\u7ED3\u679C\u8FD4\u56DE\u53F6\u5B50\u8282\u70B9 FR-Designer_Widget_Return_Path=\u7ED3\u679C\u8FD4\u56DE\u5B8C\u6574\u5C42\u6B21\u8DEF\u5F84 FR-Designer_Widget_Display_Position=\u663E\u793A\u4F4D\u7F6E +FR-Designer_Widget_Name=\u63A7\u4EF6\u540D\u79F0 +FR-Designer_Coords_And_Size=\u5750\u6807\u00B7\u5C3A\u5BF8 diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 23af4dafa..b659521c3 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -2114,4 +2114,6 @@ FR-Designer_Widget_No_Repeat= FR-Designer_Widget_Error_Tip= FR-Designer_Widget_Return_Leaf= FR-Designer_Widget_Return_Path= -FR-Designer_Widget_Display_Position= \ No newline at end of file +FR-Designer_Widget_Display_Position= +FR-Designer_Widget_Name= +FR-Designer_Coords_And_Size= \ No newline at end of file diff --git a/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java index 7cc97eaf6..1c5c9009c 100644 --- a/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java +++ b/designer_base/src/com/fr/design/mainframe/widget/BasicPropertyPane.java @@ -31,10 +31,10 @@ public class BasicPropertyPane extends BasicPane { double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Form-Widget_Name") + ":"), widgetName}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Name")), widgetName}, }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 7); - panel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); this.add(panel, BorderLayout.NORTH); } diff --git a/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java b/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java index 7cfd6218c..4c5cc5907 100644 --- a/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java +++ b/designer_base/src/com/fr/design/widget/WidgetBoundsPaneFactory.java @@ -26,9 +26,9 @@ public class WidgetBoundsPaneFactory { double[] columnSize = {p, f, f}; int[][] rowCount = {{1, 1, 1}, {1, 1, 1}}; final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); - return new UIExpandablePane("尺寸", 280, 20, panel); + return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 280, 24, panel); } public static UIExpandablePane createAbsoluteBoundsPane(UISpinner x, UISpinner y, UISpinner width, UISpinner height) { @@ -45,8 +45,8 @@ public class WidgetBoundsPaneFactory { double[] columnSize = {p, f, f}; int[][] rowCount = {{1, 1, 1}, {1, 1, 1}, {1, 1, 1}, {1, 1, 1}}; final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); - panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 15)); - return new UIExpandablePane(Inter.getLocText("Form-Component_Bounds"), 280, 20, panel); + return new UIExpandablePane(Inter.getLocText("FR-Designer_Coords_And_Size"), 230, 24, panel); } } From c6acdb681d0b62ce60688e83b69be2501674e0ba Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 13:48:38 +0800 Subject: [PATCH 07/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E5=8E=BB=E6=8E=89=E6=97=A0?= =?UTF-8?q?=E7=94=A8import?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/poly/PolyBlockProperTable.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/designer/src/com/fr/poly/PolyBlockProperTable.java b/designer/src/com/fr/poly/PolyBlockProperTable.java index 3ce710f0b..f499973e6 100644 --- a/designer/src/com/fr/poly/PolyBlockProperTable.java +++ b/designer/src/com/fr/poly/PolyBlockProperTable.java @@ -1,30 +1,18 @@ package com.fr.poly; -import java.awt.*; -import java.util.ArrayList; - -import javax.swing.*; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import javax.swing.table.TableModel; - -import com.fr.design.dialog.BasicPane; import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserverListener; import com.fr.design.foldablepane.UIExpandablePane; -import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itable.AbstractPropertyTable; -import com.fr.design.gui.itable.PropertyGroup; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.widget.BasicPropertyPane; import com.fr.design.widget.WidgetBoundsPaneFactory; import com.fr.general.Inter; import com.fr.poly.group.PolyBoundsGroup; -import com.fr.poly.group.PolyNameGroup; import com.fr.report.poly.TemplateBlock; +import javax.swing.*; +import java.awt.*; + public class PolyBlockProperTable extends JPanel { private PolyDesigner designer; private UISpinner x; From bdd70c5bfd8a0133645c3a844e3041ab632c9964 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 14:02:14 +0800 Subject: [PATCH 08/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E7=82=B9=E5=87=BB=E6=8A=A5?= =?UTF-8?q?=E8=A1=A8=E5=9D=97=E5=86=85=E7=9A=84=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E6=9B=BF=E6=8D=A2=E6=8E=A7=E4=BB=B6=E8=AE=BE?= =?UTF-8?q?=E7=BD=AEtab=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/poly/creator/ECBlockEditor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/designer/src/com/fr/poly/creator/ECBlockEditor.java b/designer/src/com/fr/poly/creator/ECBlockEditor.java index eff054dfb..84911ccf5 100644 --- a/designer/src/com/fr/poly/creator/ECBlockEditor.java +++ b/designer/src/com/fr/poly/creator/ECBlockEditor.java @@ -143,6 +143,7 @@ public class ECBlockEditor extends BlockEditor { } QuickEditorRegion.getInstance().populate(editComponent.getCurrentEditor()); CellElementPropertyPane.getInstance().populate(editComponent); + CellWidgetPropertyPane.getInstance().populate(editComponent); Selection Selection = ((JWorkBook) (HistoryTemplateListPane.getInstance().getCurrentEditingTemplate())).getEditingElementCasePane().getSelection(); if (Selection instanceof FloatSelection) { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT_FLOAT); @@ -155,6 +156,7 @@ public class ECBlockEditor extends BlockEditor { EastRegionContainerPane.getInstance().switchMode(EastRegionContainerPane.PropertyMode.REPORT); EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); EastRegionContainerPane.getInstance().replaceCellElementPane(QuickEditorRegion.getInstance()); + EastRegionContainerPane.getInstance().replaceWidgetSettingsPane(CellWidgetPropertyPane.getInstance()); } EastRegionContainerPane.getInstance().replaceCellAttrPane(CellElementPropertyPane.getInstance()); From 55a8361b01b41febfbcee8d7b8b1c0b7dded9a21 Mon Sep 17 00:00:00 2001 From: plough Date: Mon, 7 Aug 2017 14:37:02 +0800 Subject: [PATCH 09/10] =?UTF-8?q?REPORT-3163=20=E5=90=88=E4=BD=9C=E5=BC=80?= =?UTF-8?q?=E5=8F=919.0=E8=AE=BE=E8=AE=A1=E5=99=A8=3D>=E8=81=9A=E5=90=88?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=3D=E3=80=8B=E4=BB=A3=E7=A0=81=E8=A7=84?= =?UTF-8?q?=E8=8C=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/poly/PolyBlockProperTable.java | 28 ++++--------------- 1 file changed, 6 insertions(+), 22 deletions(-) diff --git a/designer/src/com/fr/poly/PolyBlockProperTable.java b/designer/src/com/fr/poly/PolyBlockProperTable.java index f499973e6..647427c64 100644 --- a/designer/src/com/fr/poly/PolyBlockProperTable.java +++ b/designer/src/com/fr/poly/PolyBlockProperTable.java @@ -20,9 +20,10 @@ public class PolyBlockProperTable extends JPanel { private UISpinner width; private UISpinner height; private BasicPropertyPane blockPropertyPane; - private boolean isPopulating = false; + private static final int MAX_SPINNER_VALUE = 10000; + public PolyBlockProperTable() { initPropertyPane(); initListener(this); @@ -35,10 +36,10 @@ public class PolyBlockProperTable extends JPanel { UIExpandablePane basicPane = new UIExpandablePane(Inter.getLocText("FR-Designer_Basic"), 280, 24, blockPropertyPane); this.add(basicPane, BorderLayout.NORTH); - x = new UISpinner(0, 1200, 1); - y = new UISpinner(0, 1200, 1); - width = new UISpinner(0, 1200, 1); - height = new UISpinner(0, 1200, 1); + x = new UISpinner(0, MAX_SPINNER_VALUE, 1); + y = new UISpinner(0, MAX_SPINNER_VALUE, 1); + width = new UISpinner(0, MAX_SPINNER_VALUE, 1); + height = new UISpinner(0, MAX_SPINNER_VALUE, 1); UIExpandablePane boundsPane = WidgetBoundsPaneFactory.createAbsoluteBoundsPane(x, y, width, height); this.add(boundsPane, BorderLayout.CENTER); } @@ -50,17 +51,6 @@ public class PolyBlockProperTable extends JPanel { if (tmpComp instanceof Container) { initListener((Container) tmpComp); } -// if (tmpComp instanceof GlobalNameObserver) { -// ((GlobalNameObserver) tmpComp).registerNameListener(new GlobalNameListener() { -// public void setGlobalName(String name) { -// globalName = name; -// } -// -// public String getGlobalName() { -// return globalName; -// } -// }); -// } if (tmpComp instanceof UIObserver) { ((UIObserver) tmpComp).registerChangeListener(new UIObserverListener() { @Override @@ -79,22 +69,16 @@ public class PolyBlockProperTable extends JPanel { * */ public void initPropertyGroups(Object source) { -// groups = new ArrayList(); if (source instanceof TemplateBlock) { TemplateBlock block = (TemplateBlock) source; -// PolyNameGroup namegroup = new PolyNameGroup(block); blockPropertyPane.getWidgetNameField().setText(block.getBlockName()); -// groups.add(new PropertyGroup(namegroup)); final PolyBoundsGroup boundsgroup = new PolyBoundsGroup(block, designer.getTarget()); x.setValue((int)boundsgroup.getValue(0, 1)); y.setValue((int)boundsgroup.getValue(1, 1)); width.setValue((int)boundsgroup.getValue(2, 1)); height.setValue((int)boundsgroup.getValue(3, 1)); -// groups.add(new PropertyGroup(boundsgroup)); } -// TableModel model = new BeanTableModel(); -// setModel(model); this.repaint(); } From 3348beae9a980733cf0e5557693736aed5f10367 Mon Sep 17 00:00:00 2001 From: hzzz Date: Mon, 7 Aug 2017 15:43:27 +0800 Subject: [PATCH 10/10] merge --- .../com/fr/design/constants/UIConstants.java | 188 ------------------ 1 file changed, 188 deletions(-) diff --git a/designer_base/src/com/fr/design/constants/UIConstants.java b/designer_base/src/com/fr/design/constants/UIConstants.java index 85707a13c..46a883ab1 100644 --- a/designer_base/src/com/fr/design/constants/UIConstants.java +++ b/designer_base/src/com/fr/design/constants/UIConstants.java @@ -102,154 +102,6 @@ public interface UIConstants { public static final Color SPLIT_LINE = new Color(201, 198, 184); - public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); - public static final BufferedImage DRAG_BAR_RIGHT = BaseUtils.readImage("com/fr/design/images/control/barm.png"); - public static final BufferedImage DRAG_BAR_LEFT = BaseUtils.readImage("com/fr/design/images/control/barl.png"); - public static final BufferedImage DRAG_UP_NORMAL = BaseUtils.readImage("com/fr/design/images/control/upnor.png"); - public static final BufferedImage DRAG_UP_PRESS = BaseUtils.readImage("com/fr/design/images/control/uppre.png"); - public static final BufferedImage DRAG_DOWN_NORMAL = BaseUtils.readImage("com/fr/design/images/control/downnor.png"); - public static final BufferedImage DRAG_DOWN_PRESS = BaseUtils.readImage("com/fr/design/images/control/downpre.png"); - public static final BufferedImage DRAG_RIGHT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/rightnor.png"); - public static final BufferedImage DRAG_RIGHT_PRESS = BaseUtils.readImage("com/fr/design/images/control/rightpre.png"); - public static final BufferedImage DRAG_LEFT_NORMAL = BaseUtils.readImage("com/fr/design/images/control/leftnor.png"); - public static final BufferedImage DRAG_LEFT_PRESS = BaseUtils.readImage("com/fr/design/images/control/leftpre.png"); - public static final BufferedImage DRAG_DOT = BaseUtils.readImage("com/fr/design/images/control/dot.png"); - public static final BufferedImage DRAG_DOT_VERTICAL = BaseUtils.readImage("com/fr/design/images/control/dotv.png"); - public static final BufferedImage POP_BUTTON_DOWN = BaseUtils.readImage("com/fr/design/images/buttonicon/popdownarrow.png"); - public static final BufferedImage POP_BUTTON_UP = BaseUtils.readImage("com/fr/design/images/buttonicon/popuparrow.png"); - public static final BufferedImage DRAG_DOWN_SELECTED_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/downSelected.png"); - public static final BufferedImage DRAG_LEFT_NORMAL_SMALL = BaseUtils.readImage("com/fr/design/images/buttonicon/leftNormal.png"); - public static final int MODEL_NORMAL = 0; - public static final int MODEL_PRESS = 1; - public static final Icon ARROW_DOWN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowdown.png"); - public static final Icon ARROW_UP_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/arrowup.png"); - public static final Icon YES_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/yes.png"); - public static final Icon CHOOSEN_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/select_item.png"); - public static final Icon PRE_WIDGET_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/prewidget.png"); - public static final Icon EDIT_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editn.png"); - public static final Icon EDIT_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/editp.png"); - public static final Icon HIDE_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hiden.png"); - public static final Icon HIDE_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/hidep.png"); - public static final Icon VIEW_NORMAL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewn.png"); - public static final Icon VIEW_PRESSED_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/viewp.png"); - public static final Icon RUN_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/run24.png"); - public static final Icon RUN_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/runs.png"); - public static final Icon PAGE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pageb24.png"); - public static final Icon WRITE_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writeb24.png"); - public static final Icon ANA_BIG_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anab24.png"); - public static final Icon PAGE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/pages.png"); - public static final Icon WRITE_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/writes.png"); - public static final Icon ANA_SMALL_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/anas.png"); - public static final Icon REFRESH_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/refresh.png"); - public static final Icon FONT_ICON = BaseUtils.readIcon("/com/fr/design/images/gui/color/foreground.png"); - public static final Icon HISTORY_ICON = BaseUtils.readIcon("com/fr/design/images/buttonicon/history.png"); - public static final Icon DELETE_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/close.png"); - public static final Icon EDIT_ICON = BaseUtils.readIcon("com/fr/design/images/m_file/edit.png"); - public static final Icon SEARCH_ICON = BaseUtils.readIcon("/com/fr/design/images/data/search.png"); - public static final Icon CLEAR_ICON = BaseUtils.readIcon("/com/fr/design/images/data/source/delete.png"); - public static final Icon LIST_EDIT_ICON = BaseUtils.readIcon("/com/fr/desi/* - * Copyright(c) 2001-2010, FineReport Inc, All Rights Reserved. - */ -package com.fr.design.constants; - -import com.fr.base.BaseUtils; -import com.fr.general.Inter; -import com.fr.stable.Constants; - -import javax.swing.*; -import javax.swing.border.Border; -import java.awt.*; -import java.awt.image.BufferedImage; - -/** - * This class defines the constants used in the designer. - */ -public interface UIConstants { - - - public static final Icon BLACK_ICON = BaseUtils.readIcon("/com/fr/base/images/cell/blank.gif"); - public static final Border CELL_ATTR_EMPTYBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 0); - public static final Border CELL_ATTR_NORMALBORDER = BorderFactory.createEmptyBorder(0 ,10, 0, 15); - - - public static final int SIZE = 17; - - public static final int GAP_NORMAL = 10; // 10px - - /** - * Cell default cursor. - */ - public static final Cursor CELL_DEFAULT_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor( - BaseUtils.readImage("/com/fr/base/images/cell/cursor/cell_default.png"), - new Point(16, 16), "CellDefaultCursor"); - public static final Cursor DRAW_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor( - BaseUtils.readImage("/com/fr/base/images/cell/cursor/cursor_draw.png"), - new Point(16, 16), "DrawCursor"); - - - public static final Cursor FORMAT_BRUSH_CURSOR = Toolkit.getDefaultToolkit().createCustomCursor( - BaseUtils.readImage("/com/fr/base/images/cell/cursor/brush_cursor0.png"), - new Point(16, 16), "formatBrushCursor"); - - /** - * Border style array. - */ - public final static int[] BORDER_LINE_STYLE_ARRAY = new int[]{ - Constants.LINE_THIN, //Thin border. - Constants.LINE_MEDIUM, //Medium border - Constants.LINE_DASH, //dash border - Constants.LINE_HAIR, //hair-line border - Constants.LINE_HAIR2, //hair-line border - Constants.LINE_THICK, //Thick border - Constants.LINE_DOUBLE, //double-line border - Constants.LINE_DOT, //dot border - Constants.LINE_MEDIUM_DASH, //Medium dashed border - Constants.LINE_DASH_DOT, //dash-dot border - Constants.LINE_MEDIUM_DASH_DOT, //medium dash-dot border - Constants.LINE_DASH_DOT_DOT, //dash-dot-dot border - Constants.LINE_MEDIUM_DASH_DOT_DOT, //medium dash-dot-dot border - Constants.LINE_SLANTED_DASH_DOT, //slanted dash-dot border - }; - public static final Color LINE_COLOR = new Color(153, 153, 153); - public static final Color FONT_COLOR = new Color(51, 51, 51); - public static final Color LIGHT_BLUE = new Color(182, 217, 253); - public static final Color SKY_BLUE = new Color(164, 192, 220); - public static final Color OCEAN_BLUE = new Color(141, 179, 217); - public static final Color DARK_BLUE = new Color(0, 88, 144); - public static final Color NORMAL_BACKGROUND = new Color(212, 212, 216); - public static final Color TREE_BACKGROUND = new Color(240, 240, 243); - public static final Color TOOL_PANE_BACKGROUND = new Color(232, 232, 223); - public static final Color SELECT_TAB = new Color(245, 245, 247); - public static final Color TOOLBARUI_BACKGROUND = new Color(255, 255, 255); - public static final Color SHADOW_GREY = new Color(217, 218, 221); - public static final Color SHADOW_CENTER = new Color(200, 200, 200); - public static final Color SHADOW_PURPLE = new Color(255, 0, 255); - public static final Color FLESH_BLUE = new Color(65, 155, 249); - public static final Color HOVER_BLUE = new Color(0xd2d2d2); - public static final Color DOTTED_LINE_COLOR = new Color(35, 108, 184); - public static final Color AUTHORITY_COLOR = new Color(88, 125, 153); - public static final Color AUTHORITY_BLUE = new Color(0xe2e2e2); - public static final Color AUTHORITY_DARK_BLUE = new Color(136, 164, 186); - public static final Color AUTHORITY_PRESS_BLUE = new Color(131, 159, 181); - public static final Color AUTHORITY_LINE_COLOR = new Color(0, 124, 229); - public static final Color AUTHORITY_SHEET_DARK = new Color(86, 120, 143); - public static final Color AUTHORITY_SHEET_LIGHT = new Color(156, 204, 238); - public static final Color AUTHORITY_SHEET_UNSELECTED = new Color(146, 192, 225); - public static final Color ATTRIBUTE_PRESS = new Color(0xD8F2FD); - public static final Color ATTRIBUTE_NORMAL = new Color(0xDADADD); - public static final Color ATTRIBUTE_HOVER = new Color(0xC9C9CD); - public static final Color CHECKBOX_HOVER_SELECTED = new Color(0x3394f0); - public static final Color TEXT_FILED_BORDER_SELECTED = new Color(0x3384f0); - public static final Color SHEET_NORMAL = new Color(0xc8c8ca); - public static final Color SELECTED_BACKGROUND = new Color(0xdeedfe); - public static final Color SELECTED_BORDER_LINE_COLOR = new Color(0x3384f0); - public static final Color DEFAULT_BG_RULER = new Color(0xffffff); - public static final Color RULER_LINE_COLOR = new Color(0xababab); - public static final Color RULER_SCALE_COLOR = new Color(0x4e504f); - public static final Color PROPERTY_PANE_BACKGROUND = new Color(0xdadadd); - public static final Color SPLIT_LINE = new Color(201, 198, 184); - - public static final BufferedImage DRAG_BAR = BaseUtils.readImage("com/fr/design/images/control/bar.png"); public static final BufferedImage DRAG_BAR_RIGHT = BaseUtils.readImage("com/fr/design/images/control/barm.png"); public static final BufferedImage DRAG_BAR_LEFT = BaseUtils.readImage("com/fr/design/images/control/barl.png"); @@ -312,46 +164,6 @@ public interface UIConstants { public static final int CLOSE_AUTHORITY_HEIGHT_AND_WIDTH = 24; - /** - * 正在加载的界面 - */ - public static final Object PENDING = new Object() { - - @Override - public String toString() { - return Inter.getLocText("Loading") + "..."; - } - }; - /** - * 数据库连接失败的界面 - */ - public static final Object CONNECTION_FAILED = new Object() { - - public String toString() { - return Inter.getLocText(new String[]{"Database", "Datasource-Connection_failed"}) + "!"; - } - }; - - /** - * 自动补全的默认快捷键,一般来说是 alt + /. - */ - public static final String DEFAULT_AUTO_COMPLETE = "alt + SLASH";gn/images/control/edit.png"); - public static final Icon LIST_EDIT_WHITE_ICON = BaseUtils.readIcon("/com/fr/design/images/control/edit_white.png"); - public static final Color PRESSED_DARK_GRAY = new Color(127, 127, 127); - public static final Color GRDIENT_DARK_GRAY = new Color(45, 45, 45); - public static final Color BARNOMAL = new Color(232, 232, 233); - public static final Color COMPONENT_BACKGROUND_COLOR = new Color(237,237,238); - public static final int ARC = 0; - public static final int BUTTON_GROUP_ARC = 6; - public static final int LARGEARC = 6; - public static final Stroke BS = new BasicStroke(1f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_ROUND, 2f, new float[]{3, 1}, 0); - public static final Icon PREVIEW_DOWN = BaseUtils.readIcon("com/fr/design/images/buttonicon/prevew_down_icon.png"); - public static final Icon CLOSE_OF_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close.png"); - public static final Icon CLOSE_OVER_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_over.png"); - public static final Icon CLOSE_PRESS_AUTHORITY = BaseUtils.readIcon("/com/fr/design/images/m_report/close_press.png"); - public static final int CLOSE_AUTHORITY_HEIGHT_AND_WIDTH = 24; - - /** * 正在加载的界面 */