diff --git a/designer/src/com/fr/quickeditor/CellQuickEditor.java b/designer/src/com/fr/quickeditor/CellQuickEditor.java index 6f0530a70f..683f17bc73 100644 --- a/designer/src/com/fr/quickeditor/CellQuickEditor.java +++ b/designer/src/com/fr/quickeditor/CellQuickEditor.java @@ -43,6 +43,15 @@ public abstract class CellQuickEditor extends QuickEditor { /*面板配置*/ protected UITextField columnRowTextField; 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 UpdateAction[] cellInsertActions; private int selectedIndex; @@ -53,12 +62,6 @@ public abstract class CellQuickEditor extends QuickEditor { private int currentSelectedIndex; - static { - emptyLabel.setPreferredSize(new Dimension(60, 20)); - } - - protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; - public CellQuickEditor() { scrollBar = new UIScrollBar(UIScrollBar.VERTICAL) { @@ -117,10 +120,10 @@ public abstract class CellQuickEditor extends QuickEditor { double f = TableLayout.FILL; double[] columnSize = {p, f}; double[] rowSize = {p, p}; - UILabel cellLabel = new UILabel(Inter.getLocText("Cell")); - cellLabel.setPreferredSize(new Dimension(60, 20)); - UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content")); - insertContentLabel.setPreferredSize(new Dimension(60, 20)); + UILabel cellLabel = new UILabel(Inter.getLocText("FR-Designer_Cell")); + cellLabel.setPreferredSize(LABEL_DIMENSION); + UILabel insertContentLabel = new UILabel(Inter.getLocText("FR-Designer_Insert_Cell_Element")); + insertContentLabel.setPreferredSize(LABEL_DIMENSION); UIComboBox cellElementEditComboBox = initCellElementEditComboBox(); Component[][] components = new Component[][]{ new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, diff --git a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java index c17ac86784..d5d8e1f800 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellBiasTextPainterEditor.java @@ -35,7 +35,7 @@ public class CellBiasTextPainterEditor extends CellQuickEditor { }); editButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, editButton}}, + new Component[]{EMPTY_LABEL, editButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index 2c1a30c116..d7c6ddbd47 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -217,7 +217,7 @@ public class CellDSColumnEditor extends CellQuickEditor { double[] rowSize = {P}, columnSize = {P, F}; UILabel uiLabel = new UILabel(Inter.getLocText("FR-Designer_Filter_Conditions")); - uiLabel.setPreferredSize(new Dimension(60, 20)); + uiLabel.setPreferredSize(LABEL_DIMENSION); UIButton uiButton = new UIButton(); if (tc != null) { //第一次初始化时tc为空,会引发NullPointerException @@ -481,14 +481,13 @@ public class CellDSColumnEditor extends CellQuickEditor { multiNumSpinner = new UISpinner(1, 10000, 1, 1); //数据倍数 UILabel multipleLabel = new UILabel(Inter.getLocText("Column_Multiple")); - multipleLabel.setPreferredSize(new Dimension(60, 20)); multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{ multipleLabel, multiNumSpinner } }, 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); useMultiplyNumCheckBox.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { @@ -563,7 +562,7 @@ public class CellDSColumnEditor extends CellQuickEditor { centerPane.add(new JPanel(), "none"); centerPane.add(formulaField, "content"); UILabel sortLabel = new UILabel(Inter.getLocText("Sort-Sort_Order")); - sortLabel.setPreferredSize(new Dimension(60, 20)); + sortLabel.setPreferredSize(LABEL_DIMENSION); sortTypePane.addChangeListener(new ChangeListener() { @Override public void stateChanged(ChangeEvent e) { @@ -982,7 +981,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public CustomValuePane() { this.setLayout(new BorderLayout()); 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); this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{customValueLabel, formulaField}, @@ -994,14 +993,13 @@ public class CellDSColumnEditor extends CellQuickEditor { Object value = cellElement.getValue(); if (value != null && value instanceof DSColumn) { DSColumn dSColumn = (DSColumn) value; - //formula String valueFormula = dSColumn.getResult(); - if (valueFormula == null) { - valueFormula = DEFAULT_VALUE; + if (valueFormula != null) { + formulaField.populate(valueFormula); } formulaField.populateElement(cellElement); - formulaField.populate(valueFormula); + } } } diff --git a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java index fcd16a6765..7429b146eb 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellFormulaQuickEditor.java @@ -121,7 +121,7 @@ public class CellFormulaQuickEditor extends CellQuickEditor { content.add(pane, BorderLayout.NORTH); return TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, content}}, + new Component[]{EMPTY_LABEL, content}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP); } diff --git a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java index 51b7417ac5..25818e79f3 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellImageQuickEditor.java @@ -43,7 +43,7 @@ public class CellImageQuickEditor extends CellQuickEditor { }); editButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, editButton}}, + new Component[]{EMPTY_LABEL, editButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java index 8f8afbeed2..75ef442dae 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellRichTextEditor.java @@ -30,7 +30,7 @@ public class CellRichTextEditor extends CellQuickEditor { richTextButton = new UIButton(); richTextButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, richTextButton}}, + new Component[]{EMPTY_LABEL, richTextButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java index e28bdbf395..70d8c51ea1 100644 --- a/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java +++ b/designer/src/com/fr/quickeditor/cellquick/CellSubReportEditor.java @@ -31,7 +31,7 @@ public class CellSubReportEditor extends CellQuickEditor { subReportButton = new UIButton(); subReportButton.setOpaque(false); content.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ - new Component[]{emptyLabel, subReportButton}}, + new Component[]{EMPTY_LABEL, subReportButton}}, new double[]{TableLayout.PREFERRED}, new double[]{TableLayout.PREFERRED, TableLayout.FILL}, HGAP, VGAP), BorderLayout.CENTER); return content; diff --git a/designer_base/src/com/fr/file/FILEChooserPane.java b/designer_base/src/com/fr/file/FILEChooserPane.java index 02c92f646b..09e9114216 100644 --- a/designer_base/src/com/fr/file/FILEChooserPane.java +++ b/designer_base/src/com/fr/file/FILEChooserPane.java @@ -475,7 +475,6 @@ public class FILEChooserPane extends BasicPane { this.type = type; this.suffix = suffix; - dialog = showWindow(parent instanceof DesignerFrame ? (Window) parent : SwingUtilities.getWindowAncestor(parent), false); JPanel contentPane = (JPanel) dialog.getContentPane(); contentPane.setLayout(FRGUIPaneFactory.createM_BorderLayout());