From faeddc13c3bf9893a6be407bed7880e8ffc2eee4 Mon Sep 17 00:00:00 2001 From: MoMeak Date: Wed, 8 Nov 2017 14:05:31 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-4604=20=E8=AE=BE=E8=AE=A1=E5=99=A8?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/mainframe/ReportFloatPane.java | 10 +++++-- .../com/fr/design/present/BarCodePane.java | 24 ++++++++------- designer/src/com/fr/poly/PolyDesignUI.java | 1 - designer/src/com/fr/poly/PolyDesigner.java | 3 +- .../fr/design/gui/style/AlignmentPane.java | 30 +++++++++++++++---- .../fr/design/gui/style/BackgroundPane.java | 2 +- 6 files changed, 46 insertions(+), 24 deletions(-) diff --git a/designer/src/com/fr/design/mainframe/ReportFloatPane.java b/designer/src/com/fr/design/mainframe/ReportFloatPane.java index c7cb6871f..087cda832 100644 --- a/designer/src/com/fr/design/mainframe/ReportFloatPane.java +++ b/designer/src/com/fr/design/mainframe/ReportFloatPane.java @@ -79,9 +79,13 @@ public class ReportFloatPane extends JPanel { insertFloatMenu.setTooltip(Inter.getLocText("FR-Designer_T_Insert_Float")); insertFloatMenu.setIconPath("com/fr/design/images/control/addPopup.png"); JTemplate editingTemplate = HistoryTemplateListPane.getInstance().getCurrentEditingTemplate(); - ElementCasePaneDelegate elementCasePaneDelegate = (ElementCasePaneDelegate) editingTemplate.getCurrentElementCasePane(); - if (elementCasePaneDelegate != null) { - refreshInsertFloatMenu(elementCasePaneDelegate); + JComponent currentElementCasePane = editingTemplate.getCurrentElementCasePane(); + if (currentElementCasePane != null) { + insertFloatMenu.clearShortCuts(); + UpdateAction[] actions = ActionFactory.createFloatInsertAction(ElementCasePane.class, currentElementCasePane); + for (int i = 0; i < actions.length; i++) { + insertFloatMenu.addShortCut(actions[i]); + } } } diff --git a/designer/src/com/fr/design/present/BarCodePane.java b/designer/src/com/fr/design/present/BarCodePane.java index 74f5306b6..04a966786 100644 --- a/designer/src/com/fr/design/present/BarCodePane.java +++ b/designer/src/com/fr/design/present/BarCodePane.java @@ -9,6 +9,8 @@ import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ispinner.UIBasicSpinner; +import com.fr.design.gui.ispinner.UISpinner; +import com.fr.design.gui.itextfield.UINumberField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; @@ -45,9 +47,9 @@ public class BarCodePane extends FurtherBasicBeanPane { private final int NUM16 = 16; private BarCodePreviewPane barCodePreviewPane; private UIComboBox typeComboBox; - private UIBasicSpinner barWidthSpinner; - private UIBasicSpinner barHeightSpinner; - private UIBasicSpinner RCodesizespinner; + private UISpinner barWidthSpinner; + private UISpinner barHeightSpinner; + private UISpinner RCodesizespinner; private UICheckBox drawingTextCheckBox; private UIComboBox RCodeVersionComboBox; private UIComboBox RCodeErrorCorrectComboBox; @@ -62,8 +64,8 @@ public class BarCodePane extends FurtherBasicBeanPane { private void initComponents() { barCodePreviewPane = new BarCodePreviewPane(); - this.barWidthSpinner = new UIBasicSpinner(new SpinnerNumberModel(10.0, 1, 100, 1.0)); - this.barHeightSpinner = new UIBasicSpinner(new SpinnerNumberModel(30, 1, 100, 1)); + this.barWidthSpinner = new UISpinner(1,100.0,1.0,10.0); + this.barHeightSpinner = new UISpinner(1,100.0,1.0,30); this.barWidthSpinner.setPreferredSize(new Dimension(60, 20)); this.barHeightSpinner.setPreferredSize(new Dimension(60, 20)); JPanel borderPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); @@ -72,7 +74,7 @@ public class BarCodePane extends FurtherBasicBeanPane { borderPane.add(barCodePreviewPane, BorderLayout.CENTER); setTypeComboBox(); setSome(); - RCodesizespinner = new UIBasicSpinner(new SpinnerNumberModel(2, 1, 6, 1)); + RCodesizespinner = new UISpinner(1,6,1,2); RCodeVersionComboBox = new UIComboBox(); RCodeErrorCorrectComboBox = new UIComboBox(); typeSetLabel = new UILabel(Inter.getLocText("FR-Designer_Type_Set"), UILabel.LEFT); @@ -126,10 +128,10 @@ public class BarCodePane extends FurtherBasicBeanPane { } private void setSome() { - JFormattedTextField heightTextField = ((JSpinner.DefaultEditor) barHeightSpinner.getEditor()).getTextField(); + UINumberField heightTextField = barHeightSpinner.getTextField(); heightTextField.setColumns(2); - JFormattedTextField widthTextField = ((JSpinner.DefaultEditor) barWidthSpinner.getEditor()).getTextField(); + UINumberField widthTextField = barWidthSpinner.getTextField(); widthTextField.setColumns(2); } @@ -268,7 +270,7 @@ public class BarCodePane extends FurtherBasicBeanPane { } this.setTestText(BarCodeUtils.getTestTextByBarCode(barcodeAttr.getType())); this.typeComboBox.setSelectedIndex(barcodeAttr.getType()); - this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth())); + this.barWidthSpinner.setValue(new Double(barcodeAttr.getBarWidth()) * 10); this.barHeightSpinner.setValue(new Integer(barcodeAttr.getBarHeight())); this.drawingTextCheckBox.setSelected(barcodeAttr.isDrawingText()); this.RCodesizespinner.setValue(new Integer(barcodeAttr.getRcodeDrawPix())); @@ -281,11 +283,11 @@ public class BarCodePane extends FurtherBasicBeanPane { if ((typeComboBox.getSelectedIndex() == NUM16)) { barcodeAttr.setRCodeVersion(this.RCodeVersionComboBox.getSelectedIndex()); barcodeAttr.setRCodeErrorCorrect(this.RCodeErrorCorrectComboBox.getSelectedIndex()); - barcodeAttr.setRcodeDrawPix(((Integer) this.RCodesizespinner.getValue()).intValue()); + barcodeAttr.setRcodeDrawPix((int) this.RCodesizespinner.getValue()); } barcodeAttr.setType(this.typeComboBox.getSelectedIndex()); barcodeAttr.setBarWidth(((Double) this.barWidthSpinner.getValue()).doubleValue() / 10); - barcodeAttr.setBarHeight(((Integer) this.barHeightSpinner.getValue()).intValue()); + barcodeAttr.setBarHeight((int) this.barHeightSpinner.getValue()); barcodeAttr.setDrawingText(this.drawingTextCheckBox.isSelected()); return new BarcodePresent(barcodeAttr); } diff --git a/designer/src/com/fr/poly/PolyDesignUI.java b/designer/src/com/fr/poly/PolyDesignUI.java index 855f68a1e..f63252fd4 100644 --- a/designer/src/com/fr/poly/PolyDesignUI.java +++ b/designer/src/com/fr/poly/PolyDesignUI.java @@ -97,7 +97,6 @@ public class PolyDesignUI extends ComponentUI { paintAddingData(g2d, addData); } paintPaginateLine(g2d); - designer.repaint(); } private void paintAddedData(Graphics g) { diff --git a/designer/src/com/fr/poly/PolyDesigner.java b/designer/src/com/fr/poly/PolyDesigner.java index c8cc3362f..eefff3e1e 100644 --- a/designer/src/com/fr/poly/PolyDesigner.java +++ b/designer/src/com/fr/poly/PolyDesigner.java @@ -189,8 +189,7 @@ public class PolyDesigner extends ReportComponent