Browse Source

REPORT-14057 10.0日文国际化问题处理=>48 数据列属性面板显示不全

bugfix/10.0
plough 6 years ago
parent
commit
f5352552c9
  1. 7
      designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java
  2. 6
      designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java
  3. 17
      designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java
  4. 30
      designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java
  5. 6
      designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

7
designer-base/src/main/java/com/fr/design/utils/gui/UIComponentUtils.java

@ -7,6 +7,7 @@ import com.fr.stable.StringUtils;
import javax.swing.JComponent; import javax.swing.JComponent;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Dimension;
/** /**
* 包含 UI 组件相关的工具方法 * 包含 UI 组件相关的工具方法
@ -74,4 +75,10 @@ public class UIComponentUtils {
public static JPanel wrapWithBorderLayoutPane(JComponent comp) { public static JPanel wrapWithBorderLayoutPane(JComponent comp) {
return wrapWithBorderLayoutPane(comp, BorderLayout.NORTH); return wrapWithBorderLayoutPane(comp, BorderLayout.NORTH);
} }
public static void setPreferedWidth(JComponent comp, int width) {
Dimension dim = comp.getPreferredSize();
dim.setSize(width, dim.getHeight());
comp.setPreferredSize(dim);
}
} }

6
designer-realize/src/main/java/com/fr/design/dscolumn/ResultSetGroupDockingPane.java

@ -9,6 +9,7 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
import com.fr.report.cell.cellattr.CellExpandAttr; import com.fr.report.cell.cellattr.CellExpandAttr;
import com.fr.report.cell.cellattr.core.group.*; import com.fr.report.cell.cellattr.core.group.*;
@ -58,9 +59,10 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
double f = TableLayout.FILL; double f = TableLayout.FILL;
UILabel dataSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting")); UILabel dataSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Data_Setting"));
dataSetLabel.setPreferredSize(new Dimension(60, 20)); dataSetLabel.setPreferredSize(new Dimension(60, 20));
UIComponentUtils.setLineWrap(dataSetLabel);
Component[][] components = new Component[][] Component[][] components = new Component[][]
{ {
new Component[]{dataSetLabel, goBox}, new Component[]{dataSetLabel, UIComponentUtils.wrapWithBorderLayoutPane(goBox)},
new Component[]{null, cardPane} new Component[]{null, cardPane}
}; };
goBox.addItemListener(new ItemListener() { goBox.addItemListener(new ItemListener() {
@ -85,7 +87,7 @@ public class ResultSetGroupDockingPane extends ResultSetGroupPane {
} }
}); });
double[] columnSize = {p, f}; double[] columnSize = {60, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 8, 10);
} }

17
designer-realize/src/main/java/com/fr/design/dscolumn/SelectedDataColumnPane.java

@ -19,6 +19,7 @@ import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.ElementCasePane; import com.fr.design.mainframe.ElementCasePane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.general.data.TableDataColumn; import com.fr.general.data.TableDataColumn;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -196,16 +197,18 @@ public class SelectedDataColumnPane extends BasicPane {
UILabel dsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData")); UILabel dsLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_TableData"));
UILabel dpLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter")); UILabel dpLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Dynamic_Parameter"));
UILabel dcLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column")); UILabel dcLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Data_Column"));
dsLabel.setPreferredSize(new Dimension(60, 20)); UIComponentUtils.setLineWrap(dsLabel);
dpLabel.setPreferredSize(new Dimension(60, 20)); UIComponentUtils.setLineWrap(dpLabel);
dcLabel.setPreferredSize(new Dimension(60, 20)); UIComponentUtils.setLineWrap(dcLabel);
double[] rowSize = new double[]{p, p, p};
double[] colSize = new double[]{60, f};
Component[][] components = { Component[][] components = {
{dsLabel, tableNameComboBox}, {dsLabel, UIComponentUtils.wrapWithBorderLayoutPane(tableNameComboBox)},
{dpLabel, paramButton}, {dpLabel, UIComponentUtils.wrapWithBorderLayoutPane(paramButton)},
{dcLabel, columnNameComboBox} {dcLabel, UIComponentUtils.wrapWithBorderLayoutPane(columnNameComboBox)}
}; };
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(TableLayoutHelper.createGapTableLayoutPane(components, new double[]{p, p, p}, new double[]{p, f}, 8, 10)); this.add(TableLayoutHelper.createGapTableLayoutPane(components, rowSize, colSize, 8, 10));
} }

30
designer-realize/src/main/java/com/fr/quickeditor/CellQuickEditor.java

@ -17,6 +17,7 @@ import com.fr.design.menu.MenuKeySet;
import com.fr.design.menu.ShortCut; import com.fr.design.menu.ShortCut;
import com.fr.design.selection.QuickEditor; import com.fr.design.selection.QuickEditor;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.grid.selection.CellSelection; import com.fr.grid.selection.CellSelection;
import com.fr.quickeditor.cellquick.layout.CellElementBarLayout; import com.fr.quickeditor.cellquick.layout.CellElementBarLayout;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -46,20 +47,9 @@ import java.util.ArrayList;
*/ */
public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> { public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
protected static final Dimension LABEL_DIMENSION = new Dimension(60, 20);
/**
* 面板配置
*/
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
/**
* 占位label
*/
protected final Dimension LABEL_DIMENSION = new Dimension(60, 20);
protected final UILabel EMPTY_LABEL = new UILabel();
protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3; protected static final int VGAP = 10, HGAP = 8, VGAP_INNER = 3;
/** /**
* 滚动条相关配置 * 滚动条相关配置
*/ */
@ -70,6 +60,15 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private int maxHeight = 280; private int maxHeight = 280;
private static final int TITLE_HEIGHT = 50; private static final int TITLE_HEIGHT = 50;
/**
* 面板配置
*/
protected UITextField columnRowTextField;
protected TemplateCellElement cellElement;
// 占位label
protected final UILabel EMPTY_LABEL = new UILabel();
private UIComboBox comboBox; private UIComboBox comboBox;
private UpdateAction[] cellInsertActions; private UpdateAction[] cellInsertActions;
private int selectedIndex; private int selectedIndex;
@ -207,16 +206,15 @@ public abstract class CellQuickEditor extends QuickEditor<ElementCasePane> {
private JPanel initTopContent() { private JPanel initTopContent() {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {60, f};
double[] rowSize = {p, p}; double[] rowSize = {p, p};
UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell")); UILabel cellLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Cell"));
cellLabel.setPreferredSize(LABEL_DIMENSION);
UILabel insertContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element")); UILabel insertContentLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Insert_Cell_Element"));
insertContentLabel.setPreferredSize(LABEL_DIMENSION); UIComponentUtils.setLineWrap(insertContentLabel);
initCellElementEditComboBox(); initCellElementEditComboBox();
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()}, new Component[]{cellLabel, columnRowTextField = initColumnRowTextField()},
new Component[]{insertContentLabel, comboBox}, new Component[]{insertContentLabel, UIComponentUtils.wrapWithBorderLayoutPane(comboBox)},
}; };
return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
} }

6
designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java

@ -26,8 +26,8 @@ import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.cell.AbstractDSCellEditorPane; import com.fr.design.mainframe.cell.AbstractDSCellEditorPane;
import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.quickeditor.CellQuickEditor; import com.fr.quickeditor.CellQuickEditor;
import com.fr.report.cell.CellElement; import com.fr.report.cell.CellElement;
import com.fr.report.cell.TemplateCellElement; import com.fr.report.cell.TemplateCellElement;
@ -252,7 +252,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
double[] rowSize = {P}, columnSize = {P, F}; double[] rowSize = {P}, columnSize = {P, F};
UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions"));
uiLabel.setPreferredSize(LABEL_DIMENSION); UIComponentUtils.setLineWrap(uiLabel);
condition = new DSColumnConditionAction(); condition = new DSColumnConditionAction();
if (tc != null) { if (tc != null) {
condition.setEditingComponent(tc); condition.setEditingComponent(tc);
@ -262,7 +262,7 @@ public class CellDSColumnEditor extends CellQuickEditor {
condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit"));
conditionUIButton = new UIButton(condition); conditionUIButton = new UIButton(condition);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{uiLabel, conditionUIButton} new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)}
}; };
conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP); conditionPane = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, HGAP, VGAP);
this.createScrollPane(); this.createScrollPane();

Loading…
Cancel
Save