Browse Source

Merge branch 'release/10.0' of http://cloud.finedevelop.com:2015/scm/~mata.li/designrel into release/10.0

final/10.0
Mata.Li 6 years ago
parent
commit
b5d8f969fe
  1. 26
      designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java
  2. 4
      designer-base/src/main/java/com/fr/design/extra/PluginUtils.java
  3. 9
      designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java
  4. 10
      designer-base/src/main/java/com/fr/design/i18n/Toolkit.java
  5. 6
      designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java
  6. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java
  7. 14
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java
  8. 4
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java

26
designer-base/src/main/java/com/fr/design/actions/file/PreferencePane.java

@ -1,6 +1,7 @@
package com.fr.design.actions.file; package com.fr.design.actions.file;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.config.Configuration;
import com.fr.design.DesignerEnvManager; import com.fr.design.DesignerEnvManager;
import com.fr.design.RestartHelper; import com.fr.design.RestartHelper;
import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.BasicDialog;
@ -28,6 +29,8 @@ import com.fr.general.Inter;
import com.fr.general.log.Log4jConfig; import com.fr.general.log.Log4jConfig;
import com.fr.locale.InterProviderFactory; import com.fr.locale.InterProviderFactory;
import com.fr.third.apache.log4j.Level; import com.fr.third.apache.log4j.Level;
import com.fr.transaction.Configurations;
import com.fr.transaction.Worker;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -347,8 +350,17 @@ public class PreferencePane extends BasicPane {
logLevelPane.add(logLevelComboBox); logLevelPane.add(logLevelComboBox);
logLevelComboBox.addActionListener(new ActionListener() { logLevelComboBox.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
Configurations.update(new Worker() {
@Override
public void run() {
Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem());
}
Log4jConfig.getInstance().setRootLevel((Level) logLevelComboBox.getSelectedItem()); @Override
public Class<? extends Configuration>[] targets() {
return new Class[]{Log4jConfig.class};
}
});
} }
}); });
} }
@ -635,7 +647,17 @@ public class PreferencePane extends BasicPane {
designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50); designerEnvManager.setUndoLimit(MAX_UNDO_LIMIT_50);
} }
Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem())); Configurations.update(new Worker() {
@Override
public void run() {
Log4jConfig.getInstance().setRootLevel(((Level) logLevelComboBox.getSelectedItem()));
}
@Override
public Class<? extends Configuration>[] targets() {
return new Class[]{Log4jConfig.class};
}
});
} }

4
designer-base/src/main/java/com/fr/design/extra/PluginUtils.java

@ -2,7 +2,6 @@ package com.fr.design.extra;
import com.fr.base.TemplateUtils; import com.fr.base.TemplateUtils;
import com.fr.general.CloudCenter; import com.fr.general.CloudCenter;
import com.fr.general.http.HttpClient; import com.fr.general.http.HttpClient;
import com.fr.json.JSONArray; import com.fr.json.JSONArray;
import com.fr.json.JSONObject; import com.fr.json.JSONObject;
@ -18,6 +17,7 @@ import com.fr.stable.EncodeConstants;
import com.fr.stable.ProductConstants; import com.fr.stable.ProductConstants;
import com.fr.stable.StableUtils; import com.fr.stable.StableUtils;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
@ -172,7 +172,7 @@ public class PluginUtils {
return ""; return "";
} }
return com.fr.design.i18n.Toolkit.i18nText(getInterKeyByErrorCode(errorCode)); return com.fr.design.i18n.Toolkit.i18nCompatibleServerText(getInterKeyByErrorCode(errorCode));
} }
private static String getInterKeyByErrorCode(PluginErrorCode errorCode) { private static String getInterKeyByErrorCode(PluginErrorCode errorCode) {

9
designer-base/src/main/java/com/fr/design/gui/controlpane/ObjectJControlPane.java

@ -24,7 +24,14 @@ public abstract class ObjectJControlPane extends JListControlPane {
@Override @Override
public BasicBeanPane createPaneByCreators(NameableCreator creator) { public BasicBeanPane createPaneByCreators(NameableCreator creator) {
try { try {
return Reflect.on(creator.getUpdatePane()).create(object).get(); Class target = creator.getUpdatePane();
Reflect reflect = Reflect.on(target);
// 判断是否存在对应构造函数
if (reflect.matchConstructor(object)) {
return reflect.create(object).get();
}
return reflect.create().get();
} catch (Exception e) { } catch (Exception e) {
return super.createPaneByCreators(creator); return super.createPaneByCreators(creator);
} }

10
designer-base/src/main/java/com/fr/design/i18n/Toolkit.java

@ -37,4 +37,14 @@ public class Toolkit {
public static String i18nTextArray(String[] keys) { public static String i18nTextArray(String[] keys) {
return InterProviderFactory.getProvider().getLocText(keys); return InterProviderFactory.getProvider().getLocText(keys);
} }
/**
* 兼容设计器里插件管理的部分
* 下一个版本将会废弃
*
* @deprecated
*/
public static String i18nCompatibleServerText(String key) {
return InterProviderFactory.getProvider().getLocText(key);
}
} }

6
designer-chart/src/main/java/com/fr/van/chart/designer/component/VanChartMarkerPane.java

@ -3,7 +3,6 @@ package com.fr.van.chart.designer.component;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
@ -25,7 +24,7 @@ public class VanChartMarkerPane extends BasicPane {
private JPanel centerPane; private JPanel centerPane;
private CardLayout cardLayout; private CardLayout cardLayout;
private BasicBeanPane commonMarkerPane; private VanChartCommonMarkerPane commonMarkerPane;
private BasicBeanPane imageMarkerPane; private BasicBeanPane imageMarkerPane;
@ -75,7 +74,7 @@ public class VanChartMarkerPane extends BasicPane {
return new VanChartImageMarkerPane(); return new VanChartImageMarkerPane();
} }
protected BasicBeanPane<VanChartAttrMarker> createCommonMarkerPane() { protected VanChartCommonMarkerPane createCommonMarkerPane() {
return new VanChartCommonMarkerPane(){ return new VanChartCommonMarkerPane(){
protected double[] getcolumnSize () { protected double[] getcolumnSize () {
double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH; double s = TableLayout4VanChartHelper.SECOND_EDIT_AREA_WIDTH;
@ -111,6 +110,7 @@ public class VanChartMarkerPane extends BasicPane {
commonMarkerPane.populateBean(marker); commonMarkerPane.populateBean(marker);
} else { } else {
imageMarkerPane.populateBean(marker); imageMarkerPane.populateBean(marker);
commonMarkerPane.setDefaultValue();
} }
checkCenterPane(); checkCenterPane();

4
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -6,7 +6,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner; import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.gui.xcombox.MarkerComboBox; import com.fr.design.gui.xcombox.MarkerComboBox;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
@ -154,6 +153,9 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
return "commonMarker"; return "commonMarker";
} }
public void setDefaultValue() {
}
@Override @Override
public void populateBean(VanChartAttrMarker marker) { public void populateBean(VanChartAttrMarker marker) {
if(marker == null){ if(marker == null){

14
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttCommonMarkerPane.java

@ -4,11 +4,11 @@ import com.fr.base.background.ColorBackground;
import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.Marker;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.marker.type.MarkerType; import com.fr.plugin.chart.marker.type.MarkerType;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane; import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
import java.awt.Color;
import java.awt.Component; import java.awt.Component;
/** /**
@ -44,6 +44,16 @@ public class VanChartGanttCommonMarkerPane extends VanChartCommonMarkerPane {
@Override @Override
protected void updateColor(VanChartAttrMarker marker) { protected void updateColor(VanChartAttrMarker marker) {
marker.setColorBackground(ColorBackground.getInstance(colorSelect.getSelectObject())); Color color = colorSelect.getSelectObject();
color = color == null ? new Color(248, 182, 44) : color;
marker.setColorBackground(ColorBackground.getInstance(color));
}
@Override
public void setDefaultValue() {
getMarkerPane().setSelectedMarker(Marker.createMarker(MarkerType.MARKER_STAR));
colorSelect.setSelectObject(new Color(248, 182, 44));
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/style/series/VanChartGanttSeriesPane.java

@ -9,12 +9,12 @@ import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent; import com.fr.design.mainframe.chart.gui.ColorSelectBoxWithOutTransparent;
import com.fr.plugin.chart.base.VanChartAttrMarker; import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.stable.CoreConstants; import com.fr.stable.CoreConstants;
import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartMarkerPane; import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane; import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -82,7 +82,7 @@ public class VanChartGanttSeriesPane extends VanChartAbstractPlotSeriesPane {
protected JPanel createMarkerPane() { protected JPanel createMarkerPane() {
markerPane = new VanChartMarkerPane(){ markerPane = new VanChartMarkerPane(){
@Override @Override
protected BasicBeanPane<VanChartAttrMarker> createCommonMarkerPane() { protected VanChartCommonMarkerPane createCommonMarkerPane() {
return new VanChartGanttCommonMarkerPane(); return new VanChartGanttCommonMarkerPane();
} }

Loading…
Cancel
Save