Browse Source

REPORT-3348 国际化,table layout对齐

master
yaoh.wu 7 years ago
parent
commit
51dceb315f
  1. 5
      designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  2. 16
      designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java
  3. 19
      designer/src/com/fr/quickeditor/CellQuickEditor.java
  4. 20
      designer/src/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

5
designer/src/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -56,10 +56,11 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
private JPanel layoutPane() { private JPanel layoutPane() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
UILabel dataSetLabel = new UILabel(Inter.getLocText("Data_Setting"));
dataSetLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = new Component[][] Component[][] components = new Component[][]
{ {
new Component[]{new UILabel(Inter.getLocText("Data_Setting")), goBox}, new Component[]{dataSetLabel, goBox},
new Component[]{null, cardPane} new Component[]{null, cardPane}
}; };
goBox.addItemListener(new ItemListener() { goBox.addItemListener(new ItemListener() {

16
designer/src/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -132,14 +132,16 @@ public class SelectedDataColumnPane extends BasicPane {
columnNameComboBox.setEditable(true); columnNameComboBox.setEditable(true);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
UILabel label1 = new UILabel(Inter.getLocText("TableData") + " "); UILabel dsLabel = new UILabel(Inter.getLocText("TableData"));
UILabel label2 = new UILabel(Inter.getLocText("FR-Designer_Dynamic_Parameter")); UILabel dpLabel = new UILabel(Inter.getLocText("FR-Designer_Dynamic_Parameter"));
UILabel label3 = new UILabel(Inter.getLocText("DataColumn") + " "); UILabel dcLabel = new UILabel(Inter.getLocText("DataColumn"));
tableNameComboBox.setPreferredSize(new Dimension(163, 20)); dsLabel.setPreferredSize(new Dimension(60, 20));
dpLabel.setPreferredSize(new Dimension(60, 20));
dcLabel.setPreferredSize(new Dimension(60, 20));
Component[][] components = { Component[][] components = {
{label1, tableNameComboBox}, {dsLabel, tableNameComboBox},
{label2, paramButton}, {dpLabel, paramButton},
{label3, columnNameComboBox} {dcLabel, columnNameComboBox}
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f})); this.add(TableLayoutHelper.createTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}));

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

@ -1,6 +1,5 @@
package com.fr.quickeditor; package com.fr.quickeditor;
import com.fr.base.BaseUtils;
import com.fr.design.actions.utils.DeprecatedActionManager; import com.fr.design.actions.utils.DeprecatedActionManager;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -11,6 +10,7 @@ import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -24,13 +24,13 @@ import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
/** /**
* @author zhou * @author zhou, yaoh.wu
* @since 2012-7-23下午5:16:53 * @version 2017年8月7日16点54分
* @since 1.0
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected UITextField columnRowTextField; protected UITextField columnRowTextField;
private UIButton cellElementEditButton;
protected TemplateCellElement cellElement; protected TemplateCellElement cellElement;
public CellQuickEditor() { public CellQuickEditor() {
@ -54,9 +54,14 @@ 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"));
cellLabel.setPreferredSize(new Dimension(60, 20));
UILabel insertContentLabel = new UILabel(Inter.getLocText("HF-Insert_Content"));
insertContentLabel.setPreferredSize(new Dimension(60, 20));
UIButton cellElementEditButton = initCellElementEditButton();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Cell") + " "), columnRowTextField = initColumnRowTextField()}, new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{new UILabel(Inter.getLocText("HF-Insert_Content") + " "), cellElementEditButton = initCellElementEditButton()}, new Component[]{insertContentLabel, cellElementEditButton},
}; };
JPanel topContent = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel topContent = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15)); topContent.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
@ -71,7 +76,7 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
* @return UIButton * @return UIButton
*/ */
private UIButton initCellElementEditButton() { private UIButton initCellElementEditButton() {
final UIButton cellElementEditButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/add.png")); final UIButton cellElementEditButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/buttonicon/add.png"));
cellElementEditButton.addMouseListener(new MouseAdapter() { cellElementEditButton.addMouseListener(new MouseAdapter() {
@Override @Override

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

@ -218,6 +218,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));
UIButton uiButton = new UIButton(); UIButton uiButton = new UIButton();
if (tc != null) { if (tc != null) {
//第一次初始化时tc为空,引发NullPointerException //第一次初始化时tc为空,引发NullPointerException
@ -538,7 +539,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public ResultSetSortConfigPane() { public ResultSetSortConfigPane() {
this.setLayout(new BorderLayout(0, 0)); this.setLayout(new BorderLayout());
Icon[] iconArray = { Icon[] iconArray = {
IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"), IOUtils.readIcon("/com/fr/design/images/expand/none16x16.png"),
IOUtils.readIcon("/com/fr/design/images/expand/asc.png"), IOUtils.readIcon("/com/fr/design/images/expand/asc.png"),
@ -555,6 +556,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
centerPane.add(new JPanel(), "none"); centerPane.add(new JPanel(), "none");
centerPane.add(tinyFormulaPane, "content"); centerPane.add(tinyFormulaPane, "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));
sortTypePane.addChangeListener(new ChangeListener() { sortTypePane.addChangeListener(new ChangeListener() {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
@ -649,7 +651,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
public ResultSetFilterConfigPane() { public ResultSetFilterConfigPane() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
UILabel filterLabel = new UILabel("结果集筛选"); UILabel filterLabel = new UILabel(Inter.getLocText("BindColumn-Results_Filter"));
//结果集筛选下拉框 //结果集筛选下拉框
rsComboBox = new UIComboBox(new String[]{ rsComboBox = new UIComboBox(new String[]{
Inter.getLocText("Undefined"), Inter.getLocText("Undefined"),
@ -697,12 +699,12 @@ public class CellDSColumnEditor extends CellQuickEditor {
tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); tipCardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
//前N个 //前N个
topFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("="); topFormulaPane = new JFormulaField("=");
setCardPane.add(topFormulaPane, FilterType.TOP.name()); setCardPane.add(topFormulaPane, FilterType.TOP.name());
tipCardPane.add(new JPanel(), FilterType.TOP.name()); tipCardPane.add(new JPanel(), FilterType.TOP.name());
//后N个 //后N个
bottomFormulaPane = new DSColumnAdvancedEditorPane.JFormulaField("="); bottomFormulaPane = new JFormulaField("=");
setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name()); setCardPane.add(bottomFormulaPane, FilterType.BOTTOM.name());
tipCardPane.add(new JPanel(), FilterType.BOTTOM.name()); tipCardPane.add(new JPanel(), FilterType.BOTTOM.name());
@ -829,7 +831,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
Component[] buttonComponent = new Component[]{ Component[] buttonComponent = new Component[]{
formulaButton formulaButton
}; };
JPanel pane = new JPanel(new BorderLayout(0, 0)); JPanel pane = new JPanel(new BorderLayout());
pane.add(formulaTextField, BorderLayout.CENTER); pane.add(formulaTextField, BorderLayout.CENTER);
pane.add(GUICoreUtils.createFlowPane(buttonComponent, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); pane.add(GUICoreUtils.createFlowPane(buttonComponent, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -903,12 +905,12 @@ public class CellDSColumnEditor extends CellQuickEditor {
private JFormulaField formulaField; private JFormulaField formulaField;
public CustomValuePane() { public CustomValuePane() {
this.setLayout(FRGUIPaneFactory.createBoxFlowLayout()); this.setLayout(new BorderLayout());
UILabel customValueLabel = new UILabel("显示值"); UILabel customValueLabel = new UILabel(Inter.getLocText("FR-Designer_Display_Value"));
customValueLabel.setPreferredSize(new Dimension(60, 20));
formulaField = new JFormulaField("$$$"); formulaField = new JFormulaField("$$$");
formulaField.setPreferredSize(new Dimension(159, 20));
this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{ this.add(TableLayoutHelper.createTableLayoutPane(new Component[][]{
{customValueLabel, formulaField}, new Component[]{customValueLabel, formulaField},
}, new double[]{P}, new double[]{P, F}), BorderLayout.CENTER); }, new double[]{P}, new double[]{P, F}), BorderLayout.CENTER);
} }

Loading…
Cancel
Save