From 2db22ea09bef4069b4d972f88ce076f77d4bd5b4 Mon Sep 17 00:00:00 2001 From: lucian Date: Tue, 14 Jan 2020 12:24:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?REPORT-26432=2010.0.4=E8=AE=BE=E8=AE=A1?= =?UTF-8?q?=E5=99=A8=E4=B8=AD=E6=B2=A1=E6=9C=89sheet=E5=8F=AF=E8=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/fr/design/mainframe/ElementCasePane.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java index 27f336821..85dbd4eb3 100644 --- a/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java +++ b/designer-realize/src/main/java/com/fr/design/mainframe/ElementCasePane.java @@ -80,6 +80,7 @@ import com.fr.design.selection.QuickEditor; import com.fr.design.selection.Selectedable; import com.fr.design.selection.SelectionEvent; import com.fr.design.selection.SelectionListener; +import com.fr.design.ui.util.UIUtil; import com.fr.general.ComparatorUtils; import com.fr.grid.Grid; import com.fr.grid.GridColumn; @@ -117,7 +118,6 @@ import javax.swing.JPanel; import javax.swing.JPopupMenu; import javax.swing.JScrollBar; import javax.swing.KeyStroke; -import javax.swing.SwingUtilities; import java.awt.AWTEvent; import java.awt.Adjustable; import java.awt.Dimension; @@ -857,7 +857,7 @@ public abstract class ElementCasePane extends Tar // Guaranteed to return a non-null array final Object[] listeners = listenerList.getListenerList(); - SwingUtilities.invokeLater(new Runnable() { + UIUtil.invokeLaterIfNeeded(new Runnable() { @Override public void run() { // Process the listeners last to first, notifying From 96630f3992f63734f363b81e87a62b9aca39b2c3 Mon Sep 17 00:00:00 2001 From: hades Date: Wed, 15 Jan 2020 11:00:07 +0800 Subject: [PATCH 2/2] =?UTF-8?q?REPORT-26492=20=E4=BA=8C=E7=BB=B4=E7=A0=81?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E4=B8=8D=E5=AF=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/fr/design/present/BarCodePane.java | 68 ++++++++++--------- 1 file changed, 37 insertions(+), 31 deletions(-) diff --git a/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java b/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java index 029f7e9c8..b0df938db 100644 --- a/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java +++ b/designer-realize/src/main/java/com/fr/design/present/BarCodePane.java @@ -48,17 +48,17 @@ public class BarCodePane extends FurtherBasicBeanPane { private UIComboBox typeComboBox; private UISpinner barWidthSpinner; private UISpinner barHeightSpinner; - private UISpinner RCodesizespinner; + private UISpinner sizeSpinner; private UICheckBox drawingTextCheckBox; - private UIComboBox RCodeVersionComboBox; - private UIComboBox RCodeErrorCorrectComboBox; + private UIComboBox versionComboBox; + private UIComboBox errorCorrectComboBox; private UILabel typeSetLabel; private String testText = "12345"; public BarCodePane() { this.initComponents(); - addlistener(); + addListener(); } private void initComponents() { @@ -73,9 +73,9 @@ public class BarCodePane extends FurtherBasicBeanPane { borderPane.add(barCodePreviewPane, BorderLayout.CENTER); setTypeComboBox(); setSome(); - RCodesizespinner = new UISpinner(1,6,1,2); - RCodeVersionComboBox = new UIComboBox(); - RCodeErrorCorrectComboBox = new UIComboBox(); + sizeSpinner = new UISpinner(1,6,1,2); + versionComboBox = new UIComboBox(); + errorCorrectComboBox = new UIComboBox(); typeSetLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Basic_Type_Set"), UILabel.LEFT); initVersionComboBox(); initErrorCorrectComboBox(); @@ -169,31 +169,34 @@ public class BarCodePane extends FurtherBasicBeanPane { int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}}; UILabel uiLabel = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Version"), UILabel.LEFT); uiLabel.setPreferredSize(typeSetLabel.getPreferredSize()); - RCodeVersionComboBox.setPreferredSize(new Dimension(155,20)); - RCodeErrorCorrectComboBox.setPreferredSize(new Dimension(155,20)); - RCodesizespinner.setPreferredSize(new Dimension(155,20)); + versionComboBox.setPreferredSize(new Dimension(155,20)); + errorCorrectComboBox.setPreferredSize(new Dimension(155,20)); + sizeSpinner.setPreferredSize(new Dimension(155,20)); Component[][] components_special = new Component[][]{ - new Component[]{uiLabel, RCodeVersionComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Error_Correct"), UILabel.LEFT), RCodeErrorCorrectComboBox}, - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCodeDrawPix"), UILabel.LEFT), RCodesizespinner} + new Component[]{uiLabel, versionComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCode_Error_Correct"), UILabel.LEFT), errorCorrectComboBox}, + new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_RCodeDrawPix"), UILabel.LEFT), sizeSpinner} }; JPanel specialPane = TableLayoutHelper.createGapTableLayoutPane(components_special, rowSize, columnSize, rowCount, LayoutConstants.VGAP_HUGER, LayoutConstants.VGAP_LARGE); return specialPane; } - private void addlistener() { - RCodesizespinner.addChangeListener(new ChangeListener() { + private void addListener() { + sizeSpinner.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { repaintPreviewBarCode(); } }); - RCodeVersionComboBox.addItemListener(new ItemListener() { + versionComboBox.addItemListener(new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { repaintPreviewBarCode(); } }); - RCodeErrorCorrectComboBox.addItemListener(new ItemListener() { + errorCorrectComboBox.addItemListener(new ItemListener() { + @Override public void itemStateChanged(ItemEvent e) { repaintPreviewBarCode(); } @@ -204,6 +207,7 @@ public class BarCodePane extends FurtherBasicBeanPane { } }); this.barHeightSpinner.addChangeListener(new ChangeListener() { + @Override public void stateChanged(ChangeEvent e) { repaintPreviewBarCode(); } @@ -217,24 +221,21 @@ public class BarCodePane extends FurtherBasicBeanPane { } @Override - /** - * - */ public String title4PopupWindow() { return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Highlight_Barcode"); } private void initVersionComboBox() { String[] array = {com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Auto_Choose"), "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15", "16"}; - initcombobox(this.RCodeVersionComboBox, array, 0); + initCombobox(this.versionComboBox, array, 0); } private void initErrorCorrectComboBox() { String[] array = {"L" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "7%", "M" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "15%", "Q" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "25%", "H" + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Level") + "30%"}; - initcombobox(this.RCodeErrorCorrectComboBox, array, 1); + initCombobox(this.errorCorrectComboBox, array, 1); } - private void initcombobox(UIComboBox combobox, String[] array, int index) { + private void initCombobox(UIComboBox combobox, String[] array, int index) { combobox.removeAllItems(); for (int i = 0; i < array.length; i++) { combobox.addItem(array[i]); @@ -257,6 +258,7 @@ public class BarCodePane extends FurtherBasicBeanPane { /** * */ + @Override public void reset() { populateBean(new BarcodePresent()); } @@ -269,10 +271,14 @@ public class BarCodePane extends FurtherBasicBeanPane { } this.setTestText(BarCodeUtils.getTestTextByBarCode(barcodeAttr.getType())); this.typeComboBox.setSelectedIndex(barcodeAttr.getType()); - this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth()) * 10); - this.barHeightSpinner.setValue(new Integer(barcodeAttr.getBarHeight())); + if (barcodeAttr.getType() == NUM16) { + this.versionComboBox.setSelectedIndex(barcodeAttr.getRCodeVersion()); + this.errorCorrectComboBox.setSelectedIndex(barcodeAttr.getRCodeErrorCorrect()); + this.sizeSpinner.setValue(barcodeAttr.getRcodeDrawPix()); + } + this.barWidthSpinner.setValue(barcodeAttr.getBarWidth() * 10); + this.barHeightSpinner.setValue(barcodeAttr.getBarHeight()); this.drawingTextCheckBox.setSelected(barcodeAttr.isDrawingText()); - this.RCodesizespinner.setValue(new Integer(barcodeAttr.getRcodeDrawPix())); this.repaintPreviewBarCode(); } @@ -280,12 +286,12 @@ public class BarCodePane extends FurtherBasicBeanPane { public BarcodePresent updateBean() { BarcodeAttr barcodeAttr = new BarcodeAttr(); if ((typeComboBox.getSelectedIndex() == NUM16)) { - barcodeAttr.setRCodeVersion(this.RCodeVersionComboBox.getSelectedIndex()); - barcodeAttr.setRCodeErrorCorrect(this.RCodeErrorCorrectComboBox.getSelectedIndex()); - barcodeAttr.setRcodeDrawPix((int) this.RCodesizespinner.getValue()); + barcodeAttr.setRCodeVersion(this.versionComboBox.getSelectedIndex()); + barcodeAttr.setRCodeErrorCorrect(this.errorCorrectComboBox.getSelectedIndex()); + barcodeAttr.setRcodeDrawPix((int) this.sizeSpinner.getValue()); } barcodeAttr.setType(this.typeComboBox.getSelectedIndex()); - barcodeAttr.setBarWidth(((Double) this.barWidthSpinner.getValue()).doubleValue() / 10); + barcodeAttr.setBarWidth(this.barWidthSpinner.getValue() / 10); barcodeAttr.setBarHeight((int) this.barHeightSpinner.getValue()); barcodeAttr.setDrawingText(this.drawingTextCheckBox.isSelected()); return new BarcodePresent(barcodeAttr); @@ -303,7 +309,7 @@ public class BarCodePane extends FurtherBasicBeanPane { private Object obj; public BarCodePreviewPane() { -// setBackground(Color.WHITE); + } /**