Browse Source

Merge pull request #1216 in BA/design from ~KERRY/design:release/9.0 to release/9.0

* commit '9da0b84a365c3ca55a6a8497d03f02f2cc8c1f67':
  REPORT-4372 && REPORT-4358 && REPORT-4369 9.0一轮回归问题
master
superman 7 years ago
parent
commit
bb85e51acd
  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.stable.ArrayUtils;
import com.fr.stable.ParameterProvider;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.tree.DefaultMutableTreeNode;
@ -76,7 +77,8 @@ public class ParameterTreeComboBox extends FRTreeComboBox {
if (obj instanceof TreePath) {
return ((Parameter)((ExpandMutableTreeNode)((TreePath)obj).getLastPathComponent()).getUserObject()).getName();
}
return (String)obj;
Object item = this.getEditor().getItem();
return item == null ? StringUtils.EMPTY : item.toString();
}
@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
Utils-Switch_To_Template_Reportlet=\u5207\u6362\u5230\u6A21\u677F\u7F51\u7EDC\u62A5\u8868
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-Designer_Form-CheckBox=\u590D\u9009\u6846
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());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
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;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.Dimension;
import java.awt.Insets;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.util.ArrayList;
@ -45,11 +42,9 @@ public class BaseAccessibleEditor extends BasicPane implements AccessibleEditor
this.decoder = dec;
initComponents();
txtValue.setEditable(dec != null);
setBorderVisible();
}
protected void setBorderVisible(){
((JComponent) txtValue).setBorder(null);
((JComponent) txtValue).setOpaque(true);
((JComponent) txtValue).setBorder(BorderFactory.createLineBorder(Color.lightGray));
((JComponent) txtValue).setBackground(Color.WHITE);
}
@Override

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

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

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

@ -1,7 +1,6 @@
package com.fr.design.widget.component;
import com.fr.design.designer.IntervalConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
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.form.ui.NumberEditor;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
@ -35,10 +35,8 @@ public class NumberEditorValidatePane extends JPanel {
private SpinnerNumberModel minValueModel;
private UISpinner decimalLength;
private JPanel limitNumberPane;
private UITextField maxValueErrorTextField;
private UITextField minValueErrorTextField;
private JPanel maxValueFieldPane;
private JPanel minValueFieldPane;
private UITextField errorMsgTextField;
private JPanel errorMsgTextFieldPane;
private ActionListener allowDecimalsListener;
@ -79,13 +77,10 @@ public class NumberEditorValidatePane extends JPanel {
this.setMinValueCheckBox.addActionListener(setMinListener);
this.minValueSpinner.addChangeListener(minValueChangeListener);
setMinValueCheckBox.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
initMaxMinValueFieldPane();
JPanel maxValueBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
maxValueBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
maxValueBorderPane.add(maxValueFieldPane, 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);
initErrorMsgPane();
JPanel errorMsgBorderPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
errorMsgBorderPane.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, IntervalConstants.INTERVAL_L1, 0));
errorMsgBorderPane.add(errorMsgTextFieldPane, BorderLayout.CENTER);
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.setBorder(BorderFactory.createEmptyBorder(0, IntervalConstants.INTERVAL_L5, 0, 0));
@ -96,37 +91,20 @@ public class NumberEditorValidatePane extends JPanel {
new Component[]{limitNumberPane, null},
new Component[]{allowNegativeCheckBox, null},
new Component[]{setMaxValueCheckBox, maxValueSpinner},
new Component[]{maxValueBorderPane, null},
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};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 10, 7);
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, IntervalConstants.INTERVAL_L2, IntervalConstants.INTERVAL_L1);
this.add(panel);
}
private void initMaxMinValueFieldPane() {
maxValueErrorTextField = new UITextField();
minValueErrorTextField = new UITextField();
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());
}
});
private void initErrorMsgPane() {
errorMsgTextField = 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);
}
@ -257,28 +235,31 @@ public class NumberEditorValidatePane extends JPanel {
allowNegativeCheckBox.setSelected(e.isAllowNegative());
if (e.getMaxValue() == Double.MAX_VALUE) {
setMaxValueCheckBox.setSelected(false);
maxValueFieldPane.setVisible(false);
// maxValueFieldPane.setVisible(false);
maxValueSpinner.setValue(new Double(Double.MAX_VALUE));
maxValueSpinner.setEnabled(false);
} else {
setMaxValueCheckBox.setSelected(true);
maxValueSpinner.setEnabled(true);
maxValueFieldPane.setVisible(true);
maxValueSpinner.setValue(new Double(e.getMaxValue()));
}
if (e.getMinValue() == -Double.MAX_VALUE) {
setMinValueCheckBox.setSelected(false);
minValueFieldPane.setVisible(false);
minValueSpinner.setValue(new Double(-Double.MAX_VALUE));
minValueSpinner.setEnabled(false);
} else {
setMinValueCheckBox.setSelected(true);
minValueFieldPane.setVisible(true);
minValueSpinner.setEnabled(true);
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) {
@ -289,15 +270,22 @@ public class NumberEditorValidatePane extends JPanel {
ob.setAllowNegative(allowNegativeCheckBox.isSelected());
if (setMaxValueCheckBox.isSelected()) {
ob.setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue()));
ob.setMaxValue(Double.parseDouble(StringUtils.EMPTY + maxValueSpinner.getValue()));
} else {
ob.setMaxValue(Double.MAX_VALUE);
}
if (setMinValueCheckBox.isSelected()) {
ob.setMinValue(Double.parseDouble("" + minValueSpinner.getValue()));
ob.setMinValue(Double.parseDouble(StringUtils.EMPTY + minValueSpinner.getValue()));
} else {
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());
}
protected void setBorderVisible(){
this.setBorder(BorderFactory.createLineBorder(Color.lightGray));
}
@Override
protected void showEditorPane() {
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
public void populateBean(Label ob) {
formWidgetValuePane.populate(ob);
isStyleAlignmentWrapText.setSelected(ob.isAutoLine());
isStyleAlignmentWrapText.setSelected(ob.isWrap());
isPageSetupVertically.setSelected(ob.isVerticalCenter());
hAlignmentPane.setSelectedItem(ob.getTextalign());
frFontPane.populateBean(ob.getFont());
@ -93,7 +93,7 @@ public class LabelDefinePane extends AbstractDataModify<Label> {
public Label updateBean() {
Label layout = (Label) creator.toData();
formWidgetValuePane.update(layout);
layout.setAutoLine(isStyleAlignmentWrapText.isSelected());
layout.setWrap(isStyleAlignmentWrapText.isSelected());
layout.setVerticalCenter(isPageSetupVertically.isSelected());
layout.setTextalign((int) hAlignmentPane.getSelectedItem());
layout.setFont(frFontPane.update(layout.getFont()));

Loading…
Cancel
Save