diff --git a/designer-base/src/com/fr/design/bbs/BBSLoginUtils.java b/designer-base/src/com/fr/design/bbs/BBSLoginUtils.java index 9a8eef094..5b46b7c68 100644 --- a/designer-base/src/com/fr/design/bbs/BBSLoginUtils.java +++ b/designer-base/src/com/fr/design/bbs/BBSLoginUtils.java @@ -1,5 +1,6 @@ package com.fr.design.bbs; +import com.fr.config.BBSAttr; import com.fr.config.Configuration; import com.fr.config.MarketConfig; import com.fr.log.FineLoggerFactory; @@ -15,12 +16,14 @@ import java.util.List; public class BBSLoginUtils { public static void bbsLogin(final String username, final String password) { + final BBSAttr bbsAttr = new BBSAttr(); + bbsAttr.setBbsUsername(username); + bbsAttr.setBbsPassword(password); try { Configurations.update(new Worker() { @Override public void run() { - MarketConfig.getInstance().setBbsUsername(username); - MarketConfig.getInstance().setBbsPassword(password); + MarketConfig.getInstance().setBBsAttr(bbsAttr); } @Override public Class[] targets() { @@ -35,16 +38,18 @@ public class BBSLoginUtils { public static void bbsLogin(List list) { try { - final String uid = list.get(0); - final String username = list.get(1); - final String password = list.get(2); + String uid = list.get(0); + String username = list.get(1); + String password = list.get(2); + final BBSAttr bbsAttr = new BBSAttr(); + bbsAttr.setBbsUsername(username); + bbsAttr.setBbsPassword(password); + bbsAttr.setBbsUid(Integer.parseInt(uid)); + bbsAttr.setInShowBBsName(username); Configurations.update(new Worker() { @Override public void run() { - MarketConfig.getInstance().setBbsUsername(username); - MarketConfig.getInstance().setBbsPassword(password); - MarketConfig.getInstance().setBbsUid(Integer.parseInt(uid)); - MarketConfig.getInstance().setInShowBBsName(username); + MarketConfig.getInstance().setBBsAttr(bbsAttr); } @Override public Class[] targets() { @@ -58,11 +63,13 @@ public class BBSLoginUtils { } public static void bbsLogout() { + final BBSAttr bbsAttr = new BBSAttr(); + bbsAttr.setBbsUsername(StringUtils.EMPTY); + bbsAttr.setBbsPassword(StringUtils.EMPTY); + bbsAttr.setBbsUid(0); + bbsAttr.setInShowBBsName(StringUtils.EMPTY); try { - MarketConfig.getInstance().setBbsUsername(StringUtils.EMPTY); - MarketConfig.getInstance().setBbsPassword(StringUtils.EMPTY); - MarketConfig.getInstance().setBbsUid(0); - MarketConfig.getInstance().setInShowBBsName(StringUtils.EMPTY); + MarketConfig.getInstance().setBBsAttr(bbsAttr); } catch (Exception e) { FineLoggerFactory.getLogger().error(e.getMessage()); } diff --git a/designer-base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java b/designer-base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java index 8ffe37659..0124f94dc 100644 --- a/designer-base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java +++ b/designer-base/src/com/fr/design/data/datapane/preview/PreviewTableModel.java @@ -190,10 +190,12 @@ public class PreviewTableModel extends AbstractTableModel { s = Inter.getLocText("FR-Designer_Parameter_String"); if (!WorkContext.getCurrent().isLocal() && dataModel instanceof EmbeddedTDDataModel) { Class clzz = ((EmbeddedTDDataModel) dataModel).getColumnClass(column); - if (Number.class.isAssignableFrom(clzz)) { + if (clzz != null) { + if (Number.class.isAssignableFrom(clzz)) { s = Inter.getLocText("FR-Designer_Number");//bigdecimal - } else if (java.sql.Date.class.isAssignableFrom(clzz)) { - s = Inter.getLocText("FR-Designer_Date"); + } else if (java.sql.Date.class.isAssignableFrom(clzz)) { + s = Inter.getLocText("FR-Designer_Date"); + } } } } else if (o instanceof Integer) { diff --git a/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java b/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java index 42114acbc..1ffb3c1dd 100644 --- a/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java @@ -16,7 +16,7 @@ import java.awt.*; * Number Field. */ public class UINumberField extends UITextField { - public static final double ERROR_VALUE = Double.MAX_VALUE + 4.44; // peter:错误的值. + public static final double ERROR_VALUE = 0; // peter:错误的值. mata:如果输入负号之类直接走ERROR_VALUE public static final int MAX_INTEGERLENGTH = 24; public static final int MAX_INTEGERLENGTH_32 = 32; public static final int MAX_DECIMALLENGTH = 16; @@ -106,7 +106,8 @@ public class UINumberField extends UITextField { */ public double getValue() throws NumberFormatException { try { - if (this.getText().length() == 0) { + + if (StringUtils.isEmpty(this.getText())) { return 0; } diff --git a/designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java b/designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java index b5a2aeffa..21128fa77 100644 --- a/designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java +++ b/designer-base/src/com/fr/design/style/background/BackgroundCardSwitchButtonPane.java @@ -2,7 +2,7 @@ package com.fr.design.style.background; import com.fr.base.background.ColorBackground; import com.fr.base.background.GradientBackground; -import com.fr.base.background.ImageBackground; +import com.fr.base.background.ImageFileBackground; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.style.background.gradient.GradientBackgroundPane; import com.fr.design.style.background.impl.ColorBackgroundPane; @@ -30,7 +30,7 @@ public class BackgroundCardSwitchButtonPane extends BackgroundButtonPane { private static void registerCardSwitchBtnBackground(Map, BackgroundUIWrapper> map) { map.put(ColorBackground.class, BackgroundUIWrapper.create() .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); - map.put(ImageBackground.class, BackgroundUIWrapper.create() + map.put(ImageFileBackground.class, BackgroundUIWrapper.create() .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image"))); map.put(GradientBackground.class, BackgroundUIWrapper.create() .setType(GradientBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Gradient_Color"))); diff --git a/designer-base/src/com/fr/design/style/background/BackgroundFactory.java b/designer-base/src/com/fr/design/style/background/BackgroundFactory.java index 8489f7d88..2348f99ac 100644 --- a/designer-base/src/com/fr/design/style/background/BackgroundFactory.java +++ b/designer-base/src/com/fr/design/style/background/BackgroundFactory.java @@ -3,7 +3,7 @@ package com.fr.design.style.background; import com.fr.base.background.ColorBackground; import com.fr.base.background.GradientBackground; -import com.fr.base.background.ImageBackground; +import com.fr.base.background.ImageFileBackground; import com.fr.base.background.PatternBackground; import com.fr.base.background.TextureBackground; import com.fr.design.ExtraDesignClassManager; @@ -104,19 +104,19 @@ public class BackgroundFactory { } private static void registerImageBackground(Map, BackgroundUIWrapper> map) { - map.put(ImageBackground.class, BackgroundUIWrapper.create() + map.put(ImageFileBackground.class, BackgroundUIWrapper.create() .setType(ImageBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image"))); } private static void registerBrowserImageBackground(Map, BackgroundUIWrapper> map) { - map.put(ImageBackground.class, BackgroundUIWrapper.create() + map.put(ImageFileBackground.class, BackgroundUIWrapper.create() .setType(ImageBackgroundPane4Browser.class).setTitle(Inter.getLocText("FR-Designer_Background_Image"))); } private static void registerButtonBackground(Map, BackgroundUIWrapper> map){ map.put(ColorBackground.class, BackgroundUIWrapper.create() .setType(ColorBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Color"))); - map.put(ImageBackground.class, BackgroundUIWrapper.create() + map.put(ImageFileBackground.class, BackgroundUIWrapper.create() .setType(ImageButtonBackgroundPane.class).setTitle(Inter.getLocText("FR-Designer_Background_Image"))); } diff --git a/designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java b/designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java index feaaf67dc..a5923a9f1 100644 --- a/designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java +++ b/designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java @@ -188,11 +188,11 @@ public class NumberEditorValidatePane extends JPanel { @Override public void stateChanged(ChangeEvent e) { - if (setMaxValueCheckBox.isSelected()) { + if (setMinValueCheckBox.isSelected()) { if (maxValueSpinner.getValue() >= minValueSpinner.getValue()) { minValueSpinner.getTextField().setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue())); } else { - maxValueSpinner.setValue(minValueSpinner.getValue()); + minValueSpinner.setValue(maxValueSpinner.getValue()); } } } @@ -202,11 +202,11 @@ public class NumberEditorValidatePane extends JPanel { @Override public void stateChanged(ChangeEvent e) { - if (setMinValueCheckBox.isSelected()) { + if (setMaxValueCheckBox.isSelected()) { if (minValueSpinner.getValue() <= maxValueSpinner.getValue()) { maxValueSpinner.getTextField().setMinValue(Double.parseDouble("" + minValueSpinner.getValue())); } else { - minValueSpinner.setValue(maxValueSpinner.getValue()); + maxValueSpinner.setValue(minValueSpinner.getValue()); } } } @@ -258,27 +258,7 @@ public class NumberEditorValidatePane extends JPanel { } ob.setAllowNegative(allowNegativeCheckBox.isSelected()); - if (setMaxValueCheckBox.isSelected()) { - if (maxValueSpinner.getValue() < maxValueSpinner.getTextField().getMinValue()) { - ob.setMaxValue(Double.parseDouble(StringUtils.EMPTY + maxValueSpinner.getTextField().getMinValue())); - maxValueSpinner.getTextField().setValue(maxValueSpinner.getTextField().getMaxValue()); - } else { - ob.setMaxValue(Double.parseDouble(StringUtils.EMPTY + maxValueSpinner.getValue())); - } - } else { - ob.setMaxValue(Double.MAX_VALUE); - } - if (setMinValueCheckBox.isSelected()) { - if (minValueSpinner.getValue() > minValueSpinner.getTextField().getMaxValue()) { - ob.setMinValue(Double.parseDouble(StringUtils.EMPTY + minValueSpinner.getTextField().getMaxValue())); - minValueSpinner.getTextField().setValue(minValueSpinner.getTextField().getMaxValue()); - } else { - ob.setMinValue(Double.parseDouble(StringUtils.EMPTY + minValueSpinner.getValue())); - } - } else { - ob.setMinValue(-Double.MAX_VALUE); - } if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){ errorMsgTextFieldPane.setVisible(true); }else{ diff --git a/designer-realize/src/com/fr/design/present/PresentPane.java b/designer-realize/src/com/fr/design/present/PresentPane.java index f7b74d69a..3e1fd65e3 100644 --- a/designer-realize/src/com/fr/design/present/PresentPane.java +++ b/designer-realize/src/com/fr/design/present/PresentPane.java @@ -25,6 +25,9 @@ import java.util.Set; */ public class PresentPane extends UIComboBoxPane { private DictPresentPane dictPresentPane; + private FormulaPresentPane formulaPresentPane; + private BarCodePane barCodePane; + private CurrencyLinePane currencyLinePane; private List keys; private List displays; @@ -51,6 +54,9 @@ public class PresentPane extends UIComboBoxPane { public void populateBean(Present ob) { if(ob == null) { dictPresentPane.reset(); + formulaPresentPane.reset(); + barCodePane.reset(); + currencyLinePane.reset(); } super.populateBean(ob); } @@ -74,20 +80,20 @@ public class PresentPane extends UIComboBoxPane { keys.add(DictPresent.class.getName()); displays.add(dictPresentPane.title4PopupWindow()); - FurtherBasicBeanPane bar = new BarCodePane(); - paneList.add(bar); + barCodePane = new BarCodePane(); + paneList.add(barCodePane); keys.add(BarcodePresent.class.getName()); - displays.add(bar.title4PopupWindow()); + displays.add(barCodePane.title4PopupWindow()); - FurtherBasicBeanPane formula = new FormulaPresentPane(); - paneList.add(formula); + formulaPresentPane = new FormulaPresentPane(); + paneList.add(formulaPresentPane); keys.add(FormulaPresent.class.getName()); - displays.add(formula.title4PopupWindow()); + displays.add(formulaPresentPane.title4PopupWindow()); - FurtherBasicBeanPane currency = new CurrencyLinePane(); - paneList.add(currency); + currencyLinePane = new CurrencyLinePane(); + paneList.add(currencyLinePane); keys.add(CurrencyLinePresent.class.getName()); - displays.add(currency.title4PopupWindow()); + displays.add(currencyLinePane.title4PopupWindow()); Set providers = ExtraDesignClassManager.getInstance().getArray(PresentKindProvider.MARK_STRING); for (PresentKindProvider provider : providers) { diff --git a/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java b/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java index bde8cdfcb..2db00aeff 100644 --- a/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java +++ b/designer-realize/src/com/fr/design/write/submit/SmartInsertDBManipulationPane.java @@ -183,30 +183,7 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * @param evt 事件s */ public void actionPerformed(ActionEvent evt) { - - // Grid.GridSelectionListener - if (ePane == null) { - return; - } - - /* - * 布局 - */ - BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane); - - // ReportWriteAttrDialog.this.setVisible(false); - hideDialog4AddCellAction(); - /* - * 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener - */ - ePane.setEditable(false); - ePane.setSelection(NO_SELECTION); - ePane.getGrid().setNotShowingTableSelectPane(false); - - BasicDialog dlg = bPane.showWindow(DesignerContext.getDesignerFrame()); - - dlg.setModal(false); - dlg.setVisible(true); + showCellWindow(false); } } @@ -220,26 +197,36 @@ public class SmartInsertDBManipulationPane extends DBManipulationPane { * @param e 事件s */ public void actionPerformed(ActionEvent e) { - if (ePane == null) { - return; - } + showCellWindow(true); + } + } + + /** + * 切换到单元格窗口,设置属性面板不可编辑 + * @param isCellGroup 判断是否单元格组 + */ - BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane, true); + private void showCellWindow(boolean isCellGroup){ + if (ePane == null) { + return; + } - // ReportWriteAttrDialog.this.setVisible(false); - hideDialog4AddCellAction(); + BasicPane bPane = new SmartJTablePane4DB(keyColumnValuesTable.getTableModel4SmartAddCell(), ePane, isCellGroup); + + // ReportWriteAttrDialog.this.setVisible(false); + hideDialog4AddCellAction(); /* * 当前的ReportPane不可编辑,不可切换Sheet,加GridSelectionChangeListener */ - ePane.setSelection(NO_SELECTION); - ePane.setEditable(false); - ePane.getGrid().setNotShowingTableSelectPane(false); + //必须先设置面板不可编辑才能释放单元格选中 + ePane.setEditable(false); + ePane.setSelection(NO_SELECTION); + ePane.getGrid().setNotShowingTableSelectPane(false); - BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this)); + BasicDialog dlg = bPane.showWindow(SwingUtilities.getWindowAncestor(SmartInsertDBManipulationPane.this)); - dlg.setModal(false); - dlg.setVisible(true); - } + dlg.setModal(false); + dlg.setVisible(true); } private void showDialogAfterAddCellAction() {