Browse Source

REPORT-3348

master
yaoh.wu 7 years ago
parent
commit
a9863134a5
  1. 23
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  2. 2
      designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java
  3. 16
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java
  4. 2
      designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java
  5. 2
      designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java
  6. 2
      designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java
  7. 2
      designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java
  8. 1
      designer_base/src/com/fr/file/FILEChooserPane.java

23
designer/src/com/fr/quickeditor/CellQuickEditor.java

@ -43,6 +43,15 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
/*面板配置*/ /*面板配置*/
protected UITextField columnRowTextField; protected UITextField columnRowTextField;
protected TemplateCellElement cellElement; protected TemplateCellElement cellElement;
/*占位label*/
protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20);
protected static final UILabel EMPTY_LABEL = new UILabel();
static {
EMPTY_LABEL.setPreferredSize(LABEL_DIMENSION);
}
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
private UIComboBox comboBox; private UIComboBox comboBox;
private UpdateAction[] cellInsertActions; private UpdateAction[] cellInsertActions;
private int selectedIndex; private int selectedIndex;
@ -53,12 +62,6 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private int currentSelectedIndex; private int currentSelectedIndex;
static {
emptyLabel.setPreferredSize(new Dimension(60, 20));
}
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
public CellQuickEditor() { public CellQuickEditor() {
scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) {
@ -117,10 +120,10 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(Inter.getLocText("Cell")); UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell"));
cellLabel.setPreferredSize(new Dimension(60, 20)); cellLabel.setPreferredSize(LABEL_DIMENSION);
UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content")); UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element"));
insertContentLabel.setPreferredSize(new Dimension(60, 20)); insertContentLabel.setPreferredSize(LABEL_DIMENSION);
UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); UIComboBox cellElementEditComboBox = initCellElementEditComboBox();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},

2
designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java

@ -35,7 +35,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor {
}); });
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}}, new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;

16
designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -217,7 +217,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
double[] rowSize = {P}, columnSize = {P, F}; double[] rowSize = {P}, columnSize = {P, F};
UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions")); UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions"));
uiLabel.setPreferredSize(new Dimension(60, 20)); uiLabel.setPreferredSize(LABEL_DIMENSION);
UIButton uiButton = new UIButton(); UIButton uiButton = new UIButton();
if (tc != null) { if (tc != null) {
//第一次初始化时tc为空,会引发NullPointerException //第一次初始化时tc为空,会引发NullPointerException
@ -481,14 +481,13 @@ public class CellDSColumnEditor extends CellQuickEditor {
multiNumSpinner = new UISpinner(1, 10000, 1, 1); multiNumSpinner = new UISpinner(1, 10000, 1, 1);
//数据倍数 //数据倍数
UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple"));
multipleLabel.setPreferredSize(new Dimension(60, 20));
multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{ new Component[]{
multipleLabel, multiNumSpinner multipleLabel, multiNumSpinner
} }
}, new double[]{P}, new double[]{P, F}, HGAP, VGAP }, new double[]{P}, new double[]{P, F}, HGAP, VGAP
); );
multiPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); multiPane.setBorder(BorderFactory.createEmptyBorder(0, 20, 0, 0));
multiNumPane.add(multiPane); multiNumPane.add(multiPane);
useMultiplyNumCheckBox.addActionListener(new ActionListener() { useMultiplyNumCheckBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -563,7 +562,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
centerPane.add(new JPanel(), "none"); centerPane.add(new JPanel(), "none");
centerPane.add(formulaField, "content"); centerPane.add(formulaField, "content");
UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order")); UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order"));
sortLabel.setPreferredSize(new Dimension(60, 20)); sortLabel.setPreferredSize(LABEL_DIMENSION);
sortTypePane.addChangeListener(new ChangeListener() { sortTypePane.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -982,7 +981,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public CustomValuePane() { public CustomValuePane() {
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value")); UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value"));
customValueLabel.setPreferredSize(new Dimension(60, 20)); customValueLabel.setPreferredSize(LABEL_DIMENSION);
formulaField = new JFormulaField(DEFAULT_VALUE); formulaField = new JFormulaField(DEFAULT_VALUE);
this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{customValueLabel, formulaField}, new Component[]{customValueLabel, formulaField},
@ -994,14 +993,13 @@ public class CellDSColumnEditor extends CellQuickEditor {
Object value = cellElement.getValue(); Object value = cellElement.getValue();
if (value != null && value instanceof DSColumn) { if (value != null && value instanceof DSColumn) {
DSColumn dSColumn = (DSColumn) value; DSColumn dSColumn = (DSColumn) value;
//formula //formula
String valueFormula = dSColumn.getResult(); String valueFormula = dSColumn.getResult();
if (valueFormula == null) { if (valueFormula != null) {
valueFormula = DEFAULT_VALUE; formulaField.populate(valueFormula);
} }
formulaField.populateElement(cellElement); formulaField.populateElement(cellElement);
formulaField.populate(valueFormula);
} }
} }
} }

2
designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java

@ -121,7 +121,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor {
content.add(pane, BorderLayout.NORTH); content.add(pane, BorderLayout.NORTH);
return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, content}}, new Component[]{EMPTY_LABEL, content}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP);
} }

2
designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java

@ -43,7 +43,7 @@ public class CellImageQuickEditor extends CellQuickEditor {
}); });
editButton.setOpaque(false); editButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, editButton}}, new Component[]{EMPTY_LABEL, editButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;

2
designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java

@ -30,7 +30,7 @@ public class CellRichTextEditor extends CellQuickEditor {
richTextButton = new UIButton(); richTextButton = new UIButton();
richTextButton.setOpaque(false); richTextButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, richTextButton}}, new Component[]{EMPTY_LABEL, richTextButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;

2
designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java

@ -31,7 +31,7 @@ public class CellSubReportEditor extends CellQuickEditor {
subReportButton = new UIButton(); subReportButton = new UIButton();
subReportButton.setOpaque(false); subReportButton.setOpaque(false);
content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{
new Component[]{emptyLabel, subReportButton}}, new Component[]{EMPTY_LABEL, subReportButton}},
new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED},
new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER);
return content; return content;

1
designer_base/src/com/fr/file/FILEChooserPane.java

@ -475,7 +475,6 @@ public class FILEChooserPane extends BasicPane {
this.type = type; this.type = type;
this.suffix = suffix; this.suffix = suffix;
dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false);
JPanel contentPane = (JPanel) dialog.getContentPane(); JPanel contentPane = (JPanel) dialog.getContentPane();
contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout()); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());

Loading…
Cancel
Save