Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~kerry/design_10.0 into release/10.0

master
kerry 7 years ago
parent
commit
ea0d12593f
  1. 5
      designer-base/src/com/fr/design/gui/itextfield/UINumberField.java
  2. 28
      designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java
  3. 8
      designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  4. 7
      designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  5. 10
      designer-chart/src/com/fr/design/module/ChartPreStyleAction.java
  6. 3
      designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java
  7. 14
      designer-chart/src/com/fr/design/module/ChartPreStylePane.java
  8. 4
      designer-chart/src/com/fr/van/chart/map/server/ChartMapEditorAction.java
  9. 5
      designer-chart/src/com/fr/van/chart/wordcloud/designer/style/VanChartWordCloudSeriesPane.java
  10. 24
      designer-realize/src/com/fr/design/present/PresentPane.java

5
designer-base/src/com/fr/design/gui/itextfield/UINumberField.java

@ -16,7 +16,7 @@ import java.awt.*;
* Number Field. * Number Field.
*/ */
public class UINumberField extends UITextField { 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 = 24;
public static final int MAX_INTEGERLENGTH_32 = 32; public static final int MAX_INTEGERLENGTH_32 = 32;
public static final int MAX_DECIMALLENGTH = 16; public static final int MAX_DECIMALLENGTH = 16;
@ -106,7 +106,8 @@ public class UINumberField extends UITextField {
*/ */
public double getValue() throws NumberFormatException { public double getValue() throws NumberFormatException {
try { try {
if (this.getText().length() == 0) {
if (StringUtils.isEmpty(this.getText())) {
return 0; return 0;
} }

28
designer-base/src/com/fr/design/widget/component/NumberEditorValidatePane.java

@ -188,11 +188,11 @@ public class NumberEditorValidatePane extends JPanel {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
if (maxValueSpinner.getValue() >= minValueSpinner.getValue()) { if (maxValueSpinner.getValue() >= minValueSpinner.getValue()) {
minValueSpinner.getTextField().setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue())); minValueSpinner.getTextField().setMaxValue(Double.parseDouble("" + maxValueSpinner.getValue()));
} else { } else {
maxValueSpinner.setValue(minValueSpinner.getValue()); minValueSpinner.setValue(maxValueSpinner.getValue());
} }
} }
} }
@ -202,11 +202,11 @@ public class NumberEditorValidatePane extends JPanel {
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
if (minValueSpinner.getValue() <= maxValueSpinner.getValue()) { if (minValueSpinner.getValue() <= maxValueSpinner.getValue()) {
maxValueSpinner.getTextField().setMinValue(Double.parseDouble("" + minValueSpinner.getValue())); maxValueSpinner.getTextField().setMinValue(Double.parseDouble("" + minValueSpinner.getValue()));
} else { } else {
minValueSpinner.setValue(maxValueSpinner.getValue()); maxValueSpinner.setValue(minValueSpinner.getValue());
} }
} }
} }
@ -258,27 +258,7 @@ public class NumberEditorValidatePane extends JPanel {
} }
ob.setAllowNegative(allowNegativeCheckBox.isSelected()); 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()){ if(setMinValueCheckBox.isSelected() || setMaxValueCheckBox.isSelected()){
errorMsgTextFieldPane.setVisible(true); errorMsgTextFieldPane.setVisible(true);
}else{ }else{

8
designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -1,8 +1,6 @@
package com.fr.design.mainframe.chart.gui.style; package com.fr.design.mainframe.chart.gui.style;
import com.fr.base.ChartPreStyleConfig; import com.fr.base.ChartPreStyleConfig;
import com.fr.base.ChartPreStyleManagerProvider;
import com.fr.base.ChartPreStyleServerManager;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.AttrFillStyle; import com.fr.chart.base.AttrFillStyle;
import com.fr.chart.base.ChartConstants; import com.fr.chart.base.ChartConstants;
@ -199,9 +197,9 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
if(styleSelectBox.getSelectedIndex() == 0) { if(styleSelectBox.getSelectedIndex() == 0) {
condition.setColorStyle(ChartConstants.COLOR_DEFAULT); condition.setColorStyle(ChartConstants.COLOR_DEFAULT);
} else if(styleSelectBox.getSelectedIndex() < styleSelectBox.getItemCount() - 1){ } else if(styleSelectBox.getSelectedIndex() < styleSelectBox.getItemCount() - 1){
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance();
Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem()); Object preStyle = manager.getPreStyle(styleSelectBox.getSelectedItem());
if(preStyle instanceof ChartPreStyle) { if(preStyle instanceof ChartPreStyle) {
AttrFillStyle def = ((ChartPreStyle) preStyle).getAttrFillStyle(); AttrFillStyle def = ((ChartPreStyle) preStyle).getAttrFillStyle();
def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem())); def.setFillStyleName(Utils.objectToString(styleSelectBox.getSelectedItem()));
return def; return def;

7
designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart.gui.type; package com.fr.design.mainframe.chart.gui.type;
import com.fr.base.ChartPreStyleManagerProvider; import com.fr.base.ChartPreStyleConfig;
import com.fr.base.ChartPreStyleServerManager;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.base.background.ColorBackground; import com.fr.base.background.ColorBackground;
import com.fr.chart.base.AttrContents; 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.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.log.FineLoggerFactory;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.js.NameJavaScriptGroup; import com.fr.js.NameJavaScriptGroup;
import com.fr.log.FineLoggerFactory;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -224,7 +223,7 @@ public abstract class AbstractChartTypePane extends FurtherBasicBeanPane<Chart>{
} }
private void setPlotFillStyle(Chart chart){ private void setPlotFillStyle(Chart chart){
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); ChartPreStyleConfig manager = ChartPreStyleConfig.getInstance();
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
Object preStyle = null; Object preStyle = null;
String name = ""; String name = "";

10
designer-chart/src/com/fr/design/module/ChartPreStyleAction.java

@ -1,7 +1,5 @@
package com.fr.design.module; 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.actions.UpdateAction;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionAdapter; import com.fr.design.dialog.DialogActionAdapter;
@ -41,14 +39,14 @@ public class ChartPreStyleAction extends UpdateAction {
@Override @Override
public void doOk() { public void doOk() {
pane.updateBean(); pane.updateBean();
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); // ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
manager.setStyleEditing(null); // manager.setStyleEditing(null);
} }
@Override @Override
public void doCancel() { public void doCancel() {
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); // ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
manager.setStyleEditing(null); // manager.setStyleEditing(null);
} }
}); });

3
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.design.mainframe.DesignerFrame;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.general.NameObject; import com.fr.general.NameObject;
import com.fr.stable.ListMap;
import com.fr.stable.Nameable; import com.fr.stable.Nameable;
import java.util.ArrayList; import java.util.ArrayList;
@ -64,6 +65,8 @@ public class ChartPreStyleManagerPane extends JListControlPane {
public void updateBean() { public void updateBean() {
ChartPreStyleConfig config = ChartPreStyleConfig.getInstance(); ChartPreStyleConfig config = ChartPreStyleConfig.getInstance();
config.setPreStyleMap(new ListMap());
Nameable[] values = this.update(); Nameable[] values = this.update();
config.setCurrentStyle(getSelectedName()); config.setCurrentStyle(getSelectedName());

14
designer-chart/src/com/fr/design/module/ChartPreStylePane.java

@ -1,7 +1,5 @@
package com.fr.design.module; 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.base.ChartPreStyle;
import com.fr.chart.chartattr.Bar2DPlot; import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.Chart; 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.design.mainframe.chart.gui.style.ChartPreFillStylePane;
import com.fr.general.Inter; import com.fr.general.Inter;
import javax.swing.*; import javax.swing.JPanel;
import java.awt.*; 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<ChartPreStyle>{
} }
private void refreshWhenStyleChange(ChartPreStyle preStyle) { private void refreshWhenStyleChange(ChartPreStyle preStyle) {
ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance(); // ChartPreStyleManagerProvider manager = ChartPreStyleServerManager.getProviderInstance();
manager.setStyleEditing(preStyle); // manager.setStyleEditing(preStyle);
if(chartComponent != null) { if(chartComponent != null) {
chartComponent.reset(); chartComponent.reset();
} }

4
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) { public void actionPerformed(ActionEvent evt) {
int port = DesignerEnvManager.getEnvManager().getEmbedServerPort(); int port = DesignerEnvManager.getEnvManager().getEmbedServerPort();
String web = GeneralContext.getCurrentAppNameOfEnv(); String web = GeneralContext.getCurrentAppNameOfEnv();
String serverlet = ServerConfig.getInstance().getReportServletName(); String serverlet = ServerConfig.getInstance().getServletName();
ServerStarter.browserURLWithLocalEnv(WorkContext.getCurrent().isLocal() ? String.format("http://localhost:%d/%s/%s?op=map", port, web, serverlet) : WorkContext.getCurrent().getPath() + "?op=map"); 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");
} }
} }

5
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.Utils;
import com.fr.base.background.ImageBackground; import com.fr.base.background.ImageBackground;
import com.fr.base.background.ImageFileBackground;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
@ -153,10 +154,10 @@ public class VanChartWordCloudSeriesPane extends VanChartAbstractPlotSeriesPane
CloudShapeType type = (CloudShapeType)cloudShape.getSelectedItem(); CloudShapeType type = (CloudShapeType)cloudShape.getSelectedItem();
String path = type.getImageUrl(); String path = type.getImageUrl();
if(path != null) { if(path != null) {
ImageBackground imageBackground = new ImageBackground(IOUtils.readImage(path)); ImageFileBackground imageBackground = new ImageFileBackground(IOUtils.readImage(path));
imageBackgroundQuickPane.populateBean(imageBackground); imageBackgroundQuickPane.populateBean(imageBackground);
} else { } else {
imageBackgroundQuickPane.populateBean(new ImageBackground()); imageBackgroundQuickPane.populateBean(new ImageFileBackground());
} }
checkImagePane(); checkImagePane();
} }

24
designer-realize/src/com/fr/design/present/PresentPane.java

@ -25,6 +25,9 @@ import java.util.Set;
*/ */
public class PresentPane extends UIComboBoxPane<Present> { public class PresentPane extends UIComboBoxPane<Present> {
private DictPresentPane dictPresentPane; private DictPresentPane dictPresentPane;
private FormulaPresentPane formulaPresentPane;
private BarCodePane barCodePane;
private CurrencyLinePane currencyLinePane;
private List<String> keys; private List<String> keys;
private List<String> displays; private List<String> displays;
@ -51,6 +54,9 @@ public class PresentPane extends UIComboBoxPane<Present> {
public void populateBean(Present ob) { public void populateBean(Present ob) {
if(ob == null) { if(ob == null) {
dictPresentPane.reset(); dictPresentPane.reset();
formulaPresentPane.reset();
barCodePane.reset();
currencyLinePane.reset();
} }
super.populateBean(ob); super.populateBean(ob);
} }
@ -74,20 +80,20 @@ public class PresentPane extends UIComboBoxPane<Present> {
keys.add(DictPresent.class.getName()); keys.add(DictPresent.class.getName());
displays.add(dictPresentPane.title4PopupWindow()); displays.add(dictPresentPane.title4PopupWindow());
FurtherBasicBeanPane<BarcodePresent> bar = new BarCodePane(); barCodePane = new BarCodePane();
paneList.add(bar); paneList.add(barCodePane);
keys.add(BarcodePresent.class.getName()); keys.add(BarcodePresent.class.getName());
displays.add(bar.title4PopupWindow()); displays.add(barCodePane.title4PopupWindow());
FurtherBasicBeanPane<FormulaPresent> formula = new FormulaPresentPane(); formulaPresentPane = new FormulaPresentPane();
paneList.add(formula); paneList.add(formulaPresentPane);
keys.add(FormulaPresent.class.getName()); keys.add(FormulaPresent.class.getName());
displays.add(formula.title4PopupWindow()); displays.add(formulaPresentPane.title4PopupWindow());
FurtherBasicBeanPane<CurrencyLinePresent> currency = new CurrencyLinePane(); currencyLinePane = new CurrencyLinePane();
paneList.add(currency); paneList.add(currencyLinePane);
keys.add(CurrencyLinePresent.class.getName()); keys.add(CurrencyLinePresent.class.getName());
displays.add(currency.title4PopupWindow()); displays.add(currencyLinePane.title4PopupWindow());
Set<PresentKindProvider> providers = ExtraDesignClassManager.getInstance().getArray(PresentKindProvider.MARK_STRING); Set<PresentKindProvider> providers = ExtraDesignClassManager.getInstance().getArray(PresentKindProvider.MARK_STRING);
for (PresentKindProvider provider : providers) { for (PresentKindProvider provider : providers) {

Loading…
Cancel
Save