From 7b7c2fed3b6e0cbda84b8b5dfc46597300ec6c48 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 28 Aug 2017 10:20:31 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-3734=20[9.0=E4=B8=80=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92]=E8=AE=BE=E8=AE=A1=E5=99=A8=E6=8E=A7?= =?UTF-8?q?=E4=BB=B6=E7=AE=A1=E7=90=86=E6=89=93=E4=B8=8D=E5=BC=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/widget/ValueWidgetPane.java | 23 ++++++++++++++---- .../src/com/fr/design/widget/WidgetPane.java | 24 +++++++++++-------- .../design/gui/controlpane/UIControlPane.java | 4 ++-- 3 files changed, 34 insertions(+), 17 deletions(-) diff --git a/designer/src/com/fr/design/widget/ValueWidgetPane.java b/designer/src/com/fr/design/widget/ValueWidgetPane.java index 2914e100d..a588a8151 100644 --- a/designer/src/com/fr/design/widget/ValueWidgetPane.java +++ b/designer/src/com/fr/design/widget/ValueWidgetPane.java @@ -1,9 +1,11 @@ package com.fr.design.widget; -import javax.swing.JPanel; +import javax.swing.*; import com.fr.design.gui.ilable.UILabel; import com.fr.design.layout.FRGUIPaneFactory; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.form.ui.DataControl; @@ -11,6 +13,8 @@ import com.fr.form.ui.Widget; import com.fr.form.ui.WidgetValue; import com.fr.general.Inter; +import java.awt.*; + public class ValueWidgetPane extends WidgetPane { private JPanel widgetValuePane; private WidgetValueEditor widgetValueEditor; @@ -19,15 +23,24 @@ public class ValueWidgetPane extends WidgetPane { @Override protected void initComponents(ElementCasePane pane) { super.initComponents(pane); - + } + + public JPanel initNorthPane(){ label = new UILabel(" " + Inter.getLocText(new String[]{"Widget", "Value"})+ ":"); - northPane.add(label); label.setVisible(false); widgetValuePane = new JPanel(); widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout()); - northPane.add(widgetValuePane); + double p = TableLayout.PREFERRED; + double f = TableLayout.FILL; + double[] columnSize = {p, p, p, f}; + double[] rowSize = {p}; + Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), editorTypeComboBox, label,widgetValuePane}, + }; + JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return jPanel; } - + @Override public void populate(Widget widget) { super.populate(widget); diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index c4ce0f563..5e73ac790 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -32,7 +32,7 @@ import java.util.Vector; */ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener { - private EditorTypeComboBox editorTypeComboBox; + protected EditorTypeComboBox editorTypeComboBox; private CellWidgetCardPane cellEditorCardPane; private boolean shouldFireSelectedEvent = true; protected JPanel northPane; @@ -55,7 +55,18 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener editorTypeComboBox = new EditorTypeComboBox(pane != null); editorTypeComboBox.setPreferredSize(new Dimension(155, 30)); editorTypeComboBox.setMaximumRowCount(16); + northPane = initNorthPane(); + northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15)); + this.add(northPane, BorderLayout.NORTH); + + editorTypeComboBox.addItemListener(this); + + cellEditorCardPane = new CellWidgetCardPane(pane); + this.add(cellEditorCardPane, BorderLayout.CENTER); + this.addAttributeChangeListener(listener); + } + public JPanel initNorthPane(){ UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 0)); @@ -66,15 +77,8 @@ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener Component[][] components = new Component[][]{ new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), emptyLabel, editorTypeComboBox}, }; - northPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - northPane.setBorder(BorderFactory.createEmptyBorder(12, 10, 10, 15)); - this.add(northPane, BorderLayout.NORTH); - - editorTypeComboBox.addItemListener(this); - - cellEditorCardPane = new CellWidgetCardPane(pane); - this.add(cellEditorCardPane, BorderLayout.CENTER); - this.addAttributeChangeListener(listener); + JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); + return jPanel; } protected JPanel createContentPane() { diff --git a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java index ba793a596..287c76ffc 100644 --- a/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java +++ b/designer_base/src/com/fr/design/gui/controlpane/UIControlPane.java @@ -179,10 +179,10 @@ public abstract class UIControlPane extends BasicPane implements UnrepeatedNameH topToolBar.setBorder(BorderFactory.createEmptyBorder(2, 0, 2, 0)); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = { p, f, 155}; + double[] columnSize = { p, f}; double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(getAddItemText()), null, topToolBar}, + new Component[]{new UILabel(getAddItemText()), topToolBar}, }; JPanel leftTopPane = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); leftTopPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 6, 0)); From e52f941086fe6a1e1bfef7a092bcf20c24fcf598 Mon Sep 17 00:00:00 2001 From: kerry Date: Mon, 28 Aug 2017 14:55:23 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B4=A8=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- designer/src/com/fr/design/widget/ValueWidgetPane.java | 5 +++-- designer/src/com/fr/design/widget/WidgetPane.java | 4 ++-- .../src/com/fr/design/widget/ui/DateEditorDefinePane.java | 1 - .../fr/design/widget/ui/designer/DateEditorDefinePane.java | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/designer/src/com/fr/design/widget/ValueWidgetPane.java b/designer/src/com/fr/design/widget/ValueWidgetPane.java index a588a8151..2205f785d 100644 --- a/designer/src/com/fr/design/widget/ValueWidgetPane.java +++ b/designer/src/com/fr/design/widget/ValueWidgetPane.java @@ -26,16 +26,17 @@ public class ValueWidgetPane extends WidgetPane { } public JPanel initNorthPane(){ + JPanel northPane = super.initNorthPane(); label = new UILabel(" " + Inter.getLocText(new String[]{"Widget", "Value"})+ ":"); label.setVisible(false); widgetValuePane = new JPanel(); widgetValuePane.setLayout(FRGUIPaneFactory.createBorderLayout()); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double[] columnSize = {p, p, p, f}; + double[] columnSize = {p, p, f}; double[] rowSize = {p}; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText(new String[]{"FR-Designer_Selection", "FR-Designer_Widget"})), editorTypeComboBox, label,widgetValuePane}, + new Component[]{northPane, label,widgetValuePane}, }; JPanel jPanel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return jPanel; diff --git a/designer/src/com/fr/design/widget/WidgetPane.java b/designer/src/com/fr/design/widget/WidgetPane.java index 5e73ac790..ac7a9ac0e 100644 --- a/designer/src/com/fr/design/widget/WidgetPane.java +++ b/designer/src/com/fr/design/widget/WidgetPane.java @@ -32,10 +32,10 @@ import java.util.Vector; */ public class WidgetPane extends AbstractAttrNoScrollPane implements ItemListener { - protected EditorTypeComboBox editorTypeComboBox; + private EditorTypeComboBox editorTypeComboBox; private CellWidgetCardPane cellEditorCardPane; private boolean shouldFireSelectedEvent = true; - protected JPanel northPane; + private JPanel northPane; public WidgetPane() { this(null); diff --git a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java index 141675d15..9adb2f14f 100644 --- a/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java @@ -129,7 +129,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane