From 5e4ad9b890d2211a35bb6ef3957658f33446ce0b Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 24 Sep 2020 17:10:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-40613=20=E3=80=90=E4=BA=8C=E8=BD=AE?= =?UTF-8?q?=E5=9B=9E=E5=BD=92=E3=80=91=E6=95=B0=E6=8D=AE=E5=88=97=E5=8F=B3?= =?UTF-8?q?=E4=BE=A7=E5=B1=9E=E6=80=A7=E9=9D=A2=E6=9D=BF=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E8=BE=83=E9=95=BF=20=E3=80=90=E9=97=AE=E9=A2=98=E5=8E=9F?= =?UTF-8?q?=E5=9B=A0=E3=80=91=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE=E6=AF=94?= =?UTF-8?q?=E8=BE=83=E9=95=BF=E6=98=AF=E5=9B=A0=E4=B8=BA=E5=89=8D=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E8=BF=87=E6=BB=A4=E6=9D=A1=E4=BB=B6=E8=BF=99=E4=B8=AA?= =?UTF-8?q?Label=E7=9A=84=E5=AE=BD=E5=BA=A6=E6=98=AFTableLayout.PREFERRED?= =?UTF-8?q?=EF=BC=8C=E8=80=8C=E4=B8=8A=E9=9D=A2=E9=82=A3=E4=BA=9BLabel?= =?UTF-8?q?=E7=9A=84=E5=AE=BD=E5=BA=A6=E6=98=AF=E5=AE=9A=E5=80=BC60?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E6=98=BE=E7=A4=BA=E8=B5=B7=E6=9D=A5?= =?UTF-8?q?=E5=8F=B3=E8=BE=B9=E7=9A=84=E7=BC=96=E8=BE=91=E6=8C=89=E9=92=AE?= =?UTF-8?q?=E5=AE=BD=E5=BA=A6=E6=B2=A1=E6=9C=89=E4=B8=8E=E4=B8=8A=E9=9D=A2?= =?UTF-8?q?=E7=9A=84=E4=BF=9D=E6=8C=81=E4=B8=80=E8=87=B4=20=E3=80=90?= =?UTF-8?q?=E6=94=B9=E5=8A=A8=E6=80=9D=E8=B7=AF=E3=80=91=E5=B0=86=E7=BC=96?= =?UTF-8?q?=E8=BE=91=E6=8C=89=E9=92=AE=E5=B7=A6=E4=BE=A7=E7=9A=84=E8=BF=87?= =?UTF-8?q?=E6=BB=A4=E6=9D=A1=E4=BB=B6Label=E7=9A=84=E5=AE=BD=E5=BA=A6?= =?UTF-8?q?=E4=B9=9F=E4=BF=AE=E6=94=B9=E4=B8=BA=E5=AE=9A=E5=80=BC60?= =?UTF-8?q?=EF=BC=8C=E5=8F=A6=E5=A4=96=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9BToolKit=E7=9A=84=E5=AF=BC=E5=8C=85=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cellquick/CellDSColumnEditor.java | 53 ++++++++++--------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java index fb80e8891..cfc0e9adb 100644 --- a/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java +++ b/designer-realize/src/main/java/com/fr/quickeditor/cellquick/CellDSColumnEditor.java @@ -22,6 +22,7 @@ import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.itextfield.UITextField; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -251,15 +252,15 @@ public class CellDSColumnEditor extends CellQuickEditor { dataPane.setListener(dataListener); groupPane.setListener(groupListener); - double[] rowSize = {P}, columnSize = {P, F}; - UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); + double[] rowSize = {P}, columnSize = {60, F}; + UILabel uiLabel = FRWidgetFactory.createLineWrapLabel(Toolkit.i18nText("Fine-Design_Report_Filter_Conditions")); condition = new DSColumnConditionAction(); if (tc != null) { condition.setEditingComponent(tc); } //丢掉icon,修改按钮名称为编辑 condition.setSmallIcon(null); - condition.setName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Edit")); + condition.setName(Toolkit.i18nText("Fine-Design_Basic_Edit")); conditionUIButton = new UIButton(condition); Component[][] components = new Component[][]{ new Component[]{uiLabel, UIComponentUtils.wrapWithBorderLayoutPane(conditionUIButton)} @@ -273,12 +274,12 @@ public class CellDSColumnEditor extends CellQuickEditor { @Override public String getIconPath() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Basic"); + return Toolkit.i18nText("Fine-Design_Report_Basic"); } @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("FR-Designer_Basic"); + return Toolkit.i18nText("FR-Designer_Basic"); } @@ -441,12 +442,12 @@ public class CellDSColumnEditor extends CellQuickEditor { @Override public String getIconPath() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"); + return Toolkit.i18nText("Fine-Design_Report_Advanced"); } @Override public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Advanced"); + return Toolkit.i18nText("Fine-Design_Report_Advanced"); } @@ -570,19 +571,19 @@ public class CellDSColumnEditor extends CellQuickEditor { //可扩展性 JPanel extendableDirectionPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); - extendableDirectionPane.add(heCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); - extendableDirectionPane.add(veCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); + extendableDirectionPane.add(heCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Horizontal_Extendable"))); + extendableDirectionPane.add(veCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_ExpandD_Vertical_Extendable"))); //补充空白数据 JPanel multiNumPane = FRGUIPaneFactory.createYBoxEmptyBorderPane(); - useMultiNumCheckBox = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); + useMultiNumCheckBox = new UICheckBox(Toolkit.i18nText("Fine-Design_Report_Fill_Blank_Data")); JPanel checkBoxPane = new JPanel(new BorderLayout()); checkBoxPane.add(useMultiNumCheckBox, BorderLayout.WEST); multiNumPane.add(checkBoxPane); multiNumSpinner = new UISpinner(1, 10000, 1, 1); //数据倍数 - UILabel multipleLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); + UILabel multipleLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Column_Multiple")); multiPane = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ new Component[]{ multipleLabel, multiNumSpinner @@ -659,17 +660,17 @@ public class CellDSColumnEditor extends CellQuickEditor { IOUtils.readIcon("/com/fr/design/images/expand/asc.png"), IOUtils.readIcon("/com/fr/design/images/expand/des.png") }; - String[] nameArray = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Original"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Ascending"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Descending")}; + String[] nameArray = {Toolkit.i18nText("Fine-Design_Report_Sort_Original"), Toolkit.i18nText("Fine-Design_Report_Sort_Ascending"), Toolkit.i18nText("Fine-Design_Report_Sort_Descending")}; sortTypePane = new UIButtonGroup(iconArray); sortTypePane.setAllToolTips(nameArray); - sortTypePane.setGlobalName(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand")); + sortTypePane.setGlobalName(Toolkit.i18nText("Fine-Design_Basic_ExpandD_Sort_After_Expand")); cardLayout = new CardLayout(); centerPane = new JPanel(cardLayout); formulaField = new JFormulaField(DEFAULT_VALUE); centerPane.add(new JPanel(), "none"); centerPane.add(formulaField, "content"); - UILabel sortLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order")); + UILabel sortLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Sort_Sort_Order")); sortLabel.setPreferredSize(LABEL_DIMENSION); sortTypePane.addChangeListener(new ChangeListener() { @Override @@ -849,15 +850,15 @@ public class CellDSColumnEditor extends CellQuickEditor { public ResultSetFilterConfigPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); - UILabel filterLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter")); + UILabel filterLabel = new UILabel(Toolkit.i18nText("Fine-Design_Report_Bind_Column_Results_Filter")); //结果集筛选下拉框 rsComboBox = new UIComboBox(new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Undefined"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Odd"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Even"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Specify") + Toolkit.i18nText("Fine-Design_Report_Undefined"), + Toolkit.i18nText("Fine-Design_Report_Bind_Column_Top_N"), + Toolkit.i18nText("Fine-Design_Report_Bind_Column_Bottom_N"), + Toolkit.i18nText("Fine-Design_Report_Odd"), + Toolkit.i18nText("Fine-Design_Report_Even"), + Toolkit.i18nText("Fine-Design_Report_Specify") }); rsComboBox.addActionListener(actionListener); //配置展示CardLayout @@ -881,20 +882,20 @@ public class CellDSColumnEditor extends CellQuickEditor { //奇数 UILabel 占一行作为提示信息 setCardPane.add(new JPanel(), ODD.name()); - MultilineLabel oddTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); + MultilineLabel oddTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Odd_Tip")); oddTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(oddTip, ODD.name()); //偶数 UILabel 占一行作为提示信息 setCardPane.add(new JPanel(), EVEN.name()); - MultilineLabel evenTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); + MultilineLabel evenTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Even_Tip")); evenTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(evenTip, EVEN.name()); //输入框占用右半边,提示信息占一行 serialTextField = new UITextField(16); setCardPane.add(serialTextField, SPECIFY.name()); - MultilineLabel specifyTip = new MultilineLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); + MultilineLabel specifyTip = new MultilineLabel(Toolkit.i18nText("Fine-Design_Report_DS_Filter_Specify_Tip")); specifyTip.setForeground(TIP_FONT_COLOR); tipCardPane.add(specifyTip, SPECIFY.name()); contentPane = TableLayoutHelper.createDiffVGapTableLayoutPane(new Component[][]{ @@ -1072,7 +1073,7 @@ public class CellDSColumnEditor extends CellQuickEditor { textFieldPane.add(formulaTextField, BorderLayout.CENTER); textFieldPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 5)); UIButton formulaButton = new UIButton(IOUtils.readIcon("/com/fr/design/images/m_insert/formula.png")); - formulaButton.setToolTipText(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); + formulaButton.setToolTipText(Toolkit.i18nText("Fine-Design_Report_Formula") + "..."); formulaButton.setPreferredSize(new Dimension(20, formulaTextField.getPreferredSize().height)); formulaButton.addActionListener(formulaButtonActionListener); @@ -1157,7 +1158,7 @@ public class CellDSColumnEditor extends CellQuickEditor { public CustomValuePane() { this.setLayout(new BorderLayout()); - UILabel customValueLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Display_Value")); + UILabel customValueLabel = new UILabel(Toolkit.i18nText("Fine-Design_Basic_Display_Value")); customValueLabel.setPreferredSize(LABEL_DIMENSION); formulaField = new JFormulaField(DEFAULT_VALUE); this.add(TableLayoutHelper.createGapTableLayoutPane(new Component[][]{ From cc2fa9218f2e7d57efc68bed04be779729b19b35 Mon Sep 17 00:00:00 2001 From: hades Date: Thu, 24 Sep 2020 20:47:32 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-34955=20linux=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E9=80=89=E4=B8=AD=E6=9F=90=E4=B8=AA=E5=AD=97=E4=BD=93?= =?UTF-8?q?=E5=90=8E=20=E5=88=87=E6=8D=A2=E5=8D=95=E5=85=83=E6=A0=BC?= =?UTF-8?q?=E5=90=8E=E5=AD=97=E4=BD=93=E6=9C=AA=E9=87=8D=E6=96=B0=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E6=9C=AA=E9=BB=98=E8=AE=A4=E5=AD=97=E4=BD=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../actions/cell/style/ReportFontNameAction.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java index 1acf4a404..5023e6f4f 100644 --- a/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java +++ b/designer-realize/src/main/java/com/fr/design/actions/cell/style/ReportFontNameAction.java @@ -3,6 +3,7 @@ */ package com.fr.design.actions.cell.style; +import com.fr.stable.os.OperatingSystem; import java.awt.Dimension; import javax.swing.ComboBoxModel; @@ -49,6 +50,7 @@ public class ReportFontNameAction extends AbstractStyleAction { public void setFontName(String fontName) { Object object = this.getValue(UIComboBox.class.getName()); + boolean find = false; if (object != null && object instanceof UIComboBox) { UIComboBox comboBox = (UIComboBox) object; ComboBoxModel comboBoxModel = comboBox.getModel(); @@ -60,9 +62,17 @@ public class ReportFontNameAction extends AbstractStyleAction { comboBox.removeActionListener(this); comboBox.setSelectedIndex(i); comboBox.addActionListener(this); + find = true; break; } } + // linux设计器下面 找不到默认就是第一个字体 + boolean access = OperatingSystem.isLinux() && !find && comboBoxModel.getSize() > 0; + if (access) { + comboBox.removeActionListener(this); + comboBox.setSelectedIndex(0); + comboBox.addActionListener(this); + } } }