Browse Source

CHART-2407 图表配色

master
zheng 6 years ago
parent
commit
e708fc16a2
  1. 4
      designer-chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  2. 7
      designer-chart/src/com/fr/design/mainframe/chart/gui/type/AbstractChartTypePane.java
  3. 10
      designer-chart/src/com/fr/design/module/ChartPreStyleAction.java
  4. 3
      designer-chart/src/com/fr/design/module/ChartPreStyleManagerPane.java
  5. 14
      designer-chart/src/com/fr/design/module/ChartPreStylePane.java

4
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,7 +197,7 @@ 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();

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();
} }

Loading…
Cancel
Save