From e708fc16a2a7d8fa00e9a480c80ad18ff43b9212 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 4 Jul 2018 11:10:01 +0800 Subject: [PATCH 1/6] =?UTF-8?q?CHART-2407=20=E5=9B=BE=E8=A1=A8=E9=85=8D?= =?UTF-8?q?=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chart/gui/style/ChartFillStylePane.java | 8 +++----- .../chart/gui/type/AbstractChartTypePane.java | 7 +++---- .../com/fr/design/module/ChartPreStyleAction.java | 10 ++++------ .../fr/design/module/ChartPreStyleManagerPane.java | 3 +++ .../com/fr/design/module/ChartPreStylePane.java | 14 ++++++++------ 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java index 943cc5738..f3a9b8a86 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java @@ -1,8 +1,6 @@ package com.fr.design.mainframe.chart.gui.style; import com.fr.base.ChartPreStyleConfig; -import com.fr.base.ChartPreStyleManagerProvider; -import com.fr.base.ChartPreStyleServerManager; import com.fr.base.Utils; import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.ChartConstants; @@ -199,9 +197,9 @@ public class ChartFillStylePane extends BasicBeanPane{ if(styleSelectBox.getSelectedIndex() == 0) { condition.setColorStyle(ChartConstants.COLOR_DEFAULT); } else if(styleSelectBox.getSelectedIndex() < styleSelectBox.getItemCount() - 1){ - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); - Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); - if(preStyle instanceof ChartPreStyle) { + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); + Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); + if(preStyle instanceof ChartPreStyle) { AttrFillStyle def = ((ChartPreStyle) preStyle).getAttrFillStyle(); def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); return def; diff --git a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java index 5aa9ea49a..590190762 100644 --- a/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java +++ b/designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java @@ -1,7 +1,6 @@ package com.fr.design.mainframe.chart.gui.type; -import com.fr.base.ChartPreStyleManagerProvider; -import com.fr.base.ChartPreStyleServerManager; +import com.fr.base.ChartPreStyleConfig; import com.fr.base.FRContext; import com.fr.base.background.ColorBackground; import com.fr.chart.base.AttrContents; @@ -26,9 +25,9 @@ import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.general.ComparatorUtils; import com.fr.general.FRFont; -import com.fr.log.FineLoggerFactory; import com.fr.general.Inter; import com.fr.js.NameJavaScriptGroup; +import com.fr.log.FineLoggerFactory; import com.fr.stable.Constants; import javax.swing.JPanel; @@ -224,7 +223,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane{ } private void setPlotFillStyle(Chart chart){ - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); + ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance(); Plot plot = chart.getPlot(); Object preStyle = null; String name = ""; diff --git a/designer-chart/src/com/fr/design/module/ChartPreStyleAction.java b/designer-chart/src/com/fr/design/module/ChartPreStyleAction.java index c56e257f8..70571338f 100644 --- a/designer-chart/src/com/fr/design/module/ChartPreStyleAction.java +++ b/designer-chart/src/com/fr/design/module/ChartPreStyleAction.java @@ -1,7 +1,5 @@ package com.fr.design.module; -import com.fr.base.ChartPreStyleManagerProvider; -import com.fr.base.ChartPreStyleServerManager; import com.fr.design.actions.UpdateAction; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; @@ -41,14 +39,14 @@ public class ChartPreStyleAction extends UpdateAction { @Override public void doOk() { pane.updateBean(); - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); - manager.setStyleEditing(null); +// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); +// manager.setStyleEditing(null); } @Override public void doCancel() { - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); - manager.setStyleEditing(null); +// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); +// manager.setStyleEditing(null); } }); diff --git a/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java b/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java index 64e68fff8..c25782c4e 100644 --- a/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java +++ b/designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java @@ -10,6 +10,7 @@ import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerFrame; import com.fr.general.Inter; import com.fr.general.NameObject; +import com.fr.stable.ListMap; import com.fr.stable.Nameable; import java.util.ArrayList; @@ -64,6 +65,8 @@ public class ChartPreStyleManagerPane extends JListControlPane { public void updateBean() { ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); + config.setPreStyleMap(new ListMap()); + Nameable[] values = this.update(); config.setCurrentStyle(getSelectedName()); diff --git a/designer-chart/src/com/fr/design/module/ChartPreStylePane.java b/designer-chart/src/com/fr/design/module/ChartPreStylePane.java index 70c68679f..d0f4d3136 100644 --- a/designer-chart/src/com/fr/design/module/ChartPreStylePane.java +++ b/designer-chart/src/com/fr/design/module/ChartPreStylePane.java @@ -1,7 +1,5 @@ package com.fr.design.module; -import com.fr.base.ChartPreStyleManagerProvider; -import com.fr.base.ChartPreStyleServerManager; import com.fr.chart.base.ChartPreStyle; import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Chart; @@ -15,8 +13,12 @@ import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.mainframe.chart.gui.style.ChartPreFillStylePane; import com.fr.general.Inter; -import javax.swing.*; -import java.awt.*; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.Component; +import java.awt.Container; +import java.awt.Dimension; +import java.awt.FlowLayout; /** * 图表预定义风格界面, 服务器--图表风格. @@ -78,8 +80,8 @@ public class ChartPreStylePane extends BasicBeanPane{ } private void refreshWhenStyleChange(ChartPreStyle preStyle) { - ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); - manager.setStyleEditing(preStyle); +// ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); +// manager.setStyleEditing(preStyle); if(chartComponent != null) { chartComponent.reset(); } From b8477e1fa54c721a78334bca1ce9e02d44b11212 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 4 Jul 2018 13:48:14 +0800 Subject: [PATCH 2/6] =?UTF-8?q?CHART-2525=20=E8=AF=8D=E4=BA=91=20=E5=BD=A2?= =?UTF-8?q?=E7=8A=B6=E5=9B=BE=E7=89=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../wordcloud/designer/style/VanChartWordCloudSeriesPane.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index dfd7b0cbd..94b8b7b1d 100644 --- a/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -2,6 +2,7 @@ package com.fr.van.chart.wordcloud.designer.style; import com.fr.base.Utils; import com.fr.base.background.ImageBackground; +import com.fr.base.background.ImageFileBackground; import com.fr.chart.chartattr.Plot; import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.icombobox.UIComboBox; @@ -153,7 +154,7 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane CloudShapeType type = (CloudShapeType)cloudShape.getSelectedItem(); String path = type.getImageUrl(); if(path != null) { - ImageBackground imageBackground = new ImageBackground(IOUtils.readImage(path)); + ImageFileBackground imageBackground = new ImageFileBackground(IOUtils.readImage(path)); imageBackgroundQuickPane.populateBean(imageBackground); } else { imageBackgroundQuickPane.populateBean(new ImageBackground()); From b59214ff7c64b1767350e367a47b2fbad152045c Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 4 Jul 2018 13:58:32 +0800 Subject: [PATCH 3/6] update --- .../wordcloud/designer/style/VanChartWordCloudSeriesPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java b/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java index 94b8b7b1d..5ae559f0d 100644 --- a/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java +++ b/designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java @@ -157,7 +157,7 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane ImageFileBackground imageBackground = new ImageFileBackground(IOUtils.readImage(path)); imageBackgroundQuickPane.populateBean(imageBackground); } else { - imageBackgroundQuickPane.populateBean(new ImageBackground()); + imageBackgroundQuickPane.populateBean(new ImageFileBackground()); } checkImagePane(); } From 733f7c538bc65c67b8c3e332ca485d1308841ed9 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 4 Jul 2018 14:28:50 +0800 Subject: [PATCH 4/6] REPORT-9267 REPORT-9391 --- .../design/gui/itextfield/UINumberField.java | 3 +- .../component/NumberEditorValidatePane.java | 28 +++---------------- .../com/fr/design/present/PresentPane.java | 24 ++++++++++------ 3 files changed, 21 insertions(+), 34 deletions(-) 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..d5b06509e 100644 --- a/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java +++ b/designer-base/src/com/fr/design/gui/itextfield/UINumberField.java @@ -106,7 +106,8 @@ public class UINumberField extends UITextField { */ public double getValue() throws NumberFormatException { try { - if (this.getText().length() == 0) { + //如果只输入了负号应该解释为0,而不是Double最大值 + if (this.getText().length() == 0 || "-".equals(this.getText())) { return 0; } 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) { From b3d1faf7e3d25f56a309cf88bdbeeb580b4215f4 Mon Sep 17 00:00:00 2001 From: "Mata.Li" Date: Wed, 4 Jul 2018 14:43:14 +0800 Subject: [PATCH 5/6] REPORT-9267 REPORT-9391 --- .../src/com/fr/design/gui/itextfield/UINumberField.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 d5b06509e..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,8 +106,8 @@ public class UINumberField extends UITextField { */ public double getValue() throws NumberFormatException { try { - //如果只输入了负号应该解释为0,而不是Double最大值 - if (this.getText().length() == 0 || "-".equals(this.getText())) { + + if (StringUtils.isEmpty(this.getText())) { return 0; } From a6fed9b4e679337fc1aa79f2a624ce7817204ea3 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 4 Jul 2018 18:45:07 +0800 Subject: [PATCH 6/6] =?UTF-8?q?CHART-2409=20=E5=9C=B0=E5=9B=BE=E8=B5=84?= =?UTF-8?q?=E6=BA=90=E9=85=8D=E7=BD=AE=E7=95=8C=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/van/chart/map/server/ChartMapEditorAction.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java b/designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java index 381006aa2..1da75fbbe 100644 --- a/designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java +++ b/designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java @@ -24,8 +24,8 @@ public class ChartMapEditorAction extends UpdateAction { public void actionPerformed(ActionEvent evt) { int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); String web = GeneralContext.getCurrentAppNameOfEnv(); - String serverlet = ServerConfig.getInstance().getReportServletName(); - ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : WorkContext.getCurrent().getPath() + "?op=map"); + String serverlet = ServerConfig.getInstance().getServletName(); + ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s/view/report?op=map", port, web, serverlet) : WorkContext.getCurrent().getPath() + "/view/report?op=map"); } }