From 52175cdf485c5f1e961e862c020a5c31a7f6f163 Mon Sep 17 00:00:00 2001 From: Yvan Date: Thu, 13 Aug 2020 19:29:04 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-37398=20=E9=9D=9E=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E8=AE=BE=E8=AE=A1=E5=99=A8-=E8=8B=B1=E6=96=87=E4=B8=8B?= =?UTF-8?q?=EF=BC=8C=E6=8A=A5=E8=A1=A8=E5=88=86=E6=A0=8F=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=20=E4=B8=BB=E8=A6=81=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=9A=201.=20bug=E5=8E=9F=E5=9B=A0=E6=98=AF=E8=8B=B1?= =?UTF-8?q?=E6=96=87=E7=8E=AF=E5=A2=83=E4=B8=8B=E4=B8=80=E8=A1=8C=E6=94=BE?= =?UTF-8?q?=E4=B8=8D=E4=B8=8B=E5=A4=AA=E5=A4=9A=E7=BB=84=E4=BB=B6=EF=BC=8C?= =?UTF-8?q?=E6=89=80=E4=BB=A5=E8=A2=AB=E6=8C=A4=E6=8E=89=E4=BA=86=EF=BC=8C?= =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8A=9E=E6=B3=95=E6=98=AF=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=88=A4=E6=96=AD=EF=BC=8C=E5=BD=93=E7=B3=BB=E7=BB=9F=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E6=98=AF=E8=8B=B1=E6=96=87=EF=BC=8C=E5=B0=B1=E5=A2=9E?= =?UTF-8?q?=E5=A4=A7=E7=95=8C=E9=9D=A2=E7=9A=84=E9=AB=98=E5=BA=A6=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=B0=86=E7=BB=84=E4=BB=B6=E6=8C=89=E7=85=A7=E9=9C=80?= =?UTF-8?q?=E6=B1=82=E5=88=86=E5=9D=97=EF=BC=8C=E5=88=86=E5=88=AB=E7=94=A8?= =?UTF-8?q?JPanel=E8=A3=85=E8=B5=B7=E6=9D=A5=EF=BC=8C=E8=BF=99=E6=A0=B7?= =?UTF-8?q?=E5=BD=93=E7=AC=AC=E4=BA=8C=E4=B8=AAJPanel=E6=94=BE=E4=B8=8D?= =?UTF-8?q?=E4=B8=8B=E5=B0=B1=E4=BC=9A=E8=87=AA=E5=8A=A8=E6=8D=A2=E8=A1=8C?= =?UTF-8?q?=EF=BC=8C=E4=B8=8D=E4=BC=9A=E5=87=BA=E7=8E=B0=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=A8=E7=9A=84=E9=97=AE=E9=A2=98=202.=20=E7=94=B1?= =?UTF-8?q?=E4=BA=8E=E5=B0=86=E7=BB=84=E4=BB=B6=E5=88=86=E5=9D=97=E4=BA=86?= =?UTF-8?q?=EF=BC=8C=E6=89=80=E4=BB=A5=E5=85=B6=E4=BB=96=E8=AF=AD=E8=A8=80?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E4=B8=8B=EF=BC=8C=E7=95=8C=E9=9D=A2=E7=9A=84?= =?UTF-8?q?=E9=AB=98=E5=BA=A6=E4=B9=9F=E9=9C=80=E8=A6=81=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E5=BE=AE=E8=B0=83=203.=20=E4=BF=AE=E6=94=B9=E4=BA=86=E4=B8=80?= =?UTF-8?q?=E4=BA=9B=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/mainframe/JWorkBook.java | 11 --- .../mainframe/ReportComponentComposite.java | 2 - .../fr/design/report/ReportColumnsPane.java | 79 +++++++++++-------- 3 files changed, 47 insertions(+), 45 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java index a43623bd7..b68833f83 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/JWorkBook.java @@ -1206,15 +1206,4 @@ public class JWorkBook extends JTemplate { super.whenClose(); reportComposite.doRemoveAction(); } - - /** - * 更新滚动条的值(主要是为了重置滚动条里的BoundedRangeModel的extent值),使滚动条的宽度随着界面缩放而变化 - */ - protected void updateScrollValue() { - ElementCasePane elementCasePane = reportComposite.centerCardPane.editingComponet.elementCasePane; - DynamicScrollBar verticalScrollBar = (DynamicScrollBar) elementCasePane.getVerticalScrollBar(); - DynamicScrollBar horizontalScrollBar = (DynamicScrollBar) elementCasePane.getHorizontalScrollBar(); - verticalScrollBar.setValue(verticalScrollBar.getValue()); - horizontalScrollBar.setValue(horizontalScrollBar.getValue()); - } } diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java index 6c527e0f8..0299899a0 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ReportComponentComposite.java @@ -88,8 +88,6 @@ public class ReportComponentComposite extends JComponent implements RemoveListen value = value < MIN ? MIN : value; int resolution = (int) (ScreenResolution.getScreenResolution() * value / HUND); HistoryTemplateListPane.getInstance().getCurrentEditingTemplate().setScale(resolution); - //更新滚动条值,使之随着界面缩放 - parent.updateScrollValue(); } }; diff --git a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java index 4062e0dbe..3d36ecd06 100644 --- a/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java +++ b/designer-realize/src/main/java/com/fr/design/report/ReportColumnsPane.java @@ -14,6 +14,7 @@ import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.general.FRFont; +import com.fr.general.GeneralContext; import com.fr.general.IOUtils; import com.fr.report.stable.WorkSheetAttr; import com.fr.report.worksheet.WorkSheet; @@ -41,6 +42,7 @@ import java.awt.event.ActionListener; public class ReportColumnsPane extends BasicPane{ public static final int ROW = 0; public static final int COLUMN = 1; + private static final String LOCALE_LANGUAGE_EN = "en"; private int rowOrColumn; private boolean isRepeate; @@ -58,7 +60,7 @@ public class ReportColumnsPane extends BasicPane{ com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Row"), com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Columns_Repeat_Column") }; - + private static final String FONT_NAME = "simsun"; private static final int FONT_SIZE = 14; @@ -87,6 +89,7 @@ public class ReportColumnsPane extends BasicPane{ this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel north = new JPanel(new BorderLayout()) { + @Override public void paint(Graphics g) { super.paint(g); super.paintBorder(g); @@ -122,7 +125,7 @@ public class ReportColumnsPane extends BasicPane{ this.add(north, BorderLayout.NORTH); this.add(createRowColumnPane(), BorderLayout.CENTER); } - + private ActionListener onOffListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -220,7 +223,7 @@ public class ReportColumnsPane extends BasicPane{ sampleLablePane.add(cPane); return sampleLablePane; } - + private ActionListener rowChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -233,7 +236,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener colChangeListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -275,7 +278,7 @@ public class ReportColumnsPane extends BasicPane{ RowMaxOrSetPane.add(setRowRadioPane); return RowMaxOrSetPane; } - + private ActionListener toXBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -288,7 +291,7 @@ public class ReportColumnsPane extends BasicPane{ } } }; - + private ActionListener maxBtnListener = new ActionListener() { @Override public void actionPerformed(ActionEvent e) { @@ -310,27 +313,39 @@ public class ReportColumnsPane extends BasicPane{ UITitledBorder explainBorder = UITitledBorder.createBorderWithTitle(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Area")); rowPane.setBorder(explainBorder); rowPane.setLayout(new FlowLayout(FlowLayout.LEFT, 5,13)); - rowPane.setPreferredSize(new Dimension(500,80)); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); + // Yvan: REPORT-37398 判断设计器语言是否为英文 + if (StringUtils.equals(GeneralContext.getLocale().getLanguage(), LOCALE_LANGUAGE_EN)) { + // 如果是英文,需要为这个panel设置更大的height,否则显示不全 + rowPane.setPreferredSize(new Dimension(500,135)); + } else { + // 其它语言环境下也需要将height调高一点点,因为后面将组件分块了,如果不调整height会造成上下间距不等 + rowPane.setPreferredSize(new Dimension(500,90)); + } + // 将组件分成两块,分别装在各自的JPanel中,然后把两个JPanel添加到rowPane中,第二个JPanel放不下时会自动换行 + // 左边的JPanel:分栏数据 + JPanel multiData = new JPanel(); + multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Column_Data") + ":")); repeatColDataTextField = new UITextField(); repeatColDataTextField.setPreferredSize(new Dimension(107,24)); - rowPane.add(repeatColDataTextField); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); + multiData.add(repeatColDataTextField); + multiData.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": A2:D5 ")); + // 右边的JPanel:复制行序列 + JPanel copyRowSequence = new JPanel(); copyLabel = new UILabel(REPORT_COLUMN_RAPEAT[rowOrColumn] + ":"); - rowPane.add(copyLabel); - + copyRowSequence.add(copyLabel); copyTitleTextField = new UITextField(); copyTitleTextField.setPreferredSize(new Dimension(107,24)); - rowPane.add(copyTitleTextField); - rowPane.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); - - + copyRowSequence.add(copyTitleTextField); + copyRowSequence.add(new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Base_Format") + ": 1,2-3,5,18")); + // 添加JPanel + rowPane.add(multiData); + rowPane.add(copyRowSequence); return rowPane; } /** * 从worksheetAttr中populate数据给界面 - * + * * @param attr 当前ElementCase的worksheet属性 * @param rowCount 总行数 * @param colCount 总列数 @@ -355,7 +370,7 @@ public class ReportColumnsPane extends BasicPane{ colOrRowConvert(); checkEnable(); } - + /** * populate列分栏数据 */ @@ -376,7 +391,7 @@ public class ReportColumnsPane extends BasicPane{ this.maxNumberSpinner.setEnabled(true); } } - + /** * populate行分栏 */ @@ -400,7 +415,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从worksheet中populate数据 - * + * * @param worksheet 当前worksheet */ public void populate(WorkSheet worksheet) { @@ -422,11 +437,11 @@ public class ReportColumnsPane extends BasicPane{ private void setValueText(WorkSheetAttr attr, int rowCount, int colCount, UITextField repeatColDataTextField, UITextField copyTitleTextField, UICheckBox showBlankCheckBox) { int startRow,endRow = -1,startColumn,endColumn = -1; - + if(attr.getStartIndex() == -1 && attr.getEndIndex() == -1){ return; } - + if (attr.getDirection() == ROW) { startRow = attr.getStartIndex(); endRow = attr.getEndIndex() == -1 ? rowCount - 1 : attr.getEndIndex(); @@ -438,13 +453,13 @@ public class ReportColumnsPane extends BasicPane{ startColumn = attr.getStartIndex(); endColumn = attr.getEndIndex() == -1 ? colCount - 1 : attr.getEndIndex(); } - + repeatColDataTextField.setText(ColumnRow.valueOf(startColumn, startRow).toString() +":" + ColumnRow.valueOf(endColumn, endRow).toString()); copyTitleTextField.setText(attr.getIndexsToCopy()); showBlankCheckBox.setSelected(attr.isShowBlank()); } - + /** * update行数据 */ @@ -463,7 +478,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update列数据 */ @@ -482,7 +497,7 @@ public class ReportColumnsPane extends BasicPane{ } } } - + /** * update数据给WorksheetAttr * @@ -491,8 +506,8 @@ public class ReportColumnsPane extends BasicPane{ if (!isRepeate) { attr.setDirection(Constants.NONE); return; - } - + } + switch (rowOrColumn) { case ROW: updateRow(attr); @@ -510,7 +525,7 @@ public class ReportColumnsPane extends BasicPane{ /** * update数据给worksheet - * + * * @param worksheet 当前worksheet */ public void update(WorkSheet worksheet) { @@ -527,7 +542,7 @@ public class ReportColumnsPane extends BasicPane{ /** * 从界面中赋值给WorkSheetAttr - * + * * @param attr 报表分栏属性 * @param repeatColDataTextField 从哪行开始复制 * @param copyTitleTextField 复制列序列 @@ -560,7 +575,7 @@ public class ReportColumnsPane extends BasicPane{ attr.setIndexsToCopy(copyTitleTextField.getText()); attr.setShowBlank(showBlankCheckBox.isSelected()); } - + /** * 判断输入是否合法 @@ -571,7 +586,7 @@ public class ReportColumnsPane extends BasicPane{ if(StringUtils.isEmpty(repeatText)){ return; } - + boolean valid = true; if(!repeatText.matches("[a-zA-Z]+[0-9]+[:][a-zA-Z]+[0-9]+")){ valid = false;