diff --git a/designer/src/com/fr/design/mainframe/ReportFloatPane.java b/designer/src/com/fr/design/mainframe/ReportFloatPane.java index c7cb6871f2..087cda8320 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 74f5306b6a..04a9667860 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 855f68a1ec..f63252fd48 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 c8cc3362fc..eefff3e1ec 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