From 995599281bd315856976990549ecda30adb16912 Mon Sep 17 00:00:00 2001 From: kerry Date: Thu, 24 Aug 2017 09:47:41 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4115=20=E5=8F=82=E6=95=B0=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=90=84=E6=8E=A7=E4=BB=B6=E5=B1=9E=E6=80=A7=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E6=B7=BB=E5=8A=A0=E6=A0=87=E7=AD=BE=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../design/widget/ui/CheckBoxDefinePane.java | 6 +- .../widget/ui/FieldEditorDefinePane.java | 6 +- .../widget/ui/IframeEditorDefinePane.java | 6 +- .../widget/ui/NumberEditorDefinePane.java | 273 ++++++++---------- .../design/widget/ui/WaterMarkDictPane.java | 6 +- .../gui/itextfield/UIPropertyTextField.java | 47 --- .../widget/ui/FormWidgetCardPane.java | 18 +- .../parameter/RootDesignDefinePane.java | 15 +- .../widget/ui/designer/ButtonDefinePane.java | 23 +- .../ui/designer/CheckBoxDefinePane.java | 13 +- .../ui/designer/ComboBoxDefinePane.java | 6 +- .../ui/designer/ComboCheckBoxDefinePane.java | 6 +- .../ui/designer/DateEditorDefinePane.java | 7 +- .../designer/DirectWriteEditorDefinePane.java | 5 +- .../ui/designer/FieldEditorDefinePane.java | 13 +- .../ui/designer/IframeEditorDefinePane.java | 6 +- .../ui/designer/NumberEditorDefinePane.java | 90 +++--- .../designer/TextFieldEditorDefinePane.java | 11 +- .../TreeComboBoxEditorDefinePane.java | 6 +- .../widget/ui/designer/WaterMarkDictPane.java | 6 +- .../designer/btn/ButtonGroupDefinePane.java | 5 +- 21 files changed, 268 insertions(+), 306 deletions(-) delete mode 100644 designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java diff --git a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java index bde3332b46..44d0df7f4a 100644 --- a/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui; import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -14,7 +14,7 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UIPropertyTextField text; + private UITextField text; public CheckBoxDefinePane() { this.iniComoponents(); @@ -22,7 +22,7 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UIPropertyTextField(); + text = new UITextField(); JPanel panel = new JPanel(new BorderLayout()); panel.add(text, BorderLayout.CENTER); panel.setBorder(BorderFactory.createEmptyBorder(0, 35, 0, 0)); diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index ceb3d6476e..054380b4db 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.constants.LayoutConstants; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -24,7 +24,7 @@ public abstract class FieldEditorDefinePane extends Abstr private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UIPropertyTextField errorMsgTextField; + protected UITextField errorMsgTextField; protected JPanel validatePane; public FieldEditorDefinePane() { @@ -44,7 +44,7 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); // // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { diff --git a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java index 218743c498..7416f314fc 100644 --- a/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/IframeEditorDefinePane.java @@ -9,7 +9,7 @@ import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -28,7 +28,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { private static final int P_W = 610; private static final int P_H = 580; - private UIPropertyTextField srcTextField; + private UITextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -61,7 +61,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { java.awt.Component[][] coms = { {horizontalCheck, null}, {verticalCheck, null}, - {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UIPropertyTextField()}, + {new UILabel(Inter.getLocText("Form-Url")), srcTextField = new UITextField()}, {new UILabel(Inter.getLocText("FR-Designer_Parameters")), parameterViewPaneButton}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, 45, LayoutConstants.VGAP_LARGE); diff --git a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java index 45d711e24a..2862ab2ffe 100644 --- a/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java @@ -20,6 +20,7 @@ import javax.swing.text.DefaultFormatter; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ispinner.UIBasicSpinner; +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; @@ -39,113 +40,23 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane private SpinnerNumberModel maxValueModel; private UIBasicSpinner minValueSpinner; private SpinnerNumberModel minValueModel; - private UIBasicSpinner decimalLength; + private UISpinner decimalLength; private JPanel limitNumberPane; private WaterMarkDictPane waterMarkDictPane; - private ActionListener actionListener1 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (allowDecimalsCheckBox.isSelected()) { - limitNumberPane.setVisible(true); - } else { - limitNumberPane.setVisible(false); - } - } - }; - - private ActionListener actionListener2 = new ActionListener() { - - @Override - public void actionPerformed(ActionEvent e) { - if (allowNegativeCheckBox.isSelected()) { - minValueModel.setMinimum(-Double.MAX_VALUE); - if (!setMinValueCheckBox.isSelected()) { - maxValueModel.setMinimum(-Double.MAX_VALUE); - } - } else { - minValueModel.setMinimum(0.0); - if (!setMinValueCheckBox.isSelected()) { - maxValueModel.setMinimum(0.0); - } - Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); - Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); - if (minValue < 0.0) { - minValueSpinner.setValue(0.0); - } - if (maxValue < 0.0) { - maxValueSpinner.setValue(0.0); - } - } - } - }; - - - public ActionListener actionListener3 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (setMaxValueCheckBox.isSelected()) { - maxValueSpinner.setVisible(true); - Double value = new Double(0); - if (setMinValueCheckBox.isSelected()) { - Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); - if (minValue > value) { - value = minValue; - } - } - maxValueSpinner.setValue(value); - } else { - maxValueSpinner.setVisible(false); - minValueModel.setMaximum(Double.MAX_VALUE); - } - } - }; + private ActionListener allowDecimalsListener; + private ActionListener allowNegativeListener ; - private ActionListener actionListener4 = new ActionListener() { - public void actionPerformed(ActionEvent e) { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - Double value = new Double(0); - if (setMaxValueCheckBox.isSelected()) { - Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); - if (maxValue < value) { - value = maxValue; - } - } - minValueSpinner.setValue(value); - } else { - minValueSpinner.setVisible(false); - maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0)); - } - } - }; + public ActionListener setMaxListener; - private ChangeListener changeListener1 = new ChangeListener() { + private ActionListener setMinListener; - @Override - public void stateChanged(ChangeEvent e) { - if (setMaxValueCheckBox.isSelected()) { - if (setMinValueCheckBox.isSelected()) { - minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue())); - } - } - } - }; + private ChangeListener maxValueChangeListener; - private ChangeListener changeListener2 = new ChangeListener() { - - @Override - public void stateChanged(ChangeEvent e) { - if (setMinValueCheckBox.isSelected()) { - if (setMaxValueCheckBox.isSelected()) { - maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue())); - } - } - } - }; + private ChangeListener minValueChangeListener; public NumberEditorDefinePane() { -// super(); - this.initComponents(); } @@ -160,73 +71,53 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); content.add(waterMarkDictPane, BorderLayout.CENTER); - return content; } public JPanel setValidatePane() { + initListeners(); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Decimals")); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.decimalLength = new UIBasicSpinner(new SpinnerNumberModel(16, 0, Integer.MAX_VALUE, 1)); - this.decimalLength.setPreferredSize(new Dimension(155, 20)); - - this.allowDecimalsCheckBox.addActionListener(actionListener1); + this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16); + this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Negative")); - this.allowNegativeCheckBox.addActionListener(actionListener2); + this.allowNegativeCheckBox.addActionListener(allowNegativeListener); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Max_Value"), false); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - maxValueSpinner.setPreferredSize(new Dimension(155, 20)); setNotAllowsInvalid(this.maxValueSpinner); - this.maxValueSpinner.setVisible(false); - this.setMaxValueCheckBox.addActionListener(actionListener3); - this.maxValueSpinner.addChangeListener(changeListener1); + this.setMaxValueCheckBox.addActionListener(setMaxListener); + this.maxValueSpinner.addChangeListener(maxValueChangeListener); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Min_Value"), false); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - minValueSpinner.setPreferredSize(new Dimension(155, 20)); setNotAllowsInvalid(this.minValueSpinner); - this.minValueSpinner.setVisible(false); - this.setMinValueCheckBox.addActionListener(actionListener4); - this.minValueSpinner.addChangeListener(changeListener2); + this.setMinValueCheckBox.addActionListener(setMinListener); + this.minValueSpinner.addChangeListener(minValueChangeListener); UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); - numberLabel.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - - JPanel decimalPane = new JPanel(new BorderLayout()); - decimalPane.add(decimalLength, BorderLayout.CENTER); - decimalPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - JPanel maxValueSpinnerPane = new JPanel(new BorderLayout()); - maxValueSpinnerPane.add(maxValueSpinner, BorderLayout.CENTER); - maxValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - JPanel minValueSpinnerPane = new JPanel(new BorderLayout()); - minValueSpinnerPane.add(minValueSpinner, BorderLayout.CENTER); - minValueSpinnerPane.setBorder(BorderFactory.createEmptyBorder(0, 12, 0, 0)); - + limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{allowDecimalsCheckBox, null}, - new Component[]{numberLabel, decimalPane}, + new Component[]{limitNumberPane, null}, new Component[]{allowNegativeCheckBox, null}, - new Component[]{setMaxValueCheckBox, maxValueSpinnerPane}, - new Component[]{setMinValueCheckBox, minValueSpinnerPane}, + new Component[]{setMaxValueCheckBox, maxValueSpinner}, + new Component[]{setMinValueCheckBox, minValueSpinner}, }; double[] rowSize = {p, p, p, p, p}; double[] columnSize = {p, f}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; JPanel pane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_MEDIUM, LayoutConstants.VGAP_MEDIUM); - pane.setBorder(BorderFactory.createEmptyBorder(0, 1, 0, 0)); + pane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); return pane; - } @@ -237,28 +128,28 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane this.decimalLength.setValue(e.getMaxDecimalLength()); } else { this.limitNumberPane.setVisible(false); + this.limitNumberPane.setPreferredSize(new Dimension(0,0)); } allowNegativeCheckBox.setSelected(e.isAllowNegative()); if (e.getMaxValue() == Double.MAX_VALUE) { setMaxValueCheckBox.setSelected(false); maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); - maxValueSpinner.setVisible(false); - + maxValueSpinner.setEnabled(false); } else { setMaxValueCheckBox.setSelected(true); - maxValueSpinner.setVisible(true); + maxValueSpinner.setEnabled(true); maxValueSpinner.setValue(new Double(e.getMaxValue())); } if (e.getMinValue() == -Double.MAX_VALUE) { setMinValueCheckBox.setSelected(false); minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); - minValueSpinner.setVisible(false); + minValueSpinner.setEnabled(false); } else { + minValueSpinner.setEnabled(true); setMinValueCheckBox.setSelected(true); - minValueSpinner.setVisible(true); minValueSpinner.setValue(new Double(e.getMinValue())); } this.waterMarkDictPane.populate(e); @@ -270,7 +161,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane NumberEditor ob = new NumberEditor(); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); if (allowDecimalsCheckBox.isSelected()) { - ob.setMaxDecimalLength((Integer) this.decimalLength.getValue()); + ob.setMaxDecimalLength((int)this.decimalLength.getValue()); } ob.setAllowNegative(allowNegativeCheckBox.isSelected()); @@ -292,18 +183,108 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane return ob; } - private void checkVisible() { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - } else { - minValueSpinner.setVisible(false); - } - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setVisible(true); - } else { - minValueSpinner.setVisible(false); + private void initListeners(){ allowDecimalsListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (allowDecimalsCheckBox.isSelected()) { + limitNumberPane.setVisible(true); + limitNumberPane.setPreferredSize(new Dimension(215,20)); + } else { + limitNumberPane.setVisible(false); + limitNumberPane.setPreferredSize(new Dimension(0,0)); + } } + }; + + allowNegativeListener = new ActionListener() { + + @Override + public void actionPerformed(ActionEvent e) { + if (allowNegativeCheckBox.isSelected()) { + minValueModel.setMinimum(-Double.MAX_VALUE); + if (!setMinValueCheckBox.isSelected()) { + maxValueModel.setMinimum(-Double.MAX_VALUE); + } + } else { + minValueModel.setMinimum(0.0); + if (!setMinValueCheckBox.isSelected()) { + maxValueModel.setMinimum(0.0); + } + Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); + Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); + if (minValue < 0.0) { + minValueSpinner.setValue(0.0); + } + if (maxValue < 0.0) { + maxValueSpinner.setValue(0.0); + } + } + } + }; + + + setMaxListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (setMaxValueCheckBox.isSelected()) { + maxValueSpinner.setEnabled(true); + Double value = new Double(0); + if (setMinValueCheckBox.isSelected()) { + Double minValue = Double.parseDouble("" + minValueSpinner.getValue()); + if (minValue > value) { + value = minValue; + } + } + maxValueSpinner.setValue(value); + } else { + maxValueSpinner.setEnabled(false); + minValueModel.setMaximum(Double.MAX_VALUE); + } + } + }; + + + setMinListener = new ActionListener() { + public void actionPerformed(ActionEvent e) { + if (setMinValueCheckBox.isSelected()) { + minValueSpinner.setEnabled(true); + Double value = new Double(0); + if (setMaxValueCheckBox.isSelected()) { + Double maxValue = Double.parseDouble("" + maxValueSpinner.getValue()); + if (maxValue < value) { + value = maxValue; + } + } + minValueSpinner.setValue(value); + } else { + minValueSpinner.setEnabled(false); + maxValueModel.setMinimum(allowNegativeCheckBox.isSelected() ? (-Double.MAX_VALUE) : new Double(0)); + } + } + }; + + maxValueChangeListener = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + if (setMaxValueCheckBox.isSelected()) { + if (setMinValueCheckBox.isSelected()) { + minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue())); + } + } + } + }; + + minValueChangeListener = new ChangeListener() { + + @Override + public void stateChanged(ChangeEvent e) { + if (setMinValueCheckBox.isSelected()) { + if (setMaxValueCheckBox.isSelected()) { + maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue())); + } + } + } + }; } private void setNotAllowsInvalid(UIBasicSpinner jspinner) { diff --git a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java index 1f38129974..b0668db162 100644 --- a/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java +++ b/designer/src/com/fr/design/widget/ui/WaterMarkDictPane.java @@ -1,7 +1,7 @@ package com.fr.design.widget.ui; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.WaterMark; @@ -13,12 +13,12 @@ import java.awt.event.KeyListener; public class WaterMarkDictPane extends JPanel { - private UIPropertyTextField waterMarkTextField; + private UITextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(new BorderLayout()); - waterMarkTextField = new UIPropertyTextField(); + waterMarkTextField = new UITextField(); UILabel emptyLabel = new UILabel(); emptyLabel.setBorder(BorderFactory.createEmptyBorder(0, 30, 0, 0)); diff --git a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java b/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java deleted file mode 100644 index 8a949d4a14..0000000000 --- a/designer_base/src/com/fr/design/gui/itextfield/UIPropertyTextField.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.design.gui.itextfield; - -import java.awt.event.FocusEvent; -import java.awt.event.FocusListener; -import javax.swing.text.Document; - - -/** - * Created by ibm on 2017/8/16. - */ -public class UIPropertyTextField extends UITextField{ - - public UIPropertyTextField() { - super(); - } - - public UIPropertyTextField(int columns) { - super(columns); - } - - public UIPropertyTextField(String text, int columns) { - super(text, columns); - } - - public UIPropertyTextField(String text) { - super(text); - } - - public UIPropertyTextField(Document doc, String text, int columns) { - super(doc, text, columns); - } - - protected void initListener() { - if (shouldResponseChangeListener()) { - addFocusListener(new FocusListener() { - @Override - public void focusGained(FocusEvent e) { - } - - @Override - public void focusLost(FocusEvent e) { - attributeChange(); - } - }); - } - } -} diff --git a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java index 29327fa1e8..fe5c305ac9 100644 --- a/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java +++ b/designer_form/src/com/fr/design/mainframe/widget/ui/FormWidgetCardPane.java @@ -184,16 +184,16 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { if (widgetBoundPane != null) { widgetBoundPane.populate(); } - if (cellWidget instanceof WScaleLayout) { + Widget innerWidget = cellWidget; + if (cellWidget.acceptType(WScaleLayout.class)) { Widget crBoundsWidget = ((WScaleLayout) cellWidget).getBoundsWidget(); - currentEditorDefinePane.populateBean(((CRBoundsWidget) crBoundsWidget).getWidget()); - } else if(cellWidget instanceof WTitleLayout){ + innerWidget = ((CRBoundsWidget) crBoundsWidget).getWidget(); + } else if(cellWidget.acceptType(WTitleLayout.class)){ CRBoundsWidget crBoundsWidget = ((WTitleLayout) cellWidget).getBodyBoundsWidget(); - currentEditorDefinePane.populateBean(crBoundsWidget.getWidget()); - }else{ - currentEditorDefinePane.populateBean(cellWidget); + innerWidget = crBoundsWidget.getWidget(); } - widgetPropertyPane.populate(cellWidget); + currentEditorDefinePane.populateBean(innerWidget); + widgetPropertyPane.populate(innerWidget); reinitAllListeners(); this.addAttributeChangeListener(listener); } @@ -207,12 +207,12 @@ public class FormWidgetCardPane extends AbstractAttrNoScrollPane { } fireValueChanged(); - if (xCreator instanceof XWScaleLayout) { + if (xCreator.acceptType(XWScaleLayout.class)) { XCreator xCreator1 = xCreator.getEditingChildCreator(); xCreator1.resetData(widget); xCreator.removeAll(); xCreator.add(xCreator1); - }else if(xCreator instanceof XWTitleLayout){ + }else if(xCreator.acceptType(XWTitleLayout.class)){ XCreator xCreator1 = ((XWTitleLayout) xCreator).getXCreator(0); xCreator1.resetData(widget); xCreator.removeAll(); diff --git a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java index 2ef0ea974a..ac265cc200 100644 --- a/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java +++ b/designer_form/src/com/fr/design/parameter/RootDesignDefinePane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +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; @@ -29,8 +30,10 @@ public class RootDesignDefinePane extends AbstractDataModify { private XWParameterLayout root; private UISpinner designerWidth; private UICheckBox displayReport; + private UICheckBox useParamsTemplate; private AccessibleBackgroundEditor background; private UIButtonGroup hAlignmentPane; + private UITextField labelNameTextField; public RootDesignDefinePane(XCreator xCreator) { super(xCreator); @@ -69,7 +72,9 @@ public class RootDesignDefinePane extends AbstractDataModify { public JPanel createAdvancePane() { JPanel jPanel = FRGUIPaneFactory.createBorderLayout_S_Pane(); + labelNameTextField = new UITextField(); displayReport = new UICheckBox(Inter.getLocText("FR-Designer_DisplayNothingBeforeQuery")); + useParamsTemplate = new UICheckBox(Inter.getLocText("FR-Designer_Use_Params_Template")); background = new AccessibleBackgroundEditor(); Icon[] hAlignmentIconArray = {BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_left_normal.png"), BaseUtils.readIcon("/com/fr/design/images/m_format/cellstyle/h_center_normal.png"), @@ -80,12 +85,14 @@ public class RootDesignDefinePane extends AbstractDataModify { , Inter.getLocText("FR-Designer-StyleAlignment_Center"), Inter.getLocText("FR-Designer-StyleAlignment_Right")}); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; - double[] rowSize = {p, p, p}; + double[] rowSize = {p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Background")), background}, new Component[]{displayReport, null}, + new Component[]{useParamsTemplate, null}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WidgetDisplyPosition")), hAlignmentPane} }; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 20, 10); @@ -101,8 +108,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @Override public void populateBean(WParameterLayout ob) { + labelNameTextField.setText(ob.getLabelName()); background.setValue(ob.getBackground()); displayReport.setSelected(ob.isDelayDisplayContent()); + useParamsTemplate.setSelected(ob.isUseParamsTemplate()); designerWidth.setValue(ob.getDesignWidth()); hAlignmentPane.setSelectedIndex(ob.getPosition()); } @@ -111,8 +120,10 @@ public class RootDesignDefinePane extends AbstractDataModify { @Override public WParameterLayout updateBean() { WParameterLayout wParameterLayout = (WParameterLayout) creator.toData(); + wParameterLayout.setLabelName(labelNameTextField.getText()); wParameterLayout.setDesignWidth((int) designerWidth.getValue()); wParameterLayout.setDelayDisplayContent(displayReport.isSelected()); + wParameterLayout.setUseParamsTemplate(useParamsTemplate.isSelected()); wParameterLayout.setBackground((Background) background.getValue()); wParameterLayout.setPosition(hAlignmentPane.getSelectedIndex()); return wParameterLayout; diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java index 588828255a..ede1d7d295 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ButtonDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -17,9 +17,10 @@ import javax.swing.*; import java.awt.*; public abstract class ButtonDefinePane extends AbstractDataModify { - private UIPropertyTextField hotkeysTextField; - private UIPropertyTextField buttonNameTextField; + private UITextField hotkeysTextField; + private UITextField buttonNameTextField; private AccessibleIconEditor iconPane; + protected UITextField labelNameTextField; public ButtonDefinePane(XCreator creator){ @@ -31,18 +32,20 @@ public abstract class ButtonDefinePane extends AbstractDataMod this.setLayout(FRGUIPaneFactory.createBorderLayout()); double p = TableLayout.PREFERRED; double f = TableLayout.FILL; - double rowSize[] = {p, p, p, p, p, p, p}; + double rowSize[] = {p, p, p, p, p, p, p, p}; double columnSize[] = {p, f}; - int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; + int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; iconPane = new AccessibleIconEditor(); - hotkeysTextField = new UIPropertyTextField(); - buttonNameTextField = new UIPropertyTextField(); + hotkeysTextField = new UITextField(); + buttonNameTextField = new UITextField(); + labelNameTextField = new UITextField(); Component[] backgroundCompPane = createBackgroundComp(); Component[] frFont = createFontPane(); UILabel backgroundLabel = new UILabel(Inter.getLocText("FR-Designer_Background")); backgroundLabel.setVerticalAlignment(SwingConstants.TOP); Component[][] n_components = { {new UILabel(Inter.getLocText("FR-Designer_Button-Name") + ":"), buttonNameTextField}, + {new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, backgroundCompPane, frFont, {new UILabel(Inter.getLocText("FR-Designer_Icon") + ":"), iconPane}, @@ -73,7 +76,8 @@ public abstract class ButtonDefinePane extends AbstractDataMod @Override public void populateBean(T btn) { hotkeysTextField.setText(btn.getHotkeys()); - buttonNameTextField.setText(btn.getLabelName()); + buttonNameTextField.setText(btn.getText()); + labelNameTextField.setText(btn.getLabelName()); iconPane.setValue(btn.getIconName()); populateSubButtonPane(btn); } @@ -86,8 +90,9 @@ public abstract class ButtonDefinePane extends AbstractDataMod public T updateBean() { T btn = updateSubButtonPane(); btn.setHotkeys(hotkeysTextField.getText()); - btn.setLabelName(buttonNameTextField.getText()); + btn.setLabelName(labelNameTextField.getText()); btn.setIconName((String)iconPane.getValue()); + btn.setText(buttonNameTextField.getText()); return btn; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java index 18f0e0cedc..35f7658354 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/CheckBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.designer.creator.XCreator; 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.itextfield.UIPropertyTextField; +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; @@ -16,9 +16,10 @@ import javax.swing.*; import java.awt.*; public class CheckBoxDefinePane extends AbstractDataModify { - private UIPropertyTextField text; + private UITextField text; private UISpinner fontSizePane; private FormWidgetValuePane formWidgetValuePane; + protected UITextField labelNameTextField; public CheckBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -27,19 +28,21 @@ public class CheckBoxDefinePane extends AbstractDataModify { private void iniComoponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - text = new UIPropertyTextField(); + text = new UITextField(); fontSizePane = new UISpinner(0, 20, 1, 0); + labelNameTextField = new UITextField(); formWidgetValuePane = new FormWidgetValuePane(creator.toData(), false); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Text")), text }, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane}, }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 1},{1, 3},{1, 1}}; + int[][] rowCount = {{1, 1},{1, 1}, {1, 3},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java index 08f73236a5..829736a651 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboBoxDefinePane.java @@ -4,7 +4,7 @@ import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.ComboBox; import com.fr.general.Inter; @@ -13,7 +13,7 @@ import java.awt.*; public class ComboBoxDefinePane extends DictEditorDefinePane { private UICheckBox removeRepeatCheckBox; - private UIPropertyTextField waterMarkField; + private UITextField waterMarkField; public ComboBoxDefinePane(XCreator xCreator) { super(xCreator); @@ -26,7 +26,7 @@ public class ComboBoxDefinePane extends DictEditorDefinePane { } public Component[] createWaterMarkPane() { - waterMarkField = new UIPropertyTextField(); + waterMarkField = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkField}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java index 7a3ed0f224..8bff989368 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/ComboCheckBoxDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.form.ui.ComboCheckBox; @@ -17,7 +17,7 @@ import java.awt.*; public class ComboCheckBoxDefinePane extends DictEditorDefinePane { private UICheckBox supportTagCheckBox; private UIButtonGroup returnType; - private UIPropertyTextField waterMarkDictPane; + private UITextField waterMarkDictPane; private UICheckBox removeRepeatCheckBox; public ComboCheckBoxDefinePane(XCreator xCreator) { @@ -31,7 +31,7 @@ public class ComboCheckBoxDefinePane extends DictEditorDefinePane } public Component[] createWaterMarkPane() { - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java index ec735a9add..90fb8de972 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/DateEditorDefinePane.java @@ -9,6 +9,7 @@ import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; +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; @@ -38,6 +39,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane(new String[] {Inter.getLocText("Date") , Inter.getLocText("String")}); JPanel formatHead = createFormatHead(); - + labelNameTextField = new UITextField(); startDv = new DateValuePane(); endDv = new DateValuePane(); double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"), formatHead}, new Component[]{new UILabel(Inter.getLocText("FS_Start_Date") + ":"), startDv}, @@ -73,7 +76,7 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane e double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane }, dicPane, removeRepeatPane, waterMarkComponent, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} }; - double[] rowSize = {p, p, p, p, p, p,p}; + double[] rowSize = {p, p, p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; + int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1},{1,1},{1,1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); advancePane.add(panel, BorderLayout.NORTH); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java index ffc45d2664..cc7ecc664e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/FieldEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -22,9 +22,11 @@ import java.awt.event.ItemListener; public abstract class FieldEditorDefinePane extends AbstractDataModify { protected UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 - protected UIPropertyTextField errorMsgTextField; + protected UITextField errorMsgTextField; protected JPanel validatePane; protected UISpinner fontSizePane; + protected UITextField labelNameTextField; + public FieldEditorDefinePane(XCreator xCreator) { super(xCreator); @@ -37,10 +39,11 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); + labelNameTextField = new UITextField(); allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Null")); allowBlankCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); fontSizePane = new UISpinner(0, 20, 1, 0); - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); JPanel contentPane = this.setFirstContentPane(); if (contentPane != null) { UIExpandablePane uiExpandablePane = new UIExpandablePane(Inter.getLocText("FR-Designer_Advanced"), 280, 20, contentPane); @@ -54,6 +57,7 @@ public abstract class FieldEditorDefinePane extends Abstr this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); this.errorMsgTextField.setText(ob.getErrorMessage()); this.fontSizePane.setValue(ob.getFontSize()); + this.labelNameTextField.setText(ob.getLabelName()); populateSubFieldEditorBean(ob); } @@ -66,12 +70,13 @@ public abstract class FieldEditorDefinePane extends Abstr e.setAllowBlank(this.allowBlankCheckBox.isSelected()); e.setErrorMessage(this.errorMsgTextField.getText()); e.setFontSize((int)fontSizePane.getValue()); + e.setLabelName(labelNameTextField.getText()); return e; } protected void initErrorMsgPane() { // 错误信息 - errorMsgTextField = new UIPropertyTextField(); + errorMsgTextField = new UITextField(); // // richer:主要为了方便查看比较长的错误信息 errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { diff --git a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java index cbda1a2e3a..fb7399ef88 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/IframeEditorDefinePane.java @@ -5,7 +5,7 @@ import com.fr.design.foldablepane.UIExpandablePane; import com.fr.design.gui.frpane.ReportletParameterViewPane; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -18,7 +18,7 @@ import java.awt.*; import java.util.List; public class IframeEditorDefinePane extends AbstractDataModify { - private UIPropertyTextField srcTextField; + private UITextField srcTextField; private ReportletParameterViewPane parameterViewPane; private UICheckBox horizontalCheck; private UICheckBox verticalCheck; @@ -44,7 +44,7 @@ public class IframeEditorDefinePane extends AbstractDataModify { Component[][] coms = { { horizontalCheck, null }, { verticalCheck, null }, - { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UIPropertyTextField() }, + { new UILabel(Inter.getLocText("Form-Url") + ":"), srcTextField = new UITextField() }, { new UILabel(Inter.getLocText("Parameter") + ":"), parameterViewPane = new ReportletParameterViewPane() } }; int[][] rowCount = {{1, 1},{1, 1},{1, 1}, {1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(coms, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, 5); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java index cc50a01275..9ca625a15b 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/NumberEditorDefinePane.java @@ -4,13 +4,13 @@ import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; +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.design.widget.ui.designer.component.FormWidgetValuePane; import com.fr.form.ui.NumberEditor; import com.fr.general.Inter; -import com.fr.third.fr.pdf.layout.border.Border; import javax.swing.*; import javax.swing.event.ChangeEvent; @@ -24,6 +24,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane public NumberEditorDefinePane(XCreator xCreator){ super(xCreator); } + private FormWidgetValuePane formWidgetValuePane; /** * @@ -37,23 +38,21 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane private SpinnerNumberModel maxValueModel; private UIBasicSpinner minValueSpinner; private SpinnerNumberModel minValueModel; - private com.fr.design.editor.editor.IntegerEditor decimalLength; + private UISpinner decimalLength; private JPanel limitNumberPane; private WaterMarkDictPane waterMarkDictPane; - private ActionListener actionListener1; - - private ActionListener actionListener2; + private ActionListener allowDecimalsListener; + private ActionListener allowNegativeListener ; - private ActionListener actionListener3; + public ActionListener setMaxListener; + private ActionListener setMinListener; - private ActionListener actionListener4 ; + private ChangeListener maxValueChangeListener; - private ChangeListener changeListener1; - - private ChangeListener changeListener2 ; + private ChangeListener minValueChangeListener; public NumberEditorDefinePane() { super(); @@ -73,13 +72,14 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size")), fontSizePane} }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p,f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1}}; JPanel advancePane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); advancePane.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); @@ -88,17 +88,19 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } private void initListeners(){ - actionListener1 = new ActionListener() { + allowDecimalsListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (allowDecimalsCheckBox.isSelected()) { limitNumberPane.setVisible(true); + limitNumberPane.setPreferredSize(new Dimension(215,20)); } else { limitNumberPane.setVisible(false); + limitNumberPane.setPreferredSize(new Dimension(0,0)); } } }; - actionListener2 = new ActionListener() { + allowNegativeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -125,7 +127,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane }; - actionListener3 = new ActionListener() { + setMaxListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (setMaxValueCheckBox.isSelected()) { maxValueSpinner.setEnabled(true); @@ -145,7 +147,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane }; - actionListener4 = new ActionListener() { + setMinListener = new ActionListener() { public void actionPerformed(ActionEvent e) { if (setMinValueCheckBox.isSelected()) { minValueSpinner.setEnabled(true); @@ -164,7 +166,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } }; - changeListener1 = new ChangeListener() { + maxValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -176,7 +178,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } }; - changeListener2 = new ChangeListener() { + minValueChangeListener = new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -191,42 +193,42 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane public JPanel setValidatePane() { initListeners(); -// super.addValidatePane(); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); - this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); - this.decimalLength.setColumns(4); + this.decimalLength = new UISpinner(0, Integer.MAX_VALUE, 1, 16); allowDecimalsCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.allowDecimalsCheckBox.addActionListener(actionListener1); + this.allowDecimalsCheckBox.addActionListener(allowDecimalsListener); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); - this.allowNegativeCheckBox.addActionListener(actionListener2); + this.allowNegativeCheckBox.addActionListener(allowNegativeListener); allowNegativeCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); setMaxValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - maxValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.maxValueSpinner); - this.setMaxValueCheckBox.addActionListener(actionListener3); - this.maxValueSpinner.addChangeListener(changeListener1); + this.setMaxValueCheckBox.addActionListener(setMaxListener); + this.maxValueSpinner.addChangeListener(maxValueChangeListener); this.setMinValueCheckBox = new UICheckBox(Inter.getLocText("Need_Min_Value"), false); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); - minValueSpinner.setPreferredSize(new Dimension(120, 20)); setNotAllowsInvalid(this.minValueSpinner); minValueSpinner.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); - this.setMinValueCheckBox.addActionListener(actionListener4); + this.setMinValueCheckBox.addActionListener(setMinListener); + this.minValueSpinner.addChangeListener(minValueChangeListener); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); + UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); + limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); + double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ new Component[]{allowDecimalsCheckBox, null }, - new Component[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"})), decimalLength }, + new Component[]{limitNumberPane, null}, new Component[]{allowNegativeCheckBox, null}, new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinner}, @@ -235,7 +237,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane double[] columnSize = {p,f}; int[][] rowCount = {{1, 1},{1, 1},{1, 1},{1, 1},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); - panel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0)); + panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); return panel; } @@ -273,7 +275,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane minValueSpinner.setValue(new Double(e.getMinValue())); } formWidgetValuePane.populate(e); -// this.regErrorMsgTextField.setText(e.getRegErrorMessage()); this.waterMarkDictPane.populate(e); } @@ -284,7 +285,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane formWidgetValuePane.update(ob); ob.setAllowDecimals(allowDecimalsCheckBox.isSelected()); if (allowDecimalsCheckBox.isSelected()) { - ob.setMaxDecimalLength(this.decimalLength.getValue()); + ob.setMaxDecimalLength((int)this.decimalLength.getValue()); } ob.setAllowNegative(allowNegativeCheckBox.isSelected()); @@ -306,20 +307,6 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane return ob; } - private void checkVisible() { - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setEnabled(true); - } else { - minValueSpinner.setEnabled(false); - } - - if (setMinValueCheckBox.isSelected()) { - minValueSpinner.setEnabled(true); - } else { - minValueSpinner.setEnabled(false); - } - } - private void setNotAllowsInvalid(UIBasicSpinner jspinner) { JComponent editor = jspinner.getEditor(); if (editor instanceof UIBasicSpinner.DefaultEditor) { @@ -331,4 +318,15 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane } } + public Object getValue(UIBasicSpinner jspinner){ + JComponent editor = jspinner.getEditor(); + if (editor instanceof UIBasicSpinner.DefaultEditor) { + JFormattedTextField ftf = ((UIBasicSpinner.DefaultEditor) editor).getTextField(); + ftf.setColumns(10); + JFormattedTextField.AbstractFormatter formatter = ftf.getFormatter(); + return ftf.getValue(); + } + return null; + } + } \ No newline at end of file diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java index 46f62dac10..5378c00ed8 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TextFieldEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +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; @@ -18,7 +18,7 @@ import java.awt.event.KeyEvent; public class TextFieldEditorDefinePane extends FieldEditorDefinePane { protected RegPane regPane; - private UIPropertyTextField waterMarkDictPane; + private UITextField waterMarkDictPane; FormWidgetValuePane formWidgetValuePane; public TextFieldEditorDefinePane(XCreator xCreator) { @@ -47,7 +47,7 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane } }; regPane.addPhoneRegListener(pl); - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); waterMarkDictPane.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { regPane.removePhoneRegListener(pl); @@ -69,13 +69,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value"), SwingConstants.LEFT), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark"), SwingConstants.LEFT), waterMarkDictPane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_Font-Size"), SwingConstants.LEFT), fontSizePane} }; - double[] rowSize = {p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p}; double[] columnSize = {p,f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1},{1, 3},{1, 1},{1, 1}}; final JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 10); JPanel boundsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 10, 0)); diff --git a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java index 68cac10377..baabdac70e 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/TreeComboBoxEditorDefinePane.java @@ -3,7 +3,7 @@ package com.fr.design.widget.ui.designer; import com.fr.design.data.DataCreatorUI; import com.fr.design.designer.creator.XCreator; import com.fr.design.gui.ilable.UILabel; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.form.ui.TreeEditor; import com.fr.general.Inter; @@ -11,14 +11,14 @@ import java.awt.*; public class TreeComboBoxEditorDefinePane extends TreeEditorDefinePane { - protected UIPropertyTextField waterMarkDictPane; + protected UITextField waterMarkDictPane; public TreeComboBoxEditorDefinePane(XCreator xCreator) { super(xCreator); } public Component[] createWaterMarkPane(){ - waterMarkDictPane = new UIPropertyTextField(); + waterMarkDictPane = new UITextField(); return new Component[]{new UILabel(Inter.getLocText("FR-Designer_WaterMark")), waterMarkDictPane}; } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java index 75d6d7d17b..c0ec063af5 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/WaterMarkDictPane.java @@ -1,6 +1,6 @@ package com.fr.design.widget.ui.designer; -import com.fr.design.gui.itextfield.UIPropertyTextField; +import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.form.ui.WaterMark; @@ -8,12 +8,12 @@ import javax.swing.*; public class WaterMarkDictPane extends JPanel{ - private UIPropertyTextField waterMarkTextField; + private UITextField waterMarkTextField; public WaterMarkDictPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0,0,0,0)); - waterMarkTextField = new UIPropertyTextField(); + waterMarkTextField = new UITextField(); this.add(waterMarkTextField); } diff --git a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java index e0df39eb1b..2cfd8ce3ca 100644 --- a/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java +++ b/designer_form/src/com/fr/design/widget/ui/designer/btn/ButtonGroupDefinePane.java @@ -38,14 +38,15 @@ public abstract class ButtonGroupDefinePane extends Field double f = TableLayout.FILL; double p = TableLayout.PREFERRED; Component[][] components = new Component[][]{ + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Label_Name")), labelNameTextField}, new Component[]{new UILabel(Inter.getLocText("FR-Designer-Estate_Widget_Value")), formWidgetValuePane}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_DS-Dictionary")), dictionaryEditor}, new Component[]{new UILabel(Inter.getLocText("FR-Designer_FRFont")), fontSizePane}, new Component[]{buttonGroupDictPane, null} }; - double[] rowSize = {p, p, p, p, p, p}; + double[] rowSize = {p, p, p, p, p, p, p}; double[] columnSize = {p, f}; - int[][] rowCount = {{1, 3},{1, 1},{1, 1},{1, 1}}; + int[][] rowCount = {{1, 1}, {1, 3},{1, 1},{1, 1},{1, 1}}; JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); panel.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); advancePane.add(panel, BorderLayout.NORTH);