Browse Source

REPORT-4372 && REPORT-4358 && REPORT-4369 9.0一轮回归问题

master
kerry 7 years ago
parent
commit
917be5028b
  1. 4
      designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java
  2. 2
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  3. 5
      designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java
  4. 13
      designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java
  5. 15
      designer_base/src/com/fr/design/widget/component/DateValuePane.java
  6. 74
      designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java
  7. 4
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java
  8. 4
      designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java

4
designer/src/com/fr/design/widget/ui/ParameterTreeComboBox.java

@ -15,6 +15,7 @@ import com.fr.general.Inter;
import com.fr.script.Calculator; import com.fr.script.Calculator;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.ParameterProvider; import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
@ -76,7 +77,8 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
if (obj instanceof TreePath) { if (obj instanceof TreePath) {
return ((Parameter)((ExpandMutableTreeNode)((TreePath)obj).getLastPathComponent()).getUserObject()).getName(); return ((Parameter)((ExpandMutableTreeNode)((TreePath)obj).getLastPathComponent()).getUserObject()).getName();
} }
return (String)obj; Object item = this.getEditor().getItem();
return item == null ? StringUtils.EMPTY : item.toString();
} }
@Override @Override

2
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -951,7 +951,7 @@ zeroMarginWarn=\u7531\u4E8E\u6253\u5370\u673A\u5B58\u5728\u7269\u7406\u8FB9\u8DD
Widget-Date_Selector_Return_Type=\u8FD4\u56DE\u503C\u7C7B\u578B Widget-Date_Selector_Return_Type=\u8FD4\u56DE\u503C\u7C7B\u578B
Utils-Switch_To_Template_Reportlet=\u5207\u6362\u5230\u6A21\u677F\u7F51\u7EDC\u62A5\u8868 Utils-Switch_To_Template_Reportlet=\u5207\u6362\u5230\u6A21\u677F\u7F51\u7EDC\u62A5\u8868
satisfy=\u6EE1\u8DB3\u6761\u4EF6 satisfy=\u6EE1\u8DB3\u6761\u4EF6
FR-Designer_WidgetDisplyPosition=\u63A7\u4EF6\u663E\u793A\u4F4D\u7F6E FR-Designer_WidgetDisplyPosition=\u663E\u793A\u4F4D\u7F6E
FR-Base_Top=\u4E0A FR-Base_Top=\u4E0A
FR-Designer_Form-CheckBox=\u590D\u9009\u6846 FR-Designer_Form-CheckBox=\u590D\u9009\u6846
Reportlet-Parameter_Type=\u53C2\u6570\u4F20\u9012\u65B9\u5F0F Reportlet-Parameter_Type=\u53C2\u6570\u4F20\u9012\u65B9\u5F0F

5
designer_base/src/com/fr/design/mainframe/widget/accessibles/AccessibleIconEditor.java

@ -27,11 +27,6 @@ public class AccessibleIconEditor extends UneditableAccessibleEditor {
return new RendererField(new IconCellRenderer()); return new RendererField(new IconCellRenderer());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (customIconPane == null) { if (customIconPane == null) {

13
designer_base/src/com/fr/design/mainframe/widget/accessibles/BaseAccessibleEditor.java

@ -1,9 +1,6 @@
package com.fr.design.mainframe.widget.accessibles; package com.fr.design.mainframe.widget.accessibles;
import java.awt.BorderLayout; import java.awt.*;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
@ -45,11 +42,9 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
this.decoder = dec; this.decoder = dec;
initComponents(); initComponents();
txtValue.setEditable(dec != null); txtValue.setEditable(dec != null);
setBorderVisible(); ((JComponent) txtValue).setOpaque(true);
} ((JComponent) txtValue).setBorder(BorderFactory.createLineBorder(Color.lightGray));
((JComponent) txtValue).setBackground(Color.WHITE);
protected void setBorderVisible(){
((JComponent) txtValue).setBorder(null);
} }
@Override @Override

15
designer_base/src/com/fr/design/widget/component/DateValuePane.java

@ -1,11 +1,12 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import com.fr.base.Formula;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.editor.editor.*; import com.fr.design.editor.editor.*;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
@ -17,13 +18,16 @@ import java.awt.*;
public class DateValuePane extends JPanel { public class DateValuePane extends JPanel {
private UIButtonGroup widgetValueHead; private UIButtonGroup widgetValueHead;
private Editor[] editor; private Editor[] editor;
private static final String NONE_EDITOR_NAME = Inter.getLocText("None");
private static final String DATE_EDITOR_NAME = Inter.getLocText("Date");
private static final String FORMULA_EDITOR_NAME = Inter.getLocText("Parameter-Formula");
public DateValuePane() { public DateValuePane() {
editor = new Editor[]{ editor = new Editor[]{
new NoneEditor(null, Inter.getLocText("None")), new NoneEditor(null, NONE_EDITOR_NAME),
new DateEditor(true, Inter.getLocText("Date")), new DateEditor(true, DATE_EDITOR_NAME),
new FormulaEditor(Inter.getLocText("Parameter-Formula")) new FormulaEditor(FORMULA_EDITOR_NAME)
}; };
this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL)); this.setLayout(new BorderLayout(0, LayoutConstants.VGAP_SMALL));
final CardLayout cardLayout = new CardLayout(); final CardLayout cardLayout = new CardLayout();
@ -56,6 +60,9 @@ public class DateValuePane extends JPanel {
int index = widgetValueHead.getSelectedIndex(); int index = widgetValueHead.getSelectedIndex();
Editor e = editor[index]; Editor e = editor[index];
Object value = e.getValue(); Object value = e.getValue();
if(value == null && ComparatorUtils.equals(FORMULA_EDITOR_NAME, e.getName())){
value = new Formula(StringUtils.EMPTY);
}
return value; return value;
} }

74
designer_base/src/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -1,7 +1,6 @@
package com.fr.design.widget.component; package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants; import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
@ -12,6 +11,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
@ -35,10 +35,8 @@ public class NumberEditorValidatePane extends JPanel {
private SpinnerNumberModel minValueModel; private SpinnerNumberModel minValueModel;
private UISpinner decimalLength; private UISpinner decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private UITextField maxValueErrorTextField; private UITextField errorMsgTextField;
private UITextField minValueErrorTextField; private JPanel errorMsgTextFieldPane;
private JPanel maxValueFieldPane;
private JPanel minValueFieldPane;
private ActionListener allowDecimalsListener; private ActionListener allowDecimalsListener;
@ -79,13 +77,10 @@ public class NumberEditorValidatePane extends JPanel {
this.setMinValueCheckBox.addActionListener(setMinListener); this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener); this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
initMaxMinValueFieldPane(); initErrorMsgPane();
JPanel maxValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel errorMsgBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
maxValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); errorMsgBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0));
maxValueBorderPane.add(maxValueFieldPane, BorderLayout.CENTER); errorMsgBorderPane.add(errorMsgTextFieldPane, BorderLayout.CENTER);
JPanel minValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
minValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0));
minValueBorderPane.add(minValueFieldPane, BorderLayout.CENTER);
UILabel numberLabel = new UILabel(Inter.getLocText(new String[]{"FR-Designer_Double", "Numbers"})); 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); limitNumberPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{numberLabel, decimalLength}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
limitNumberPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0)); limitNumberPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
@ -96,37 +91,20 @@ public class NumberEditorValidatePane extends JPanel {
new Component[]{limitNumberPane, null}, new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null}, new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner}, new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{maxValueBorderPane, null},
new Component[]{setMinValueCheckBox, minValueSpinner}, new Component[]{setMinValueCheckBox, minValueSpinner},
new Component[]{minValueBorderPane, null}, new Component[]{errorMsgBorderPane, null},
}; };
double[] rowSize = {p, p, p, p, p, p, p}; double[] rowSize = {p, p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7); JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
this.add(panel); this.add(panel);
} }
private void initMaxMinValueFieldPane() { private void initErrorMsgPane() {
maxValueErrorTextField = new UITextField(); errorMsgTextField = new UITextField();
minValueErrorTextField = new UITextField(); errorMsgTextFieldPane = TableLayoutHelper.createGapTableLayoutPane(
new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), errorMsgTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
maxValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), maxValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
setMaxValueCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
maxValueFieldPane.setVisible(setMaxValueCheckBox.isSelected());
}
});
minValueFieldPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), minValueErrorTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
setMinValueCheckBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
minValueFieldPane.setVisible(setMinValueCheckBox.isSelected());
}
});
} }
@ -257,28 +235,31 @@ public class NumberEditorValidatePane extends JPanel {
allowNegativeCheckBox.setSelected(e.isAllowNegative()); allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) { if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false); setMaxValueCheckBox.setSelected(false);
maxValueFieldPane.setVisible(false); // maxValueFieldPane.setVisible(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE)); maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setEnabled(false); maxValueSpinner.setEnabled(false);
} else { } else {
setMaxValueCheckBox.setSelected(true); setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setEnabled(true); maxValueSpinner.setEnabled(true);
maxValueFieldPane.setVisible(true);
maxValueSpinner.setValue(new Double(e.getMaxValue())); maxValueSpinner.setValue(new Double(e.getMaxValue()));
} }
if (e.getMinValue() == -Double.MAX_VALUE) { if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false); setMinValueCheckBox.setSelected(false);
minValueFieldPane.setVisible(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE)); minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setEnabled(false); minValueSpinner.setEnabled(false);
} else { } else {
setMinValueCheckBox.setSelected(true); setMinValueCheckBox.setSelected(true);
minValueFieldPane.setVisible(true);
minValueSpinner.setEnabled(true); minValueSpinner.setEnabled(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
errorMsgTextField.setText(e.getRegErrorMessage());
if(e.getMaxValue() == Double.MAX_VALUE || e.getMinValue() == -Double.MAX_VALUE){
errorMsgTextFieldPane.setVisible(true);
}else{
errorMsgTextFieldPane.setVisible(false);
}
} }
public void update(NumberEditor ob) { public void update(NumberEditor ob) {
@ -289,15 +270,22 @@ public class NumberEditorValidatePane extends JPanel {
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); ob.setAllowNegative(allowNegativeCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue())); ob.setMaxValue(Double.parseDouble(StringUtils.EMPTY + maxValueSpinner.getValue()));
} else { } else {
ob.setMaxValue(Double.MAX_VALUE); ob.setMaxValue(Double.MAX_VALUE);
} }
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue())); ob.setMinValue(Double.parseDouble(StringUtils.EMPTY + minValueSpinner.getValue()));
} else { } else {
ob.setMinValue(-Double.MAX_VALUE); ob.setMinValue(-Double.MAX_VALUE);
} }
if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){
errorMsgTextFieldPane.setVisible(true);
}else{
errorMsgTextFieldPane.setVisible(false);
errorMsgTextField.setText(StringUtils.EMPTY);
}
ob.setRegErrorMessage(errorMsgTextField.getText());
} }
} }

4
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessibleWLayoutBorderStyleEditor.java

@ -27,10 +27,6 @@ public class AccessibleWLayoutBorderStyleEditor extends UneditableAccessibleEdit
return new RendererField(new LayoutBorderStyleRenderer()); return new RendererField(new LayoutBorderStyleRenderer());
} }
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override @Override
protected void showEditorPane() { protected void showEditorPane() {
if (borderPane == null) { if (borderPane == null) {

4
designer_form/src/com/fr/design/widget/ui/designer/LabelDefinePane.java

@ -82,7 +82,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
@Override @Override
public void populateBean(Label ob) { public void populateBean(Label ob) {
formWidgetValuePane.populate(ob); formWidgetValuePane.populate(ob);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine()); isStyleAlignmentWrapText.setSelected(ob.isWrap());
isPageSetupVertically.setSelected(ob.isVerticalCenter()); isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedItem(ob.getTextalign()); hAlignmentPane.setSelectedItem(ob.getTextalign());
frFontPane.populateBean(ob.getFont()); frFontPane.populateBean(ob.getFont());
@ -93,7 +93,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
public Label updateBean() { public Label updateBean() {
Label layout = (Label) creator.toData(); Label layout = (Label) creator.toData();
formWidgetValuePane.update(layout); formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected()); layout.setWrap(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected()); layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign((int) hAlignmentPane.getSelectedItem()); layout.setTextalign((int) hAlignmentPane.getSelectedItem());
layout.setFont(frFontPane.update(layout.getFont())); layout.setFont(frFontPane.update(layout.getFont()));

Loading…
Cancel
Save