Browse Source

Merge pull request #1081 in BA/design from CHART/design:release/9.0 to release/9.0

* commit 'be3c8aa5945b9c68784ac1ce0e35e581454b48db': (25 commits)
  地图获取参数&phantom request image end callback repaint
  update
  chart demo image
  坐标轴系列等面板
  .DS_Store
  9.0面板修改
  修改方法
  修改方法名称
  条件属性存取classpath
  重命名类名
  9.0新图表配置面板调整
  修改类名称
  修改FormatPane 4 vanchart
  调整一下标题和图例的显示策略部分
  9.0新图表面板调整: 1、样式:标签面板 2、样式:提示面板 3、样式:数据表面板
  修改方法名称
  update
  添加地图数据目录
  删掉部分代码
  修改继承关系
  ...
master
superman 7 years ago
parent
commit
f6997f0fc3
  1. 3
      designer/src/com/fr/start/Designer.java
  2. 14
      designer_base/src/com/fr/design/actions/core/ActionFactory.java
  3. 30
      designer_base/src/com/fr/design/dialog/BasicScrollPane.java
  4. 44
      designer_base/src/com/fr/design/file/HistoryTemplateListPane.java
  5. 2
      designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java
  6. 21
      designer_base/src/com/fr/design/gui/style/FormatPane.java
  7. 113
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java
  8. 2
      designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java
  9. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/area.png
  10. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/bar.png
  11. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/bubble.png
  12. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/column.png
  13. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/custom.png
  14. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/drillmap.png
  15. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/funnel.png
  16. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/gantt.png
  17. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/gauge.png
  18. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/heatmap.png
  19. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/line.png
  20. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/map.png
  21. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/multiPie.png
  22. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/pie.png
  23. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/radar.png
  24. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/scatter.png
  25. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/structure.png
  26. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/treeMap.png
  27. BIN
      designer_chart/src/com/fr/design/images/form/toolbar/wordcloud.png
  28. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_Drill_Map.png
  29. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewBubble.png
  30. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewCustom.png
  31. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewFunnel.png
  32. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGantt.png
  33. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGauge.png
  34. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewHeatMap.png
  35. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMap.png
  36. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png
  37. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewRadar.png
  38. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewScatter.png
  39. BIN
      designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png
  40. 9
      designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java
  41. 5
      designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java
  42. 44
      designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java
  43. 10
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java
  44. 38
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java
  45. 28
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java
  46. 31
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java
  47. 4
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java
  48. 40
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java
  49. 3
      designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/XYScatterSeriesPane.java
  50. 93
      designer_chart/src/com/fr/design/module/ChartDesignerModule.java
  51. 40
      designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java
  52. 96
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java
  53. 95
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java
  54. 51
      designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java
  55. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/area.png
  56. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/custom.png
  57. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/percentStack.png
  58. BIN
      designer_chart/src/com/fr/plugin/chart/area/images/stack.png
  59. 56
      designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java
  60. 96
      designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java
  61. 23
      designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java
  62. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/bar.png
  63. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/custom.png
  64. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/percentstack.png
  65. BIN
      designer_chart/src/com/fr/plugin/chart/bar/images/stack.png
  66. 85
      designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java
  67. 94
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java
  68. 22
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java
  69. 27
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java
  70. 171
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java
  71. 92
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java
  72. 57
      designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java
  73. 74
      designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java
  74. 184
      designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java
  75. 28
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java
  76. 23
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java
  77. 26
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java
  78. 19
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java
  79. 18
      designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java
  80. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/bubble.png
  81. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/force.png
  82. BIN
      designer_chart/src/com/fr/plugin/chart/bubble/images/large.png
  83. 43
      designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java
  84. 36
      designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java
  85. 93
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java
  86. 34
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java
  87. 96
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java
  88. 194
      designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java
  89. 143
      designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java
  90. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/column.png
  91. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/custom.png
  92. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/percentstack.png
  93. BIN
      designer_chart/src/com/fr/plugin/chart/column/images/stack.png
  94. 56
      designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java
  95. 134
      designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java
  96. 66
      designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomDataPane.java
  97. 175
      designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotDataContentsTabPane.java
  98. 296
      designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java
  99. 27
      designer_chart/src/com/fr/plugin/chart/custom/component/CategoryCustomPlotTableDataContentPane.java
  100. 103
      designer_chart/src/com/fr/plugin/chart/custom/component/ChartImageCheckOutPane.java
  101. Some files were not shown because too many files have changed in this diff Show More

3
designer/src/com/fr/start/Designer.java

@ -116,6 +116,9 @@ public class Designer extends BaseDesigner {
if (ActionFactory.getChartPreStyleAction() != null) { if (ActionFactory.getChartPreStyleAction() != null) {
menuDef.addShortCut(ActionFactory.getChartPreStyleAction()); menuDef.addShortCut(ActionFactory.getChartPreStyleAction());
} }
if (ActionFactory.getChartMapEditorAction() != null) {
menuDef.addShortCut(ActionFactory.getChartMapEditorAction());
}
} }
insertMenu(menuDef, MenuHandler.SERVER); insertMenu(menuDef, MenuHandler.SERVER);

14
designer_base/src/com/fr/design/actions/core/ActionFactory.java

@ -32,6 +32,8 @@ public class ActionFactory {
private static UpdateAction chartPreStyleAction = null; private static UpdateAction chartPreStyleAction = null;
private static UpdateAction chartMapEditorAction = null;
/** /**
* 待说明 * 待说明
* *
@ -69,6 +71,18 @@ public class ActionFactory {
return chartPreStyleAction; return chartPreStyleAction;
} }
/**
* 注册图表的 地图资源
* @param action 地图资源action
*/
public static void registerChartMapEditorAction(UpdateAction action) {
chartMapEditorAction = action;
}
public static UpdateAction getChartMapEditorAction() {
return chartMapEditorAction;
}
/** /**
* kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册. * kunsnat: 图表注册 悬浮元素编辑器 , 因为ChartCollecion和ChartQuickEditor一个在Chart,一个在Designer, 所以分开注册.
* *

30
designer_base/src/com/fr/design/dialog/BasicScrollPane.java

@ -1,23 +1,15 @@
package com.fr.design.dialog; package com.fr.design.dialog;
import java.awt.AWTEvent; import com.fr.design.beans.BasicBeanPane;
import java.awt.Color; import com.fr.design.gui.iscrollbar.UIScrollBar;
import java.awt.Component;
import java.awt.Container; import javax.swing.*;
import java.awt.Dimension; import java.awt.*;
import java.awt.LayoutManager;
import java.awt.event.AdjustmentEvent; import java.awt.event.AdjustmentEvent;
import java.awt.event.AdjustmentListener; import java.awt.event.AdjustmentListener;
import java.awt.event.MouseWheelEvent; import java.awt.event.MouseWheelEvent;
import java.awt.event.MouseWheelListener; import java.awt.event.MouseWheelListener;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import javax.swing.JScrollBar;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.iscrollbar.UIScrollBar;
public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = -4293765343535336275L; private static final long serialVersionUID = -4293765343535336275L;
private static final int MAXVALUE = 100; private static final int MAXVALUE = 100;
@ -119,7 +111,7 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
/** /**
* august:不容易啊 还要用笔画图立个方程才计算出来 * august:不容易啊 还要用笔画图立个方程才计算出来
* *
* @param e * @param
*/ */
protected void ajustValues() { protected void ajustValues() {
doLayout(); doLayout();
@ -170,6 +162,13 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
beginY = value * (preferheight - maxheight) / (MAXVALUE - scrollBar.getVisibleAmount()); beginY = value * (preferheight - maxheight) / (MAXVALUE - scrollBar.getVisibleAmount());
} }
} }
setLeftContentPaneBounds(parent, scrollBar, beginY, maxheight);
leftcontentPane.validate();
}
}
protected void setLeftContentPaneBounds(Container parent, UIScrollBar scrollBar, int beginY, int maxheight) {
int width = parent.getWidth(); int width = parent.getWidth();
int height = parent.getHeight(); int height = parent.getHeight();
if (leftcontentPane.getPreferredSize().height > maxheight) { if (leftcontentPane.getPreferredSize().height > maxheight) {
@ -178,9 +177,6 @@ public abstract class BasicScrollPane<T> extends BasicBeanPane<T>{
} else { } else {
leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height); leftcontentPane.setBounds(0, 0, width - DET_WIDTH, height);
} }
leftcontentPane.validate();
}
} }
protected boolean isShowScrollBar() { protected boolean isShowScrollBar() {

44
designer_base/src/com/fr/design/file/HistoryTemplateListPane.java

@ -1,31 +1,20 @@
package com.fr.design.file; package com.fr.design.file;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.*;
import java.util.List;
import java.util.logging.Level;
import javax.swing.*;
import com.fr.design.constants.UIConstants;
import com.fr.design.DesignerEnvManager;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.gui.ilable.UILabel;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import com.fr.base.FRContext; import com.fr.base.FRContext;
import com.fr.design.data.datapane.TableDataTreePane; import com.fr.base.chart.chartdata.CallbackEvent;
import com.fr.dav.LocalEnv; import com.fr.dav.LocalEnv;
import com.fr.design.DesignModelAdapter; import com.fr.design.DesignModelAdapter;
import com.fr.design.DesignerEnvManager;
import com.fr.design.constants.UIConstants;
import com.fr.design.data.DesignTableDataManager;
import com.fr.design.data.datapane.TableDataTreePane;
import com.fr.design.gui.icontainer.UIScrollPane; import com.fr.design.gui.icontainer.UIScrollPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ilist.UIList; import com.fr.design.gui.ilist.UIList;
import com.fr.design.mainframe.DesignerContext; import com.fr.design.mainframe.DesignerContext;
import com.fr.design.mainframe.JTemplate; import com.fr.design.mainframe.JTemplate;
import com.fr.design.module.DesignModuleFactory; import com.fr.design.module.DesignModuleFactory;
import com.fr.design.utils.gui.GUIPaintUtils;
import com.fr.file.filetree.FileNode; import com.fr.file.filetree.FileNode;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
@ -33,9 +22,19 @@ import com.fr.general.GeneralContext;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.project.ProjectConstants; import com.fr.stable.project.ProjectConstants;
import com.fr.design.utils.gui.GUIPaintUtils;
public class HistoryTemplateListPane extends JPanel implements FileOperations { import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.logging.Level;
public class HistoryTemplateListPane extends JPanel implements FileOperations, CallbackEvent{
private static final int LIST_BORDER = 4; private static final int LIST_BORDER = 4;
private List<JTemplate<?, ?>> historyList; private List<JTemplate<?, ?>> historyList;
private JTemplate<?, ?> editingTemplate; private JTemplate<?, ?> editingTemplate;
@ -228,6 +227,11 @@ public class HistoryTemplateListPane extends JPanel implements FileOperations {
return ComparatorUtils.equals(filename, editingFileName); return ComparatorUtils.equals(filename, editingFileName);
} }
@Override
public void callback() {
getCurrentEditingTemplate().repaint();
}
private class HistoryListCellRender extends DefaultListCellRenderer { private class HistoryListCellRender extends DefaultListCellRenderer {

2
designer_base/src/com/fr/design/gui/frpane/AbstractAttrNoScrollPane.java

@ -1,10 +1,10 @@
package com.fr.design.gui.frpane; package com.fr.design.gui.frpane;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.GlobalNameListener; import com.fr.design.event.GlobalNameListener;
import com.fr.design.event.GlobalNameObserver; import com.fr.design.event.GlobalNameObserver;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.dialog.BasicPane;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;

21
designer_base/src/com/fr/design/gui/style/FormatPane.java

@ -113,12 +113,7 @@ public class FormatPane extends AbstractBasicStylePane {
centerPane.setBorder(LEFT_BORDER); centerPane.setBorder(LEFT_BORDER);
frFontPane.setBorder(LEFT_BORDER); frFontPane.setBorder(LEFT_BORDER);
Component[][] components = new Component[][]{ Component[][] components = getComponent(fontPane, centerPane, typePane);
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{null, centerPane},
new Component[]{fontPane, frFontPane},
};
double[] rowSize = {p, p, p, p, p}; double[] rowSize = {p, p, p, p, p};
double[] columnSize = {p, f}; double[] columnSize = {p, f};
int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}}; int[][] rowCount = {{1, 1}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
@ -126,6 +121,16 @@ public class FormatPane extends AbstractBasicStylePane {
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
} }
protected Component[][] getComponent (JPanel fontPane, JPanel centerPane, JPanel typePane) {
return new Component[][]{
new Component[]{null, null},
new Component[]{new UILabel(Inter.getLocText("FR-Base_Format"), SwingConstants.LEFT), typePane},
new Component[]{null, centerPane},
new Component[]{fontPane, frFontPane},
};
}
protected UIComboBoxRenderer createComBoxRender() { protected UIComboBoxRenderer createComBoxRender() {
return new UIComboBoxRenderer() { return new UIComboBoxRenderer() {
@Override @Override
@ -383,6 +388,10 @@ public class FormatPane extends AbstractBasicStylePane {
}; };
typeComboBox.setRenderer(render); typeComboBox.setRenderer(render);
typeComboBox.addItemListener(itemListener); typeComboBox.addItemListener(itemListener);
setTypeComboBoxPane(typeComboBox);
}
protected void setTypeComboBoxPane (UIComboBox typeComboBox) {
this.add(typeComboBox, BorderLayout.NORTH); this.add(typeComboBox, BorderLayout.NORTH);
} }

113
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -9,8 +9,25 @@ import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.chart.fun.IndependentChartUIProvider; import com.fr.design.chart.fun.IndependentChartUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.*; import com.fr.design.chartinterface.AreaIndependentChartInterface;
import com.fr.design.chartinterface.BarIndependentChartInterface;
import com.fr.design.chartinterface.BubbleIndependentChartInterface;
import com.fr.design.chartinterface.ColumnIndependentChartInterface;
import com.fr.design.chartinterface.CustomIndependentChartInterface;
import com.fr.design.chartinterface.DonutIndependentChartInterface;
import com.fr.design.chartinterface.FunnelIndependentChartInterface;
import com.fr.design.chartinterface.GanttIndependentChartInterface;
import com.fr.design.chartinterface.GisMapIndependentChartInterface;
import com.fr.design.chartinterface.LineIndependentChartInterface;
import com.fr.design.chartinterface.MapIndependentChartInterface;
import com.fr.design.chartinterface.MeterIndependentChartInterface;
import com.fr.design.chartinterface.PieIndependentChartInterface;
import com.fr.design.chartinterface.RadarIndependentChartInterface;
import com.fr.design.chartinterface.RangeIndependentChartInterface;
import com.fr.design.chartinterface.StockIndependentChartInterface;
import com.fr.design.chartinterface.XYScatterIndependentChartInterface;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.file.HistoryTemplateListPane;
import com.fr.design.gui.core.WidgetOption; import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
@ -25,20 +42,58 @@ import com.fr.form.ui.ChartEditor;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.context.PluginContext; import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.injectable.PluginModule; import com.fr.plugin.chart.area.AreaIndependentVanChartInterface;
import com.fr.plugin.chart.area.VanChartAreaPlot;
import com.fr.plugin.chart.bar.BarIndependentVanChartInterface;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChartInterface;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.column.ColumnIndependentVanChartInterface;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.custom.CustomIndependentVanChartInterface;
import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChartInterface;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
import com.fr.plugin.chart.funnel.designer.FunnelIndependentVanChartInterface;
import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.plugin.chart.gantt.designer.GanttIndependentVanChartInterface;
import com.fr.plugin.chart.gauge.GaugeIndependentVanChartInterface;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot;
import com.fr.plugin.chart.heatmap.designer.HeatMapIndependentVanChartInterface;
import com.fr.plugin.chart.line.LineIndependentVanChartInterface;
import com.fr.plugin.chart.line.VanChartLinePlot;
import com.fr.plugin.chart.map.MapIndependentVanChartInterface;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChartInterface;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
import com.fr.plugin.chart.pie.PieIndependentVanChartInterface;
import com.fr.plugin.chart.radar.RadarIndependentVanChartInterface;
import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.scatter.ScatterIndependentVanChartInterface;
import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import com.fr.plugin.chart.structure.VanChartStructurePlot;
import com.fr.plugin.chart.structure.desinger.StructureIndependentVanChartInterface;
import com.fr.plugin.chart.treemap.TreeMapIndependentVanChartInterface;
import com.fr.plugin.chart.treemap.VanChartTreeMapPlot;
import com.fr.plugin.chart.vanchart.imgevent.design.DesignImageEvent;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.chart.wordcloud.designer.WordCloudIndependentVanChartInterface;
import com.fr.plugin.injectable.PluginSingleInjection; import com.fr.plugin.injectable.PluginSingleInjection;
import com.fr.plugin.manage.PluginFilter;
import com.fr.plugin.observer.PluginEvent;
import com.fr.plugin.observer.PluginEventListener;
import com.fr.plugin.solution.closeable.CloseableContainedMap; import com.fr.plugin.solution.closeable.CloseableContainedMap;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.EnvChangedListener;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.stable.bridge.StableFactory; import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*; import javax.swing.*;
import java.util.*; import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
/** /**
* Created by eason on 14/12/29. * Created by eason on 14/12/29.
@ -58,24 +113,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
static { static {
readDefault(); readDefault();
readVanChart();
StableFactory.registerMarkedObject(XML_TAG, classManager); StableFactory.registerMarkedObject(XML_TAG, classManager);
} }
static { static {
GeneralContext.listenPluginRunningChanged(new PluginEventListener() { GeneralContext.addEnvChangedListener(new EnvChangedListener() {
@Override @Override
public void on(PluginEvent event) { public void envChanged() {
//重新注册designModuleFactory //重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption()); DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
} DesignImageEvent.registerDefaultCallbackEvent(HistoryTemplateListPane.getInstance());
}, new PluginFilter() {
@Override
public boolean accept(PluginContext context) {
return context.contain(PluginModule.ExtraChartType);
} }
}); });
} }
@ -131,6 +180,36 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
} }
} }
private static void readVanChart() {
if (chartTypeInterfaces.containsKey(ChartTypeManager.VAN_CHART_PRIORITY)) {
return;
}
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList =
new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class);
chartUIList.put(PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface());
chartUIList.put(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface());
chartUIList.put(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface());
chartUIList.put(VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface());
chartUIList.put(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface());
chartUIList.put(VanChartGaugePlot.VAN_CHART_GAUGE_PLOT, new GaugeIndependentVanChartInterface());
chartUIList.put(VanChartRadarPlot.VAN_CHART_RADAR_PLOT, new RadarIndependentVanChartInterface());
chartUIList.put(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID, new ScatterIndependentVanChartInterface());
chartUIList.put(VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface());
chartUIList.put(VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface());
chartUIList.put(VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface());
chartUIList.put(VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface());
chartUIList.put(VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface());
chartUIList.put(VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface());
chartUIList.put(VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface());
chartUIList.put(VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface());
chartUIList.put(VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface());
chartUIList.put(VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface());
chartUIList.put(VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface());
chartTypeInterfaces.put(ChartTypeManager.VAN_CHART_PRIORITY, chartUIList);
}
private static void readDefault() { private static void readDefault() {

2
designer_chart/src/com/fr/design/chart/axis/MinMaxValuePane.java

@ -81,7 +81,7 @@ public class MinMaxValuePane extends JPanel {
}; };
} }
private void checkBoxUse() { protected void checkBoxUse() {
minValueField.setEnabled(minCheckBox.isSelected()); minValueField.setEnabled(minCheckBox.isSelected());
maxValueField.setEnabled(maxCheckBox.isSelected()); maxValueField.setEnabled(maxCheckBox.isSelected());

BIN
designer_chart/src/com/fr/design/images/form/toolbar/area.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 374 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/bar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/bubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 493 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/column.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/drillmap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/funnel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 276 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/gantt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/gauge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/heatmap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 750 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/line.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/map.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/multiPie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/pie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 372 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/radar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 723 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/scatter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 429 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/structure.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

BIN
designer_chart/src/com/fr/design/images/form/toolbar/treeMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

BIN
designer_chart/src/com/fr/design/images/form/toolbar/wordcloud.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 654 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_Drill_Map.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewBubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewCustom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 306 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewFunnel.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGantt.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewGauge.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 559 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewHeatMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 423 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewMultiPie.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 861 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewRadar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1002 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewScatter.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 329 B

BIN
designer_chart/src/com/fr/design/images/poly/toolbar/Plugin-ChartF_NewTreeMap.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 269 B

9
designer_chart/src/com/fr/design/mainframe/chart/AbstractChartAttrPane.java

@ -4,6 +4,9 @@ package com.fr.design.mainframe.chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import javax.swing.*;
import java.awt.*;
public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane { public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
public abstract void populate(ChartCollection collection); public abstract void populate(ChartCollection collection);
@ -25,6 +28,12 @@ public abstract class AbstractChartAttrPane extends AbstractAttrNoScrollPane {
} }
protected void initContentPane() {
leftContentPane = createContentPane();
leftContentPane.setBorder(BorderFactory.createMatteBorder(10, 0, 0, 0, original));
this.add(leftContentPane, BorderLayout.CENTER);
}
/** /**
* 刷新图表数据界面 * 刷新图表数据界面
* @param collection 图表收集器 * @param collection 图表收集器

5
designer_chart/src/com/fr/design/mainframe/chart/ChartEditPane.java

@ -1,7 +1,6 @@
package com.fr.design.mainframe.chart; package com.fr.design.mainframe.chart;
import com.fr.base.BaseUtils;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
@ -74,12 +73,12 @@ public class ChartEditPane extends BasicPane implements AttributeChange,Prepare4
//构建主面板 //构建主面板
protected void createTabsPane() { protected void createTabsPane() {
Icon[] iconArray = new Icon[paneList.size()]; String[] iconArray = new String[paneList.size()];
card = new CardLayout(); card = new CardLayout();
center = new JPanel(card); center = new JPanel(card);
for (int i = 0; i < paneList.size(); i++) { for (int i = 0; i < paneList.size(); i++) {
AbstractChartAttrPane pane = paneList.get(i); AbstractChartAttrPane pane = paneList.get(i);
iconArray[i] = BaseUtils.readIcon(pane.getIconPath()); iconArray[i] = pane.title4PopupWindow();
center.add(pane, pane.title4PopupWindow()); center.add(pane, pane.title4PopupWindow());
} }

44
designer_chart/src/com/fr/design/mainframe/chart/gui/ChangeConfigPane.java

@ -4,9 +4,9 @@ package com.fr.design.mainframe.chart.gui;
* Created by hufan on 2016/10/20. * Created by hufan on 2016/10/20.
*/ */
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.base.AttrChangeConfig;
import com.fr.chart.base.AttrChangeType; import com.fr.chart.base.AttrChangeType;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
@ -15,6 +15,7 @@ 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.style.ChartTextAttrPane; import com.fr.design.mainframe.chart.gui.style.ChartTextAttrPane;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -55,11 +56,9 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p,p}; double[] rowSize = {p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style") + ":"),configStyleButton}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Change_Style")),configStyleButton},
new Component[]{null, null},
new Component[]{new JSeparator(), null},
new Component[]{configPane, null}, new Component[]{configPane, null},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
@ -84,6 +83,8 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
panel.add(buttonConfigPane, "button"); panel.add(buttonConfigPane, "button");
panel.add(carouselConfigPane, "carousel"); panel.add(carouselConfigPane, "carousel");
panel.setBorder(BorderFactory.createEmptyBorder(0,10,0,0));
return panel; return panel;
} }
@ -92,35 +93,33 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p,p,p}; double[] rowSize = {p,p,p};
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTimeIntervalPane(),null}, new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Time_Interval")), timeInterval},
new Component[]{new JSeparator(),null}, new Component[]{new UILabel(Inter.getLocText("Background")),colorSelectBox4carousel},
new Component[]{createCarouseBackgroundColorPane(),null},
}; };
return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); return TableLayout4VanChartHelper.createGapTableLayoutPane(components,rowSize,columnSize);
}
private Component createTimeIntervalPane() {
timeInterval = new UISpinner(MIN_TIME, MAX_TIME, 1, 0);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Time_Interval") + ":", timeInterval);
}
private JPanel createCarouseBackgroundColorPane() {
colorSelectBox4carousel = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4carousel);
} }
private JPanel createTitleStylePane(){ private JPanel createTitleStylePane(){
styleAttrPane = new ChartTextAttrPane(); styleAttrPane = new ChartTextAttrPane(){
protected Component[][] getComponents(JPanel buttonPane) {
return new Component[][]{
new Component[]{fontNameComboBox, null},
new Component[]{buttonPane, null}
};
}
};
styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight())); styleAttrPane.setPreferredSize(new Dimension(WIDTH, (int) styleAttrPane.getPreferredSize().getHeight()));
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style")+":", styleAttrPane); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Plugin-Chart_Character")+":", styleAttrPane);
} }
private JPanel createButtonBackgroundColorPane(){ private JPanel createButtonBackgroundColorPane(){
colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH); colorSelectBox4button = new ColorSelectBoxWithOutTransparent(WIDTH);
return TableLayoutHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Background") + ":", colorSelectBox4button); return TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("Background") + ":", colorSelectBox4button);
} }
private JPanel createButtonConfigPane() { private JPanel createButtonConfigPane() {
@ -130,7 +129,6 @@ public class ChangeConfigPane extends BasicBeanPane<ChartCollection> {
double[] rowSize = {p,p,p}; double[] rowSize = {p,p,p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{createTitleStylePane(),null}, new Component[]{createTitleStylePane(),null},
new Component[]{new JSeparator(),null},
new Component[]{createButtonBackgroundColorPane(),null}, new Component[]{createButtonBackgroundColorPane(),null},
}; };

10
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartFillStylePane.java

@ -97,6 +97,12 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
customPane.setPreferredSize(new Dimension(200, 130)); customPane.setPreferredSize(new Dimension(200, 130));
colorGradient.setPreferredSize(new Dimension(120, 30)); colorGradient.setPreferredSize(new Dimension(120, 30));
this.setLayout(new BorderLayout());
this.add(getContentPane(),BorderLayout.CENTER);
}
protected JPanel getContentPane () {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = { f };
@ -105,9 +111,7 @@ public class ChartFillStylePane extends BasicBeanPane<AttrFillStyle>{
new Component[]{styleSelectBox}, new Component[]{styleSelectBox},
new Component[]{customPane} new Component[]{customPane}
} ; } ;
JPanel panel = TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize); return TableLayoutHelper.createTableLayoutPane4Chart(new String[]{"ColorMatch"},components,rowSize,columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
} }
@Override @Override

38
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ChartTextAttrPane.java

@ -1,25 +1,23 @@
package com.fr.design.mainframe.chart.gui.style; package com.fr.design.mainframe.chart.gui.style;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Font;
import javax.swing.JPanel;
import com.fr.base.BaseUtils; import com.fr.base.BaseUtils;
import com.fr.base.Utils; import com.fr.base.Utils;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.design.constants.LayoutConstants; import com.fr.design.constants.LayoutConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIColorButton; import com.fr.design.gui.ibutton.UIColorButton;
import com.fr.design.gui.ibutton.UIToggleButton; import com.fr.design.gui.ibutton.UIToggleButton;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.dialog.BasicPane;
import com.fr.general.FRFont;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import javax.swing.*;
import java.awt.*;
public class ChartTextAttrPane extends BasicPane { public class ChartTextAttrPane extends BasicPane {
private static final long serialVersionUID = 6731679928019436869L; private static final long serialVersionUID = 6731679928019436869L;
@ -147,17 +145,23 @@ public class ChartTextAttrPane extends BasicPane {
buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST); buttonPane.add(GUICoreUtils.createFlowPane(components1, FlowLayout.LEFT, LayoutConstants.HGAP_LARGE), BorderLayout.EAST);
double[] columnSize = {f}; double[] columnSize = {p,f};
double[] rowSize = {p, p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[][]{
new Component[]{fontNameComboBox},
new Component[]{buttonPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); JPanel panel = TableLayout4VanChartHelper.createGapTableLayoutPane(getComponents(buttonPane), rowSize, columnSize);
this.setLayout(new BorderLayout()); this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER); this.add(panel, BorderLayout.CENTER);
populate(FRFont.getInstance()); populate(FRFont.getInstance());
} }
protected Component[][] getComponents(JPanel buttonPane) {
UILabel text = new UILabel(Inter.getLocText("Plugin-Chart_Character"), SwingConstants.LEFT);
return new Component[][]{
new Component[]{null, null},
new Component[]{text, fontNameComboBox},
new Component[]{null, buttonPane}
};
}
} }

28
designer_chart/src/com/fr/design/mainframe/chart/gui/style/ThirdTabPane.java

@ -1,24 +1,18 @@
package com.fr.design.mainframe.chart.gui.style; package com.fr.design.mainframe.chart.gui.style;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.Insets;
import java.util.List;
import javax.swing.JPanel;
import javax.swing.border.Border;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.design.constants.UIConstants;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane; import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.design.gui.ibutton.UIHeadGroup; import com.fr.design.gui.ibutton.UIHeadGroup;
import javax.swing.*;
import javax.swing.border.Border;
import java.awt.*;
import java.util.List;
public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
private static final long serialVersionUID = 2298609199400393886L; private static final long serialVersionUID = 2298609199400393886L;
@ -114,8 +108,8 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
protected static class NamePane { protected static class NamePane {
private String name; private String name;
private AbstractChartTabPane pane; private BasicScrollPane pane;
public NamePane(String name, AbstractChartTabPane pane) { public NamePane(String name, BasicScrollPane pane) {
this.name = name; this.name = name;
this.pane = pane; this.pane = pane;
} }
@ -125,10 +119,10 @@ public abstract class ThirdTabPane<T> extends BasicBeanPane<T>{
public void setName(String name) { public void setName(String name) {
this.name = name; this.name = name;
} }
public AbstractChartTabPane getPane() { public BasicScrollPane getPane() {
return pane; return pane;
} }
public void setPane(AbstractChartTabPane pane) { public void setPane(BasicScrollPane pane) {
this.pane = pane; this.pane = pane;
} }

31
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/AbstractPlotSeriesPane.java

@ -32,42 +32,47 @@ public abstract class AbstractPlotSeriesPane extends BasicBeanPane<Plot>{
this.parentPane = parent; this.parentPane = parent;
fillStylePane = getFillStylePane(); fillStylePane = getFillStylePane();
this.setLayout(new BorderLayout());
this.add(getContentPane(custom), BorderLayout.CENTER);
}
protected JPanel getContentPane(boolean custom) {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = { f }; double[] columnSize = {f};
double[] rowSize = { p,p,p}; double[] rowSize = {p, p, p};
Component[][] components = new Component[3][1]; Component[][] components = new Component[3][1];
if(custom) { JPanel panel;
if(!(plot instanceof Bar2DPlot)) {
if (custom) {
if (!(plot instanceof Bar2DPlot)) {
components[0] = new Component[]{getContentInPlotType()}; components[0] = new Component[]{getContentInPlotType()};
components[1] = new Component[]{new JSeparator()}; components[1] = new Component[]{new JSeparator()};
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
JScrollPane scrollPane = new JScrollPane(); JScrollPane scrollPane = new JScrollPane();
scrollPane.setViewportView(panel); scrollPane.setViewportView(panel);
scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER); scrollPane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_NEVER);
this.setLayout(new BorderLayout());
this.add(scrollPane, BorderLayout.CENTER);
} else { } else {
if(fillStylePane != null) { if (fillStylePane != null) {
components[0] = new Component[]{fillStylePane}; components[0] = new Component[]{fillStylePane};
components[1] = new Component[]{new JSeparator()}; components[1] = new Component[]{new JSeparator()};
} }
JPanel contentPane = getContentInPlotType(); JPanel contentPane = getContentInPlotType();
if(contentPane != null) { if (contentPane != null) {
components[2] = new Component[]{contentPane}; components[2] = new Component[]{contentPane};
} }
JPanel panel = TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel,BorderLayout.CENTER);
} }
panel.setBorder(BorderFactory.createEmptyBorder(0, 10, 0, 15));
return panel;
} }
/** /**

4
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/ChartSeriesPane.java

@ -3,9 +3,9 @@ package com.fr.design.mainframe.chart.gui.style.series;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.dialog.BasicScrollPane;
import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.PaneTitleConstants;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.designer.AbstractVanChartScrollPane;
import javax.swing.*; import javax.swing.*;
import java.awt.*; import java.awt.*;
@ -15,7 +15,7 @@ import java.awt.*;
* @author kunsnat E-mail:kunsnat@gmail.com * @author kunsnat E-mail:kunsnat@gmail.com
* @version 创建时间2013-1-5 上午10:31:50 * @version 创建时间2013-1-5 上午10:31:50
*/ */
public class ChartSeriesPane extends BasicScrollPane<Chart>{ public class ChartSeriesPane extends AbstractVanChartScrollPane<Chart> {
protected AbstractPlotSeriesPane seriesStyleContentPane; protected AbstractPlotSeriesPane seriesStyleContentPane;
protected Chart chart; protected Chart chart;

40
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/UIColorPickerPane.java

@ -1,27 +1,11 @@
package com.fr.design.mainframe.chart.gui.style.series; package com.fr.design.mainframe.chart.gui.style.series;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.Container;
import java.awt.Dimension;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.LayoutManager;
import java.awt.Point;
import java.awt.event.*;
import java.util.ArrayList;
import java.util.List;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import com.fr.base.Formula; import com.fr.base.Formula;
import com.fr.chart.base.AreaColor; import com.fr.chart.base.AreaColor;
import com.fr.chart.base.ChartBaseUtils; import com.fr.chart.base.ChartBaseUtils;
import com.fr.chart.chartglyph.MapHotAreaColor; import com.fr.chart.chartglyph.MapHotAreaColor;
import com.fr.design.constants.UIConstants; import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
@ -31,12 +15,20 @@ import com.fr.design.gui.ipoppane.PopupHider;
import com.fr.design.layout.TableLayout; 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.dialog.BasicPane;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import com.fr.design.style.color.ColorControlWindow; import com.fr.design.style.color.ColorControlWindow;
import com.fr.design.style.color.ColorSelectBox; import com.fr.design.style.color.ColorSelectBox;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.ArrayList;
import java.util.List;
public class UIColorPickerPane extends BasicPane implements UIObserver { public class UIColorPickerPane extends BasicPane implements UIObserver {
private static final int MARGIN_TOP = 10; private static final int MARGIN_TOP = 10;
@ -105,11 +97,10 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
double f = TableLayout.FILL; double f = TableLayout.FILL;
double[] columnSize = {p, f}; double[] columnSize = {p, f};
double[] rowSize = {p, p, p};
Component[][] components = createComponents(); Component[][] components = createComponents();
upControlPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); upControlPane = TableLayoutHelper.createTableLayoutPane(components, getRowSIze (), columnSize);
this.textFieldList = this.getTextFieldList(); this.textFieldList = this.getTextFieldList();
this.textGroup = new TextFieldGroupPane(); this.textGroup = new TextFieldGroupPane();
@ -122,6 +113,11 @@ public class UIColorPickerPane extends BasicPane implements UIObserver {
refreshGroupPane(colors, getValueArray(number)); refreshGroupPane(colors, getValueArray(number));
} }
protected double[] getRowSIze () {
double p = TableLayout.PREFERRED;
return new double[]{p, p, p};
}
protected UIButtonGroup<Integer> getDesignTypeButtonGroup(){ protected UIButtonGroup<Integer> getDesignTypeButtonGroup(){
return designTypeButtonGroup; return designTypeButtonGroup;
} }

3
designer_chart/src/com/fr/design/mainframe/chart/gui/style/series/XYScatterSeriesPane.java

@ -10,6 +10,7 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.Marker; import com.fr.chart.chartglyph.Marker;
import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.ConfigHelper;
/** /**
* 散点图 属性表 系列界面. * 散点图 属性表 系列界面.
@ -57,7 +58,7 @@ public class XYScatterSeriesPane extends LineSeriesPane {
attrList.remove(attr); attrList.remove(attr);
} }
if(!ComparatorUtils.equals(markerPane.getSelectedMarkder().getMarkerType(), Marker.NULL_M)){ if(!ComparatorUtils.equals(markerPane.getSelectedMarkder().getMarkerType(), ConfigHelper.NULL_M)){
attrList.addDataSeriesCondition(new AttrMarkerType(markerPane.getSelectedMarkder().getMarkerType())); attrList.addDataSeriesCondition(new AttrMarkerType(markerPane.getSelectedMarkder().getMarkerType()));
} }
} }

93
designer_chart/src/com/fr/design/module/ChartDesignerModule.java

@ -1 +1,92 @@
package com.fr.design.module; import com.fr.chart.base.ChartInternationalNameContentBean; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.actions.core.ActionFactory; import com.fr.design.chart.ChartDialog; import com.fr.design.chart.gui.ChartComponent; import com.fr.design.chart.gui.ChartWidgetOption; import com.fr.design.gui.core.WidgetOption; import com.fr.design.mainframe.App; import com.fr.design.mainframe.ChartPropertyPane; import com.fr.form.ui.ChartEditor; import com.fr.general.IOUtils; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import com.fr.stable.bridge.StableFactory; import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; import javax.swing.*; /** * Created by IntelliJ IDEA. * Author : Richer * Version: 7.0.3 * Date: 13-7-8 * Time: 上午9:13 */ public class ChartDesignerModule extends DesignModule { public void start() { super.start(); dealBeforeRegister(); register(); registerFloatEditor(); } protected void dealBeforeRegister(){ StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class); StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class); } private void register(){ DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup()); DesignModuleFactory.registerChartEditorClass(ChartEditor.class); DesignModuleFactory.registerChartComponentClass(ChartComponent.class); DesignModuleFactory.registerChartDialogClass(ChartDialog.class); DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class); ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction()); } protected void registerFloatEditor() { ActionFactory.registerChartCollection(ChartCollection.class); } /** * 返回设计器能打开的模板类型的一个数组列表 * * @return 可以打开的模板类型的数组 */ public App<?>[] apps4TemplateOpener() { return new App[0]; } protected WidgetOption[] options4Show() { ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; for (int i = 0; i < typeName.length; i++) { String plotID = typeName[i].getPlotID(); Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); if (ArrayUtils.isEmpty(rowChart)) { continue; } String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); Icon icon = IOUtils.readIcon(iconPath); child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]); } return child; } public String getInterNationalName() { return Inter.getLocText("FR-Chart-Design_ChartModule"); } } package com.fr.design.module;
import com.fr.chart.base.ChartInternationalNameContentBean;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.charttypes.ChartTypeManager;
import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.actions.core.ActionFactory;
import com.fr.design.chart.ChartDialog;
import com.fr.design.chart.gui.ChartComponent;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.mainframe.App;
import com.fr.design.mainframe.ChartPropertyPane;
import com.fr.form.ui.ChartEditor;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.map.server.ChartMapEditorAction;
import com.fr.stable.ArrayUtils;
import com.fr.stable.bridge.StableFactory;
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider;
import javax.swing.*;
/**
* Created by IntelliJ IDEA.
* Author : Richer
* Version: 7.0.3
* Date: 13-7-8
* Time: 上午9:13
*/
public class ChartDesignerModule extends DesignModule {
public void start() {
super.start();
dealBeforeRegister();
register();
registerFloatEditor();
}
protected void dealBeforeRegister(){
StableFactory.registerMarkedClass(ExtraChartDesignClassManagerProvider.XML_TAG, ChartTypeInterfaceManager.class);
StableFactory.getStaticMarkedInstanceObjectFromClass(ExtraChartDesignClassManagerProvider.XML_TAG, ExtraChartDesignClassManagerProvider.class);
}
private void register(){
DesignModuleFactory.registerHyperlinkGroupType(new ChartHyperlinkGroup());
DesignModuleFactory.registerChartEditorClass(ChartEditor.class);
DesignModuleFactory.registerChartComponentClass(ChartComponent.class);
DesignModuleFactory.registerChartDialogClass(ChartDialog.class);
DesignModuleFactory.registerChartPropertyPaneClass(ChartPropertyPane.class);
ActionFactory.registerChartPreStyleAction(new ChartPreStyleAction());
ActionFactory.registerChartMapEditorAction(new ChartMapEditorAction());
}
protected void registerFloatEditor() {
ActionFactory.registerChartCollection(ChartCollection.class);
}
/**
* 返回设计器能打开的模板类型的一个数组列表
*
* @return 可以打开的模板类型的数组
*/
public App<?>[] apps4TemplateOpener() {
return new App[0];
}
protected WidgetOption[] options4Show() {
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if (ArrayUtils.isEmpty(rowChart)) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
public String getInterNationalName() {
return Inter.getLocText("FR-Chart-Design_ChartModule");
}
}

40
designer_chart/src/com/fr/plugin/chart/area/AreaIndependentVanChartInterface.java

@ -0,0 +1,40 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/11/18.
*/
public class AreaIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/area.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartAreaPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartAreaConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartAreaSeriesPane(parent, plot);
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartAreaPlotPane.TITLE;
}
}

96
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaConditionPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.area;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrAreaSeriesFillColorBackground;
import com.fr.plugin.chart.base.AttrDataSheet;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartAttrMarker;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.other.condition.item.VanChartAreaFillColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLineTypeConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartMarkerConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane;
import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint;
import com.fr.plugin.chart.scatter.large.VanChartLargeModelMarkerConditionPane;
import java.awt.*;
/**
* Created by Mitisky on 15/11/18.
*/
public class VanChartAreaConditionPane extends DataSeriesConditionPane {
private static final long serialVersionUID = -7180705321732069806L;
public VanChartAreaConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this));
classPaneMap.put(AttrAreaSeriesFillColorBackground.class, new VanChartAreaFillColorConditionPane(this, plot));
classPaneMap.put(VanChartAttrLine.class, new VanChartLineTypeConditionPane(this));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
//是否使用数据表
if (plot.getDataSheet().isVisible()) {
classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot));
}
if(PlotFactory.largeDataModel(plot)){
classPaneMap.put(VanChartAttrMarker.class, new VanChartLargeModelMarkerConditionPane(this));
} else {
classPaneMap.put(VanChartAttrMarker.class, new VanChartMarkerConditionPane(this));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getAreaPlotDefaultEffect()));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
}
}
protected void addStyleAction() {
}
@Override
protected ChartConditionPane createListConditionPane() {
return new ChartConditionPane(){
@Override
public String[] columns2Populate() {
return new String[]{
ChartConstants.CATEGORY_INDEX,
ChartConstants.CATEGORY_NAME,
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
ChartConstants.VALUE,
VanChartMultiCategoryDataPoint.CATEGORY_ARRAY,
};
}
};
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartAreaPlot.class;
}
}

95
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaPlotPane.java

@ -0,0 +1,95 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/11/18.
*/
public class VanChartAreaPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewArea");
private static final long serialVersionUID = -8161581682558781651L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/area/images/area.png",
"/com/fr/plugin/chart/area/images/stack.png",
"/com/fr/plugin/chart/area/images/percentStack.png",
"/com/fr/plugin/chart/area/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String area = Inter.getLocText("FR-Chart-Type_Area");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
area,
stack + area,
percent + stack + area,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewArea");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartAreaPlot) {
lastTypeIndex = ((VanChartAreaPlot) plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartAreaPlot newPlot = null;
Chart[] areaChart = AreaIndependentVanChart.AreaVanChartTypes;
for(int i = 0, len = areaChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartAreaPlot)areaChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In AreaChart");
}
return cloned;
}
public Chart getDefaultChart() {
return AreaIndependentVanChart.AreaVanChartTypes[0];
}
}

51
designer_chart/src/com/fr/plugin/chart/area/VanChartAreaSeriesPane.java

@ -0,0 +1,51 @@
package com.fr.plugin.chart.area;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.plugin.chart.column.VanChartCustomStackAndAxisConditionPane;
import com.fr.plugin.chart.line.VanChartLineSeriesPane;
import javax.swing.*;
import java.awt.*;
public class VanChartAreaSeriesPane extends VanChartLineSeriesPane{
private static final long serialVersionUID = 5497989595104913025L;
public VanChartAreaSeriesPane(ChartStylePane parent, Plot plot){
super(parent, plot);
}
protected JPanel getContentInPlotType(){
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p,p,p,p,p,p,p,p,p,p,p,p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createStylePane()},
new Component[]{stylePane == null ? null : new JSeparator()},
new Component[]{createLineTypePane()},
new Component[]{new JSeparator()},
new Component[]{createMarkerPane()},
new Component[]{new JSeparator()},
new Component[]{createAreaFillColorPane()},
new Component[]{new JSeparator()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createLargeDataModelPane()},
new Component[]{new JSeparator()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomStackAndAxisConditionPane.class;
}
}

BIN
designer_chart/src/com/fr/plugin/chart/area/images/area.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
designer_chart/src/com/fr/plugin/chart/area/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 760 B

BIN
designer_chart/src/com/fr/plugin/chart/area/images/percentStack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 728 B

BIN
designer_chart/src/com/fr/plugin/chart/area/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

56
designer_chart/src/com/fr/plugin/chart/bar/BarIndependentVanChartInterface.java

@ -0,0 +1,56 @@
package com.fr.plugin.chart.bar;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.column.VanChartColumnConditionPane;
import com.fr.plugin.chart.column.VanChartColumnSeriesPane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/10/20.
*/
public class BarIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bar.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartBarPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartColumnConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartColumnSeriesPane(parent, plot);
}
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartBarStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane();
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
/**
* plot面板的标题
* 插件兼容
*/
public String getPlotTypeTitle4PopupWindow(){
return VanChartBarPlotPane.TITLE;
}
}

96
designer_chart/src/com/fr/plugin/chart/bar/VanChartBarPlotPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.bar;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.column.VanChartColumnPlot;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/10/20.
*/
public class VanChartBarPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBar");
private static final long serialVersionUID = 2879689884048643002L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/bar/images/bar.png",
"/com/fr/plugin/chart/bar/images/stack.png",
"/com/fr/plugin/chart/bar/images/percentstack.png",
"/com/fr/plugin/chart/bar/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String bar = Inter.getLocText("FR-Chart-Type_Bar");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
bar,
stack + bar,
percent + stack + bar,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewBar");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartColumnPlot) {
lastTypeIndex = ((VanChartColumnPlot)plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] barChart = BarIndependentVanChart.BarVanChartTypes;
for(int i = 0, len = barChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartColumnPlot)barChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ColumnChart");
}
return cloned;
}
public Chart getDefaultChart() {
return BarIndependentVanChart.BarVanChartTypes[0];
}
}

23
designer_chart/src/com/fr/plugin/chart/bar/VanChartBarStylePane.java

@ -0,0 +1,23 @@
package com.fr.plugin.chart.bar;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.axis.bar.VanChartBarAxisPane;
import java.util.List;
/**
* Created by Mitisky on 16/6/8.
*/
public class VanChartBarStylePane extends VanChartStylePane {
public VanChartBarStylePane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected void createVanChartAxisPane(List<BasicPane> paneList, VanChartAxisPlot plot) {
paneList.add(new VanChartBarAxisPane(plot, VanChartBarStylePane.this));
}
}

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/bar.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 290 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 261 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/percentstack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 247 B

BIN
designer_chart/src/com/fr/plugin/chart/bar/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 256 B

85
designer_chart/src/com/fr/plugin/chart/bubble/BubbleIndependentVanChartInterface.java

@ -0,0 +1,85 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.report.BubblePlotReportDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI;
/**
* Created by Mitisky on 16/3/31.
*/
public class BubbleIndependentVanChartInterface extends AbstractIndependentVanChartUI {
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartBubblePlotPane();
}
/**
* 图标路径
*
* @return 图标路径
*/
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/bubble.png";
}
@Override
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartBubbleSeriesPane(parent, plot);
}
@Override
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){
if(((VanChartBubblePlot) plot).isForceBubble()){
return super.getTableDataSourcePane(plot, parent);
}
return new VanChartBubblePlotTableDataContentPane(parent);
}
@Override
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){
if(((VanChartBubblePlot) plot).isForceBubble()){
return super.getReportDataSourcePane(plot, parent);
}
return new BubblePlotReportDataContentPane(parent);
}
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartBubbleStylePane(listener);
VanChartOtherPane otherPane = new VanChartOtherPane(){
protected BasicBeanPane<Chart> createInteractivePane() {
return new VanChartBubbleInteractivePane();
}
};
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartBubbleConditionPane(plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartBubblePlotPane.TITLE;
}
}

94
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionPane.java

@ -0,0 +1,94 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.designer.PlotFactory;
import com.fr.plugin.chart.designer.other.condition.item.VanChartBubbleSetConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.scatter.attr.ScatterAttrTooltip;
import com.fr.plugin.chart.scatter.component.label.VanChartScatterLabelConditionPane;
import com.fr.plugin.chart.scatter.component.tooltip.VanChartScatterTooltipConditionPane;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleConditionPane extends DataSeriesConditionPane {
private static final long serialVersionUID = -7180705321732069806L;
public VanChartBubbleConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
private boolean forceBubble() {
return plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble();
}
@Override
protected ChartConditionPane createListConditionPane() {
return forceBubble() ? new ChartConditionPane() : new VanChartBubbleConditionSelectionPane();
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(VanChartAttrBubble.class, new VanChartBubbleSetConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
if(forceBubble()){
addForceAction();
} else if(PlotFactory.largeDataModel(plot)){
addLargeAction();
} else {
addNormalAction();
}
}
private void addNormalAction() {
classPaneMap.put(ScatterAttrLabel.class, new VanChartScatterLabelConditionPane(this, plot));
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect()));
}
private void addForceAction() {
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getBubblePlotDefaultEffect()));
}
private void addLargeAction() {
classPaneMap.put(ScatterAttrTooltip.class, new VanChartScatterTooltipConditionPane(this, plot));
}
protected void addStyleAction() {
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartBubblePlot.class;
}
}

22
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleConditionSelectionPane.java

@ -0,0 +1,22 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.ChartConstants;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.plugin.chart.scatter.VanChartScatterDataPoint;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleConditionSelectionPane extends ChartConditionPane {
public String[] columns2Populate() {
return new String[]{
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
VanChartScatterDataPoint.X,
VanChartScatterDataPoint.Y,
ChartConstants.VALUE
};
}
}

27
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleInteractivePane.java

@ -0,0 +1,27 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartConstants;
import com.fr.plugin.chart.designer.other.VanChartInteractivePaneWithOutSort;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleInteractivePane extends VanChartInteractivePaneWithOutSort {
protected String[] getNameArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{Inter.getLocText("Plugin-ChartF_XYAxis"), Inter.getLocText("Chart-Use_None")};
}
return super.getNameArray();
}
protected String[] getValueArray() {
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot) plot).isForceBubble()) {
return new String[]{VanChartConstants.ZOOM_TYPE_XY, VanChartConstants.ZOOM_TYPE_NONE};
}
return super.getValueArray();
}
}

171
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubblePlotPane.java

@ -0,0 +1,171 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartZoom;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
import com.fr.plugin.chart.scatter.attr.ScatterAttrLabel;
import com.fr.plugin.chart.vanchart.VanChart;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewBubble");;
private static final long serialVersionUID = -3481633368542654247L;
private static final float FORCE_ALPHA = 1.0f;
private static final float ALPHA = 0.7f;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/bubble/images/bubble.png",
"/com/fr/plugin/chart/bubble/images/force.png"
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Inter.getLocText("FR-Chart-Chart_BubbleChart"),
Inter.getLocText("Plugin-ChartF_NewForceBubble")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewBubble");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartBubblePlot && ((VanChartBubblePlot)plot).isForceBubble()){
lastTypeIndex = BubblePlotType.FORCE.ordinal();
} else {
lastTypeIndex = BubblePlotType.NORMAL.ordinal();
}
typeDemo.get(lastTypeIndex).isPressing = true;
checkDemosBackground();
}
private void removeDefaultAttr(ConditionAttr conditionAttr, Class <? extends DataSeriesCondition> targetClass) {
DataSeriesCondition attr = conditionAttr.getExisted(targetClass);
if (attr != null){
conditionAttr.remove(targetClass);
}
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartBubblePlot newPlot = null;
Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes;
for(int i = 0, len = bubbleChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In BubbleChart");
}
return cloned;
}
public Chart getDefaultChart() {
return BubbleIndependentVanChart.BubbleVanChartTypes[0];
}
@Override
/**
* 力學氣泡圖切換到其他氣泡圖時刪除條件屬性
* 并且将bubbleAttr属性重置
*/
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot);
}
@Override
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
if (oldPlot.getConditionCollection() != null) {
ConditionCollection newCondition = new ConditionCollection();
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone());
newPlot.setConditionCollection(newCondition);
ConditionAttr attrList = newCondition.getDefaultAttr();
//根据气泡图类型,重设透明度属性
removeDefaultAttr(attrList, AttrAlpha.class);
//删除标签属性(防止切换到大数据气泡图标签属性会拷贝过去)
removeDefaultAttr(attrList, ScatterAttrLabel.class);
AttrAlpha attrAlpha = new AttrAlpha();
attrAlpha.setAlpha(((VanChartBubblePlot)newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA);
attrList.addDataSeriesCondition(attrAlpha);
}
}
@Override
protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
if(oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot){
if(((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()){
super.cloneHotHyperLink(oldPlot, newPlot);
}
}
}
@Override
protected VanChartTools createVanChartTools() {
VanChartTools tools = new VanChartTools();
tools.setSort(false);
return tools;
}
/**
* 气泡图相同图表类型之间切换的时候chart的部分属性也需要重置
* @param chart
*/
@Override
protected void resetChartAttr4SamePlot(Chart chart){
VanChartZoom vanChartZoom = new VanChartZoom();
((VanChart)chart).setVanChartZoom(vanChartZoom);
//重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart);
}
}

92
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleSeriesPane.java

@ -0,0 +1,92 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.general.Inter;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import com.fr.plugin.chart.bubble.component.VanChartBubblePane;
import com.fr.plugin.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.plugin.chart.designer.style.series.VanChartCustomStackAndAxisEditPane;
import javax.swing.*;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = 5595016643808487932L;
private VanChartBubblePane bubblePane;
public VanChartBubbleSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p, p, p};
double[] col = {f};
Component[][] components = new Component[][]{
new Component[]{createBubblePane()},
new Component[]{new JSeparator()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createAlphaPane()},
new Component[]{new JSeparator()},
new Component[]{createLargeDataModelPane()}
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, row, col);
return contentPane;
}
@Override
//堆积和坐标轴设置(自定义柱形图等用到)
protected JPanel createStackedAndAxisPane() {
stackAndAxisEditPane = new VanChartCustomStackAndAxisEditPane(){
@Override
protected Class<? extends BasicBeanPane> getStackAndAxisPaneClass() {
return VanChartCustomAxisConditionPane.class;
}
@Override
protected String getPaneTitle(){
return Inter.getLocText("Plugin-ChartF_Custom_Axis");
}
};
return stackAndAxisEditPane;
}
private JPanel createBubblePane() {
bubblePane = new VanChartBubblePane();
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("Plugin-ChartF_Bubble"), bubblePane);
}
protected void populateCondition(ConditionAttr defaultAttr){
super.populateCondition(defaultAttr);
if(bubblePane != null) {
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
bubblePane.populateBean(attrBubble);
}
}
protected void updateCondition(ConditionAttr defaultAttr){
super.updateCondition(defaultAttr);
if(bubblePane != null){
VanChartAttrBubble attrBubble = (VanChartAttrBubble) defaultAttr.getExisted(VanChartAttrBubble.class);
if (attrBubble != null) {
defaultAttr.remove(attrBubble);
}
defaultAttr.addDataSeriesCondition(bubblePane.updateBean());
}
}
}

57
designer_chart/src/com/fr/plugin/chart/bubble/VanChartBubbleStylePane.java

@ -0,0 +1,57 @@
package com.fr.plugin.chart.bubble;
import com.fr.chart.chartattr.Plot;
import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleAreaPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleLabelPane;
import com.fr.plugin.chart.bubble.force.VanChartForceBubbleTooltipPane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaPane;
import com.fr.plugin.chart.scatter.component.VanChartScatterStylePane;
import java.util.List;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartBubbleStylePane extends VanChartScatterStylePane {
public VanChartBubbleStylePane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected void createVanChartLabelPane(List<BasicPane> paneList) {
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){
paneList.add(new VanChartForceBubbleLabelPane(VanChartBubbleStylePane.this));
} else {
super.createVanChartLabelPane(paneList);
}
}
protected void addVanChartTooltipPane(List<BasicPane> paneList){
Plot plot = getChart().getPlot();
if(((VanChartBubblePlot) plot).isForceBubble()){
paneList.add(new VanChartForceBubbleTooltipPane(VanChartBubbleStylePane.this));
} else {
super.addVanChartTooltipPane(paneList);
}
}
@Override
protected void addVanChartAreaPane(List<BasicPane> paneList) {
if (((VanChartBubblePlot)getChart().getPlot()).isForceBubble()){
paneList.add(new VanChartForceBubbleAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this));
}else {
paneList.add(new VanChartAreaPane(getChart().getPlot(), VanChartBubbleStylePane.this));
}
}
@Override
protected ChartSeriesPane createChartSeriesPane() {
return new ChartSeriesPane(VanChartBubbleStylePane.this);
}
}

74
designer_chart/src/com/fr/plugin/chart/bubble/component/VanChartBubblePane.java

@ -0,0 +1,74 @@
package com.fr.plugin.chart.bubble.component;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.Inter;
import com.fr.plugin.chart.bubble.attr.VanChartAttrBubble;
import javax.swing.*;
import java.awt.*;
/**
* Created by Mitisky on 16/3/31.
* 气泡大小等设置界面
*/
public class VanChartBubblePane extends BasicBeanPane<VanChartAttrBubble> {
private UISpinner minDiameter;
private UISpinner maxDiameter;
private UIButtonGroup<Integer> shadow;
private UIButtonGroup<Integer> displayNegative;
public VanChartBubblePane(){
minDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
maxDiameter = new UISpinner(0,Double.MAX_VALUE,1,0);
shadow = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Open"),
Inter.getLocText("Plugin-ChartF_Close")});
displayNegative = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_Open"),
Inter.getLocText("Plugin-ChartF_Close")});
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] row = {p, p, p, p};
double[] col = {p, f};
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MinDiameter")), minDiameter},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_MaxDiameter")), maxDiameter},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Shadow")), shadow},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_DisplayNegative")), displayNegative},
};
JPanel content = TableLayoutHelper.createTableLayoutPane(components, row, col);
this.setLayout(new BorderLayout());
this.add(content, BorderLayout.CENTER);
}
public void populateBean(VanChartAttrBubble bubble) {
if(bubble == null){
bubble = new VanChartAttrBubble();
}
minDiameter.setValue(bubble.getMinDiameter());
maxDiameter.setValue(bubble.getMaxDiameter());
shadow.setSelectedIndex(bubble.isShadow() ? 0 : 1);
displayNegative.setSelectedIndex(bubble.isDisplayNegative() ? 0 : 1);
}
public VanChartAttrBubble updateBean() {
VanChartAttrBubble bubble = new VanChartAttrBubble();
bubble.setMinDiameter(minDiameter.getValue());
bubble.setMaxDiameter(maxDiameter.getValue());
bubble.setShadow(shadow.getSelectedIndex() == 0);
bubble.setDisplayNegative(displayNegative.getSelectedIndex() == 0);
return bubble;
}
@Override
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_Bubble");
}
}

184
designer_chart/src/com/fr/plugin/chart/bubble/data/VanChartBubblePlotTableDataContentPane.java

@ -0,0 +1,184 @@
package com.fr.plugin.chart.bubble.data;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.BubblePlot;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartdata.BubbleTableDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.ChartDataFilterPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
import javax.swing.*;
import java.awt.*;
import java.util.List;
public class VanChartBubblePlotTableDataContentPane extends AbstractTableDataContentPane {
private static final Dimension PREFERRED_SIZE = new Dimension(100, 20);
protected UIComboBox seriesName;
protected UIComboBox xCombox;
protected UIComboBox yCombox;
protected UIComboBox bubbleSize;
private ChartDataFilterPane dataScreeningPane;
public VanChartBubblePlotTableDataContentPane(ChartDataPane parent) {
seriesName = new UIComboBox();
xCombox = new UIComboBox();
yCombox = new UIComboBox();
dataScreeningPane = new ChartDataFilterPane(new BubblePlot(), parent);
seriesName.setPreferredSize(PREFERRED_SIZE);
xCombox.setPreferredSize(PREFERRED_SIZE);
yCombox.setPreferredSize(PREFERRED_SIZE);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
initBubbleSize();
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = { p, p,p,p};
double[] columnSize_north = {p, f};
double[] rowSize_north = {p, p, p, p};
Component[][] components_north = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Chart-Series_Name")+":", SwingConstants.RIGHT), seriesName},
new Component[]{new UILabel("x :", SwingConstants.RIGHT), xCombox},
new Component[]{new UILabel("y :", SwingConstants.RIGHT), yCombox},
new Component[]{new UILabel(Inter.getLocText("FR-Chart_Bubble_Size")+":", SwingConstants.RIGHT), bubbleSize},
};
JPanel north = TableLayoutHelper.createTableLayoutPane(components_north,rowSize_north,columnSize_north);
north.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 1));
Component[][] components = new Component[][]{
new Component[]{north},
new Component[]{new JSeparator()},
new Component[]{new BoldFontTextLabel(Inter.getLocText("Chart-Data_Filter"))},
new Component[]{dataScreeningPane}
};
JPanel panel = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
this.setLayout(new BorderLayout());
this.add(panel, BorderLayout.CENTER);
seriesName.addItemListener(tooltipListener);
xCombox.addItemListener(tooltipListener);
yCombox.addItemListener(tooltipListener);
bubbleSize.addItemListener(tooltipListener);
}
protected void initBubbleSize() {
bubbleSize = new UIComboBox();
bubbleSize.setPreferredSize(new Dimension(100, 20));
}
/**
* 检查box是否使用, donothing
* @param hasUse 是否使用.
*/
public void checkBoxUse(boolean hasUse) {
}
protected void refreshBoxListWithSelectTableData(List list) {
refreshBoxItems(seriesName, list);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
refreshBoxItems(xCombox, list);
refreshBoxItems(yCombox, list);
refreshBoxItems(bubbleSize, list);
}
/**
* 清空所有的box设置
*/
public void clearAllBoxList(){
clearBoxItems(seriesName);
seriesName.addItem(Inter.getLocText("Chart-Use_None"));
clearBoxItems(xCombox);
clearBoxItems(yCombox);
clearBoxItems(bubbleSize);
}
@Override
public void populateBean(ChartCollection collection) {
super.populateBean(collection);
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if (!(top instanceof BubbleTableDefinition)) {
return;
}
BubbleTableDefinition definition = (BubbleTableDefinition) top;
if(definition.getSeriesName() == null || ComparatorUtils.equals(StringUtils.EMPTY, definition.getSeriesName())) {
seriesName.setSelectedItem(Inter.getLocText("Chart-Use_None"));
} else {
combineCustomEditValue(seriesName, definition.getSeriesName());
}
combineCustomEditValue(xCombox, definition.getBubbleX());
combineCustomEditValue(yCombox, definition.getBubbleY());
//气泡图不配置“无”
populateBubbleSize(definition);
dataScreeningPane.populateBean(collection);
}
protected void populateBubbleSize(BubbleTableDefinition definition) {
if (ComparatorUtils.equals(definition.getBubbleSize(), Inter.getLocText("Chart-Use_None"))){
combineCustomEditValue(bubbleSize, StringUtils.EMPTY);
}else {
combineCustomEditValue(bubbleSize, definition.getBubbleSize());
}
}
@Override
public void updateBean(ChartCollection collection) {
BubbleTableDefinition definition = new BubbleTableDefinition();
collection.getSelectedChart().setFilterDefinition(definition);
Object resultName = seriesName.getSelectedItem();
Object resultX = xCombox.getSelectedItem();
Object resultY = yCombox.getSelectedItem();
Object resultSize = bubbleSize.getSelectedItem();
if(resultName == null || ArrayUtils.contains(ChartConstants.getNoneKeys(), resultName)) {
definition.setSeriesName(StringUtils.EMPTY);
} else {
definition.setSeriesName(resultName.toString());
}
if (resultX != null) {
definition.setBubbleX(resultX.toString());
}
if (resultY != null) {
definition.setBubbleY(resultY.toString());
}
if (resultSize != null) {
definition.setBubbleSize(resultSize.toString());
}
dataScreeningPane.updateBean(collection);
}
/**
* 重新布局
*/
public void redoLayoutPane(){
dataScreeningPane.relayoutPane(this.isNeedSummaryCaculateMethod());
}
}

28
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartBubbleRefreshTooltipPane.java

@ -0,0 +1,28 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.designer.component.VanChartRefreshTooltipContentPane;
import com.fr.plugin.chart.designer.component.VanChartTooltipContentPane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotRefreshTooltipPane;
import com.fr.plugin.chart.scatter.VanChartScatterRefreshTooltipContentPane;
/**
* Created by mengao on 2017/6/12.
*/
public class VanChartBubbleRefreshTooltipPane extends VanChartPlotRefreshTooltipPane {
public VanChartBubbleRefreshTooltipPane(Plot plot) {
super(plot);
}
@Override
protected VanChartTooltipContentPane getTooltipContentPane(Plot plot){
if (((VanChartBubblePlot)plot).isForceBubble()) {
return new VanChartRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this);
} else {
return new VanChartScatterRefreshTooltipContentPane(parent, VanChartBubbleRefreshTooltipPane.this);
}
}
}

23
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaBackgroundPane.java

@ -0,0 +1,23 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaBackgroundPane;
import java.awt.*;
//图表区|绘图区 边框和背景
public class VanChartForceBubbleAreaBackgroundPane extends VanChartAreaBackgroundPane {
public VanChartForceBubbleAreaBackgroundPane(boolean isPlot, AbstractAttrNoScrollPane parent) {
super(isPlot, parent);
}
@Override
protected Component[][] initComponents() {
return new Component[][]{
new Component[]{chartBorderPane},
new Component[]{chartBackgroundPane},
};
}
}

26
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleAreaPane.java

@ -0,0 +1,26 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.design.gui.frpane.AbstractAttrNoScrollPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.background.VanChartAreaPane;
/**
* 属性表, 图表样式-背景界面.
*/
public class VanChartForceBubbleAreaPane extends VanChartAreaPane {
public VanChartForceBubbleAreaPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
}
@Override
protected void initPlotPane(boolean b, AbstractAttrNoScrollPane parent) {
plotPane = new VanChartForceBubbleAreaBackgroundPane(true, parent);
}
}

19
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleLabelPane.java

@ -0,0 +1,19 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.label.VanChartLabelPane;
import com.fr.plugin.chart.designer.style.label.VanChartPlotLabelPane;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartForceBubbleLabelPane extends VanChartLabelPane {
public VanChartForceBubbleLabelPane(VanChartStylePane parent) {
super(parent);
}
protected VanChartPlotLabelPane getLabelPane(Plot plot) {
return new VanChartPlotLabelPane(plot, parent);
}
}

18
designer_chart/src/com/fr/plugin/chart/bubble/force/VanChartForceBubbleTooltipPane.java

@ -0,0 +1,18 @@
package com.fr.plugin.chart.bubble.force;
import com.fr.chart.chartattr.Plot;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartPlotTooltipPane;
import com.fr.plugin.chart.designer.style.tooltip.VanChartTooltipPane;
/**
* Created by Mitisky on 16/3/31.
*/
public class VanChartForceBubbleTooltipPane extends VanChartTooltipPane {
public VanChartForceBubbleTooltipPane(VanChartStylePane parent) {
super(parent);
}
protected VanChartPlotTooltipPane getTooltipPane(Plot plot) {
return new VanChartPlotTooltipPane(plot, parent);
}
}

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/bubble.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 693 B

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/force.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 772 B

BIN
designer_chart/src/com/fr/plugin/chart/bubble/images/large.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 832 B

43
designer_chart/src/com/fr/plugin/chart/column/ColumnBorderAttriPane.java

@ -0,0 +1,43 @@
package com.fr.plugin.chart.column;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.gui.icombobox.LineComboBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.style.color.ColorSelectBox;
import com.fr.general.Inter;
import com.fr.stable.Constants;
import com.fr.stable.CoreConstants;
import java.awt.*;
/**
* Created by hufan on 2016/8/11.
*/
public class ColumnBorderAttriPane extends BorderAttriPane {
private UISpinner radius;
public ColumnBorderAttriPane() {
this(Inter.getLocText("plugin-ChartF_Radius"));
}
public ColumnBorderAttriPane(String radiusString) {
this.add(new UILabel(radiusString + ":"));
radius = new UISpinner(0,1000,1,0);
this.add(radius);
radius.setPreferredSize(new Dimension(60, 18));
}
public void setRadius(int value) {
this.radius.setValue(value);
}
public double getRadius() {
return this.radius.getValue();
}
@Override
protected String title4PopupWindow() {
return "Border";
}
}

36
designer_chart/src/com/fr/plugin/chart/column/ColumnIndependentVanChartInterface.java

@ -0,0 +1,36 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.vanchart.AbstractMultiCategoryVanChartUI;
/**
* Created by Mitisky on 15/9/24.
*/
public class ColumnIndependentVanChartInterface extends AbstractMultiCategoryVanChartUI {
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/column.png";
}
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartColumnPlotPane();
}
public ConditionAttributesPane getPlotConditionPane(Plot plot){
return new VanChartColumnConditionPane(plot);
}
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot){
return new VanChartColumnSeriesPane(parent, plot);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartColumnPlotPane.TITLE;
}
}

93
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnConditionPane.java

@ -0,0 +1,93 @@
package com.fr.plugin.chart.column;
import com.fr.chart.base.AttrAlpha;
import com.fr.chart.base.AttrBackground;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.ChartConstants;
import com.fr.chart.chartattr.Plot;
import com.fr.design.chart.series.SeriesCondition.ChartConditionPane;
import com.fr.design.chart.series.SeriesCondition.DataSeriesConditionPane;
import com.fr.design.chart.series.SeriesCondition.LabelAlphaPane;
import com.fr.plugin.chart.attr.EffectHelper;
import com.fr.plugin.chart.base.AttrDataSheet;
import com.fr.plugin.chart.base.AttrEffect;
import com.fr.plugin.chart.base.AttrFloatColor;
import com.fr.plugin.chart.base.AttrLabel;
import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.base.AttrTooltip;
import com.fr.plugin.chart.base.VanChartAttrTrendLine;
import com.fr.plugin.chart.designer.other.condition.item.VanChartDataSheetContentPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartEffectConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartFloatColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartLabelConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesColorConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartSeriesImageBackgroundConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTooltipConditionPane;
import com.fr.plugin.chart.designer.other.condition.item.VanChartTrendLineConditionPane;
import com.fr.plugin.chart.glyph.VanChartMultiCategoryDataPoint;
import java.awt.*;
/**
* Created by Mitisky on 15/9/28.
*/
public class VanChartColumnConditionPane extends DataSeriesConditionPane{
private static final long serialVersionUID = -7180705321732069806L;
public VanChartColumnConditionPane(Plot plot) {
super(plot);
}
protected void initComponents() {
super.initComponents();
//添加全部条件属性后被遮挡
liteConditionPane.setPreferredSize(new Dimension(300, 400));
}
@Override
protected void addBasicAction() {
classPaneMap.put(AttrBackground.class, new VanChartSeriesColorConditionPane(this));
classPaneMap.put(AttrAlpha.class, new LabelAlphaPane(this));
classPaneMap.put(AttrBorder.class, new VanChartColumnLabelBorderPane(this));
classPaneMap.put(AttrLabel.class, new VanChartLabelConditionPane(this, plot));
classPaneMap.put(AttrFloatColor.class, new VanChartFloatColorConditionPane(this));
classPaneMap.put(VanChartAttrTrendLine.class, new VanChartTrendLineConditionPane(this));
classPaneMap.put(AttrSeriesImageBackground.class, new VanChartSeriesImageBackgroundConditionPane(this));
classPaneMap.put(AttrEffect.class, new VanChartEffectConditionPane(this, EffectHelper.getColumnPlotDefaultEffect()));
classPaneMap.put(AttrTooltip.class, new VanChartTooltipConditionPane(this, plot));
//是否使用数据表
//自定义柱形图设置多X坐标轴时,不支持数据表
if (plot.getDataSheet().isVisible() && ((VanChartColumnPlot) plot).getXAxisList().size() == 1) {
classPaneMap.put(AttrDataSheet.class, new VanChartDataSheetContentPane(this, plot));
}
}
protected void addStyleAction() {
}
@Override
protected ChartConditionPane createListConditionPane() {
return new ChartConditionPane(){
@Override
public String[] columns2Populate() {
return new String[]{
ChartConstants.CATEGORY_INDEX,
ChartConstants.CATEGORY_NAME,
ChartConstants.SERIES_INDEX,
ChartConstants.SERIES_NAME,
ChartConstants.VALUE,
VanChartMultiCategoryDataPoint.CATEGORY_ARRAY,
};
}
};
}
/**
* 返回图表class对象
* @return class对象
*/
public Class<? extends Plot> class4Correspond() {
return VanChartColumnPlot.class;
}
}

34
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnLabelBorderPane.java

@ -0,0 +1,34 @@
package com.fr.plugin.chart.column;
import com.fr.chart.base.AttrBorder;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.design.chart.comp.BorderAttriPane;
import com.fr.design.chart.series.SeriesCondition.LabelBorderPane;
import com.fr.design.condition.ConditionAttributesPane;
/**
* Created by hufan on 2016/8/11.
*/
public class VanChartColumnLabelBorderPane extends LabelBorderPane {
public VanChartColumnLabelBorderPane(ConditionAttributesPane conditionAttributesPane) {
super(conditionAttributesPane);
}
@Override
protected BorderAttriPane initBorderAttrPane(){
return new ColumnBorderAttriPane();
}
public void populate(DataSeriesCondition condition) {
super.populate(condition);
if (condition instanceof AttrBorder) {
((ColumnBorderAttriPane)linePane).setRadius(attrBorder.getRoundRadius());
}
}
public DataSeriesCondition update() {
super.update();
attrBorder.setRoundRadius((int) ((ColumnBorderAttriPane)linePane).getRadius());
attrBorder.setRoundBorder(true);
return attrBorder;
}
}

96
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnPlotPane.java

@ -0,0 +1,96 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
/**
* Created by Mitisky on 15/9/24.
*/
public class VanChartColumnPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewColumn");
private static final long serialVersionUID = 5950923001789733745L;
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/column/images/column.png",
"/com/fr/plugin/chart/column/images/stack.png",
"/com/fr/plugin/chart/column/images/percentstack.png",
"/com/fr/plugin/chart/column/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
String column = Inter.getLocText("FR-Chart-Type_Column");
String stack = Inter.getLocText("FR-Chart-Type_Stacked");
String percent = Inter.getLocText("FR-Chart-Use_Percent");
return new String[]{
column,
stack + column,
percent + stack + column,
Inter.getLocText("FR-Chart-Mode_Custom")
};
}
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewColumn");
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
Plot plot = chart.getPlot();
if(plot instanceof VanChartColumnPlot) {
lastTypeIndex = ((VanChartColumnPlot)plot).getVanChartPlotType().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
}
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartColumnPlot newPlot = null;
Chart[] columnChart = ColumnIndependentVanChart.ColumnVanChartTypes;
for(int i = 0, len = columnChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartColumnPlot)columnChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ColumnChart");
}
return cloned;
}
public Chart getDefaultChart() {
return ColumnIndependentVanChart.ColumnVanChartTypes[0];
}
}

194
designer_chart/src/com/fr/plugin/chart/column/VanChartColumnSeriesPane.java

@ -0,0 +1,194 @@
package com.fr.plugin.chart.column;
import com.fr.base.background.ImageBackground;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.design.gui.frpane.UINumberDragPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.ispinner.UISpinner;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.backgroundpane.ImageBackgroundQuickPane;
import com.fr.design.mainframe.chart.gui.ChartStylePane;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.AttrSeriesImageBackground;
import com.fr.plugin.chart.designer.TableLayout4VanChartHelper;
import com.fr.plugin.chart.designer.component.border.VanChartBorderPane;
import com.fr.plugin.chart.designer.component.border.VanChartBorderWithRadiusPane;
import com.fr.plugin.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.stable.Constants;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 新条形图系列界面
*/
public class VanChartColumnSeriesPane extends VanChartAbstractPlotSeriesPane {
private static final long serialVersionUID = -8875943419420081420L;
private UIButtonGroup<Integer> isFixedWidth;//是否固定宽度
private UISpinner columnWidth;//宽度
private UINumberDragPane categoryGap;//分类间隔
private UINumberDragPane seriesGap;//系列间隔
private UIButtonGroup<Integer> isFillWithImage;//是否使用图片填充
private ImageBackgroundQuickPane imagePane;//填充图片选择界面
public VanChartColumnSeriesPane(ChartStylePane parent, Plot plot) {
super(parent, plot);
}
protected JPanel getContentInPlotType() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
double[] columnSize = {f};
double[] rowSize = {p,p,p,p,p,p,p,p,p,p};
Component[][] components = new Component[][]{
new Component[]{createStylePane()},
new Component[]{stylePane == null ? null : new JSeparator()},
new Component[]{createSeriesStylePane(new double[]{p,p}, new double[]{p,f})},
new Component[]{new JSeparator()},
new Component[]{createBorderPane()},
new Component[]{createStackedAndAxisPane()},
new Component[]{createTrendLinePane()},
};
contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);
return contentPane;
}
//边框(有圆角)
protected VanChartBorderPane createDiffBorderPane() {
return new VanChartBorderWithRadiusPane();
}
private JPanel createSeriesStylePane(double[] row, double[] col) {
isFixedWidth = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
columnWidth = new UISpinner(0,1000,1,0);
seriesGap = new UINumberDragPane(-100, 100);
categoryGap = new UINumberDragPane(0, 100);
isFillWithImage = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
imagePane = new ImageBackgroundQuickPane(false);
Component[][] components1 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Fixed_Column_Width")),isFixedWidth},
new Component[]{null,columnWidth},
};
JPanel panel1 = TableLayoutHelper.createTableLayoutPane(components1, row, col);
Component[][] components2 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Series")),seriesGap},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Gap_Category")),categoryGap},
};
JPanel panel2 = TableLayoutHelper.createTableLayoutPane(components2, row, col);
Component[][] components3 = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_Filled_With_Image")),isFillWithImage},
};
JPanel panel3 = TableLayoutHelper.createTableLayoutPane(components3, row, col);
JPanel panel = new JPanel(new BorderLayout(0, 4));
panel.add(panel1, BorderLayout.NORTH);
panel.add(panel2, BorderLayout.CENTER);
panel.add(panel3, BorderLayout.SOUTH);
JPanel borderPane = new JPanel(new BorderLayout());
borderPane.add(panel, BorderLayout.NORTH);
borderPane.add(imagePane, BorderLayout.CENTER);
isFixedWidth.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkColumnWidth();
}
});
isFillWithImage.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkImagePane();
}
});
return TableLayout4VanChartHelper.createTableLayoutPaneWithTitle(Inter.getLocText("FR-Designer-Widget_Style"), borderPane);
}
private void checkAll() {
checkColumnWidth();
checkImagePane();
}
private void checkColumnWidth() {
columnWidth.setEnabled(isFixedWidth.getSelectedIndex() == 0);
}
private void checkImagePane() {
GUICoreUtils.setEnabled(imagePane, isFillWithImage.getSelectedIndex() == 0);
}
public void populateBean(Plot plot) {
if(plot == null) {
return;
}
super.populateBean(plot);
if(plot instanceof VanChartColumnPlot){
VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot;
isFixedWidth.setSelectedIndex(columnPlot4VanChart.isFixedWidth() ? 0 : 1);
columnWidth.setValue(columnPlot4VanChart.getColumnWidth());
categoryGap.populateBean(columnPlot4VanChart.getCategoryIntervalPercent());
seriesGap.populateBean(columnPlot4VanChart.getSeriesOverlapPercent());
isFillWithImage.setSelectedIndex(columnPlot4VanChart.isFilledWithImage() ? 0 : 1);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
if(columnPlot4VanChart.isFilledWithImage()){
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground != null){
imagePane.populateBean(attrSeriesImageBackground.getSeriesBackground());
}
}
}
checkAll();
}
public void updateBean(Plot plot) {
if(plot == null) {
return;
}
super.updateBean(plot);
if(plot instanceof VanChartColumnPlot){
VanChartColumnPlot columnPlot4VanChart = (VanChartColumnPlot)plot;
columnPlot4VanChart.setFixedWidth(isFixedWidth.getSelectedIndex() == 0);
columnPlot4VanChart.setColumnWidth((int)columnWidth.getValue());
columnPlot4VanChart.setCategoryIntervalPercent(categoryGap.updateBean());
columnPlot4VanChart.setSeriesOverlapPercent(seriesGap.updateBean());
columnPlot4VanChart.setFilledWithImage(isFillWithImage.getSelectedIndex() == 0);
ConditionAttr defaultAttr = plot.getConditionCollection().getDefaultAttr();
if(isFillWithImage.getSelectedIndex() == 0){
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground == null){
attrSeriesImageBackground = new AttrSeriesImageBackground();
defaultAttr.addDataSeriesCondition(attrSeriesImageBackground);
}
attrSeriesImageBackground.setSeriesBackground(imagePane.updateBean());
//设置背景图片平铺方式
ImageBackground imageBackground = (ImageBackground) attrSeriesImageBackground.getSeriesBackground();
if (imageBackground != null){
imageBackground.setLayout(Constants.IMAGE_TILED);
}
} else {
AttrSeriesImageBackground attrSeriesImageBackground = (AttrSeriesImageBackground)defaultAttr.getExisted(AttrSeriesImageBackground.class);
if(attrSeriesImageBackground != null){
defaultAttr.remove(attrSeriesImageBackground);
}
}
}
}
}

143
designer_chart/src/com/fr/plugin/chart/column/VanChartCustomStackAndAxisConditionPane.java

@ -0,0 +1,143 @@
package com.fr.plugin.chart.column;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.data.condition.AbstractCondition;
import com.fr.data.condition.ListCondition;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.condition.LiteConditionPane;
import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.AttrSeriesStackAndAxis;
import com.fr.plugin.chart.designer.style.series.VanChartSeriesConditionPane;
import javax.swing.*;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* 堆积和坐标轴设置
*/
public class VanChartCustomStackAndAxisConditionPane extends BasicBeanPane<ConditionAttr> {
private static final long serialVersionUID = 2713124322060048526L;
protected UIButtonGroup<Integer> XAxis;
protected UIButtonGroup<Integer> YAxis;
protected UIButtonGroup<Integer> isStacked;
protected UIButtonGroup<Integer> isPercentStacked;
private LiteConditionPane liteConditionPane;
public VanChartCustomStackAndAxisConditionPane(){
}
private void doLayoutPane(){
this.setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
//配置界面
JPanel deployPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(deployPane);
deployPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Plugin-ChartF_Deploy") + ":", null));
deployPane.add(createDeployPane());
//条件界面
JPanel conditionPane = FRGUIPaneFactory.createBorderLayout_L_Pane();
this.add(conditionPane);
conditionPane.setBorder(BorderFactory.createEmptyBorder());
conditionPane.add(liteConditionPane = new VanChartSeriesConditionPane());
liteConditionPane.setPreferredSize(new Dimension(300, 300));
}
private JPanel createDeployPane()
{
isStacked = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
isPercentStacked = new UIButtonGroup<Integer>(new String[]{Inter.getLocText("Plugin-ChartF_YES"), Inter.getLocText("Plugin-ChartF_NO")});
double p = TableLayout.PREFERRED;
double[] columnSize = {p,p};
double[] rowSize = {p,p,p,p};
return TableLayoutHelper.createTableLayoutPane(getDeployComponents(), rowSize, columnSize);
}
protected Component[][] getDeployComponents() {
Component[][] components = new Component[][]{
new Component[]{new UILabel(Inter.getLocText("ChartF-X_Axis")),XAxis},
new Component[]{new UILabel(Inter.getLocText("ChartF-Y_Axis")),YAxis},
new Component[]{new UILabel(Inter.getLocText("FR-Chart-Type_Stacked")),isStacked},
new Component[]{new UILabel(Inter.getLocText("Plugin-ChartF_PercentStacked")),isPercentStacked},
};
isStacked.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
checkBox();
}
});
return components;
}
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_StackAndSeries");
}
private void checkBox() {
isPercentStacked.setEnabled(isStacked.getSelectedIndex() == 0);
}
public void populateBean(ConditionAttr conditionAttr){
AttrSeriesStackAndAxis seriesStackAndAxis = (AttrSeriesStackAndAxis)conditionAttr.getExisted(AttrSeriesStackAndAxis.class);
XAxis = new UIButtonGroup<Integer>(seriesStackAndAxis.getXAxisNamesArray());
YAxis = new UIButtonGroup<Integer>(seriesStackAndAxis.getYAxisNameArray());
doLayoutPane();
XAxis.setSelectedIndex(seriesStackAndAxis.getXAxisIndex());
YAxis.setSelectedIndex(seriesStackAndAxis.getYAxisIndex());
isStacked.setSelectedIndex(seriesStackAndAxis.isStacked() ? 0 : 1);
isPercentStacked.setSelectedIndex(seriesStackAndAxis.isPercentStacked() ? 0 : 1);
if (conditionAttr.getCondition() == null) {
this.liteConditionPane.populateBean(new ListCondition());
} else {
this.liteConditionPane.populateBean(conditionAttr.getCondition());
}
checkBox();
}
public void updateBean(ConditionAttr conditionAttr){
AttrSeriesStackAndAxis seriesStackAndAxis = (AttrSeriesStackAndAxis)conditionAttr.getExisted(AttrSeriesStackAndAxis.class);
seriesStackAndAxis.setXAxisIndex(XAxis.getSelectedIndex());
seriesStackAndAxis.setYAxisIndex(YAxis.getSelectedIndex());
updateStackAndPercent(seriesStackAndAxis);
AbstractCondition con = (AbstractCondition) this.liteConditionPane.updateBean();
conditionAttr.setCondition(con);
}
protected void updateStackAndPercent(AttrSeriesStackAndAxis seriesStackAndAxis) {
seriesStackAndAxis.setStacked(isStacked.getSelectedIndex() == 0);
if(seriesStackAndAxis.isStacked()){
seriesStackAndAxis.setPercentStacked(isPercentStacked.getSelectedIndex() == 0);
} else {
seriesStackAndAxis.setPercentStacked(false);
}
}
public ConditionAttr updateBean(){
ConditionAttr conditionAttr = new ConditionAttr();
updateBean(conditionAttr);
return conditionAttr;
}
}

BIN
designer_chart/src/com/fr/plugin/chart/column/images/column.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/custom.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 296 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/percentstack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 288 B

BIN
designer_chart/src/com/fr/plugin/chart/column/images/stack.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 300 B

56
designer_chart/src/com/fr/plugin/chart/custom/CustomIndependentVanChartInterface.java

@ -0,0 +1,56 @@
package com.fr.plugin.chart.custom;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane;
import com.fr.plugin.chart.custom.other.VanChartCustomOtherPane;
import com.fr.plugin.chart.custom.style.VanChartCustomStylePane;
import com.fr.plugin.chart.designer.other.VanChartOtherPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.vanchart.AbstractIndependentVanChartUI;
/**
* Created by Mitisky on 16/2/16.
*/
public class CustomIndependentVanChartInterface extends AbstractIndependentVanChartUI {
/**
* 图表的类型定义界面类型就是属性表的第一个界面
*
* @return 图表的类型定义界面类型
*/
@Override
public AbstractChartTypePane getPlotTypePane() {
return new VanChartCustomPlotPane();
}
/**
* 图标路径
*
* @return 图标路径
*/
@Override
public String getIconPath() {
return "com/fr/design/images/form/toolbar/custom.png";
}
@Override
/**
* 图表的属性界面数组
* @return 属性界面
*/
public AbstractChartAttrPane[] getAttrPaneArray(AttributeChangeListener listener){
VanChartStylePane stylePane = new VanChartCustomStylePane(listener);
VanChartOtherPane otherPane = new VanChartCustomOtherPane();
return new AbstractChartAttrPane[]{stylePane, otherPane};
}
public ChartDataPane getChartDataPane(AttributeChangeListener listener){
return new VanChartCustomDataPane(listener);
}
public String getPlotTypeTitle4PopupWindow(){
return VanChartCustomPlotPane.TITLE;
}
}

134
designer_chart/src/com/fr/plugin/chart/custom/CustomPlotDesignerPaneFactory.java

@ -0,0 +1,134 @@
package com.fr.plugin.chart.custom;
import com.fr.chart.chartattr.Plot;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
import com.fr.general.FRLogger;
import com.fr.plugin.chart.PiePlot4VanChart;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.bubble.VanChartBubblePlot;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.component.CustomPlotLocationPane;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.bubble.data.VanChartBubblePlotTableDataContentPane;
import com.fr.plugin.chart.scatter.data.VanChartScatterPlotTableDataContentPane;
import com.fr.plugin.chart.designer.style.VanChartStylePane;
import com.fr.plugin.chart.designer.style.axis.VanChartAxisPane;
import com.fr.plugin.chart.designer.style.axis.gauge.VanChartGaugeAxisPane;
import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.radar.VanChartRadarPlot;
import com.fr.plugin.chart.scatter.VanChartScatterPlot;
import java.lang.reflect.Constructor;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Mitisky on 16/6/23.
*/
public class CustomPlotDesignerPaneFactory {
//图表类型对应数据配置界面
private static Map<Class<? extends Plot>, Class<? extends AbstractTableDataContentPane>> plotTableDataContentPaneMap = new HashMap<Class<? extends Plot>, Class<? extends AbstractTableDataContentPane>>();
//图表类型对应的位置面板
private static Map<Class<? extends Plot>, Class<? extends BasicBeanPane<Plot>>> plotPositionMap = new HashMap<Class<? extends Plot>, Class<? extends BasicBeanPane<Plot>>>();
static {
plotPositionMap.put(PiePlot4VanChart.class, CustomPlotLocationPane.class);
plotPositionMap.put(VanChartRadarPlot.class, CustomPlotLocationPane.class);
plotPositionMap.put(VanChartGaugePlot.class, CustomPlotLocationPane.class);
}
/**
* 根据图表类型创建位置面板
* @param plot 图表
* @return 位置面板
*/
public static BasicBeanPane<Plot> createCustomPlotPositionPane(Plot plot) {
Class<? extends Plot> key = plot.getClass();
if(plotPositionMap.containsKey(key)){
try{
Class<? extends BasicBeanPane<Plot>> cl = plotPositionMap.get(key);
Constructor<? extends BasicBeanPane<Plot> > constructor = cl.getConstructor();
return constructor.newInstance();
} catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
}
return null;
}
/**
* 每种类型对应的数据配置界面
* @return
*/
static {
plotTableDataContentPaneMap.put(VanChartScatterPlot.class, VanChartScatterPlotTableDataContentPane.class);
plotTableDataContentPaneMap.put(VanChartBubblePlot.class, VanChartBubblePlotTableDataContentPane.class);
}
/**
* 根据图表类型创建数据配置
* @param plot 图表
* @param parent
* @return 数据配置界面
*/
public static AbstractTableDataContentPane createCustomPlotTableDataContentPane(Plot plot, ChartDataPane parent) {
Class<? extends Plot> key = plot.getClass();
if(plotTableDataContentPaneMap.containsKey(key)){
try{
Class<? extends AbstractTableDataContentPane> cl = plotTableDataContentPaneMap.get(key);
Constructor<? extends AbstractTableDataContentPane > constructor = cl.getConstructor(ChartDataPane.class);
return constructor.newInstance(parent);
} catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
}
return new CategoryPlotTableDataContentPane(parent);
}
/**
* plotType是否需要建立新的坐标系面板
*/
private static Map<CustomPlotType, Class<? extends VanChartAxisPane>> diffAxisMap = new HashMap<CustomPlotType, Class<? extends VanChartAxisPane>>();
static {
diffAxisMap.put(CustomPlotType.POINTER_360, VanChartGaugeAxisPane.class);
diffAxisMap.put(CustomPlotType.POINTER_180, VanChartGaugeAxisPane.class);
diffAxisMap.put(CustomPlotType.RING, VanChartGaugeAxisPane.class);
diffAxisMap.put(CustomPlotType.SLOT, VanChartGaugeAxisPane.class);
diffAxisMap.put(CustomPlotType.CUVETTE, VanChartGaugeAxisPane.class);
diffAxisMap.put(CustomPlotType.RADAR, null);//默认的为null,直接new,不用反射
diffAxisMap.put(CustomPlotType.STACK_RADAR, null);
}
public static Boolean isUseDiffAxisPane(VanChartPlot plot){
CustomPlotType customPlotType = CustomPlotFactory.getCustomType(plot);
return diffAxisMap.containsKey(customPlotType);
}
public static VanChartAxisPane createAxisPane(VanChartAxisPlot plot, VanChartStylePane parent) {
CustomPlotType key = CustomPlotFactory.getCustomType((VanChartPlot)plot);
if(diffAxisMap.containsKey(key)){
try{
Class<? extends VanChartAxisPane> cl = diffAxisMap.get(key);
if(cl != null) {
Constructor<? extends VanChartAxisPane> constructor = cl.getConstructor(VanChartAxisPlot.class, VanChartStylePane.class);
return constructor.newInstance(plot, parent);
}
} catch (Exception e){
FRLogger.getLogger().error(e.getMessage());
}
}
return new VanChartAxisPane(plot,parent);
}
}

66
designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomDataPane.java

@ -0,0 +1,66 @@
package com.fr.plugin.chart.custom;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import javax.swing.*;
import java.awt.*;
/**
* Created by Fangjie on 2016/4/29.
*/
public class VanChartCustomDataPane extends ChartDataPane {
private VanChartCustomPlotDataContentsTabPane contentsTabPane;
private Chart chart;
public VanChartCustomDataPane(AttributeChangeListener listener) {
super(listener);
}
@Override
protected JPanel createContentPane() {
JPanel content = new JPanel(new BorderLayout());
if (chart == null) {
return content;
}
contentsTabPane = new VanChartCustomPlotDataContentsTabPane((VanChartCustomPlot)chart.getPlot(), VanChartCustomDataPane.this, listener);
content.add(contentsTabPane, BorderLayout.CENTER);
return content;
}
public void populate(ChartCollection collection) {
this.chart = collection.getSelectedChart();
this.remove(leftContentPane);
initContentPane();
this.removeAttributeChangeListener();
contentsTabPane.populateBean(collection);
this.addAttributeChangeListener(listener);
this.initAllListeners();
}
@Override
/**
* 返回绑定的属性事件.
* @param listener 增加监听
*/
public void addAttributeChangeListener(AttributeChangeListener listener) {
super.addAttributeChangeListener(listener);
contentsTabPane.addAttributeChangeListener(listener);
}
@Override
/**
* 保存 数据界面内容
*/
public void update(ChartCollection collection){
if(contentsTabPane != null) {
contentsTabPane.updateBean(collection);
}
}
}

175
designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotDataContentsTabPane.java

@ -0,0 +1,175 @@
package com.fr.plugin.chart.custom;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.component.VanChartCustomPlotTabPane;
import com.fr.plugin.chart.custom.component.VanChartDataPane;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import javax.swing.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* Created by Fangjie on 2016/4/29.
*/
public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane<VanChartCustomPlot, ChartCollection> {
public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) {
super(plot, parent, listener);
}
@Override
protected void initTabTitle() {
if (plot == null){
return;
}
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
NameArray = new String[Math.min(customPlotList.size(), paneList.size())];
for (int i = 0; i < customPlotList.size() && i < paneList.size(); i++) {
JPanel pane = paneList.get(i);
//获取点的tooltip作为标题
VanChartPlot vanChartPlot = customPlotList.get(i);
CustomPlotType plotType = CustomPlotFactory.getCustomType(vanChartPlot);
NameArray[i] = CustomPlotFactory.getTitle(plotType);
centerPane.add(pane, NameArray[i]);
}
}
@Override
protected List<JPanel> initPaneList() {
if (plot == null){
return null;
}
List<JPanel> paneList = new ArrayList<JPanel>();
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
for (int i = 0; i < customPlotList.size(); i++){
//根据不同的plot创建不同的数据配置界面
ChartDataPane contentPane = new VanChartDataPane(listener);
paneList.add(contentPane);
}
return paneList;
}
@Override
public void populateBean(ChartCollection chartCollection){
plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot();
if (paneList == null){
paneList = initPaneList();
}
if (paneList != null){
try {
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) {
//將plot包裝起来,主要是为了获取dataDefinition
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
//设置collection的plot
cloneCollection.getSelectedChart().setPlot(customPlotList.get(i));
//获取definitionMap中的dataDefinition
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
TopDefinitionProvider dataDefinition = null;
if (definition != null && definition instanceof CustomDefinition) {
Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = ((CustomDefinition)definition).getDefinitionProviderMap();
dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i)));
}
cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition);
((ChartDataPane) paneList.get(i)).populate(cloneCollection);
}
}catch (Exception e){
return;
}
}
}
@Override
public ChartCollection updateBean() {
return null;
}
@Override
public void updateBean(ChartCollection collection){
if (paneList == null || plot == null){
return;
}
try {
Map<CustomPlotType, TopDefinitionProvider> definitionMap = new HashMap<CustomPlotType, TopDefinitionProvider>();
//已经有的数据配置不允许重置
for (int i = 0; i < paneList.size() && i < plot.getCustomPlotList().size(); i++) {
//将plot包裝起来,主要是为了获取dataDefinition
ChartCollection cloneCollection = (ChartCollection) collection.clone();
//设置Collection的plot
cloneCollection.getSelectedChart().setPlot(plot.getCustomPlotList().get(i));
//重置
cloneCollection.getSelectedChart().setFilterDefinition(null);
//更新
((ChartDataPane) paneList.get(i)).update(cloneCollection);
CustomPlotFactory.setCustomCategoryAttr(plot);
//将处理好的dataDefinition剥离出来并存储
definitionMap.put(CustomPlotFactory.getCustomType(plot.getCustomPlotList().get(i)), cloneCollection.getSelectedChart().getFilterDefinition());
}
CustomDefinition customDefinition = new CustomDefinition();
customDefinition.setDefinitionProviderMap(definitionMap);
collection.getSelectedChart().setFilterDefinition(customDefinition);
}catch (Exception e){
return;
}
}
@Override
public boolean accept(Object ob) {
return false;
}
@Override
public String title4PopupWindow() {
return null;
}
@Override
public void reset() {
}
/**
* 返回绑定的属性事件.
* @param listener 增加监听
*/
public void addAttributeChangeListener(AttributeChangeListener listener) {
for (int i = 0; i < paneList.size(); i++){
((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener);
}
}
}

296
designer_chart/src/com/fr/plugin/chart/custom/VanChartCustomPlotPane.java

@ -0,0 +1,296 @@
package com.fr.plugin.chart.custom;
import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.DataSeriesCondition;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.general.FRLogger;
import com.fr.general.Inter;
import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.custom.component.VanChartCustomPlotSelectPane;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.custom.type.CustomStyle;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.designer.type.AbstractVanChartTypePane;
import com.fr.plugin.chart.vanchart.VanChart;
import javax.swing.*;
import java.awt.*;
import java.util.HashMap;
import java.util.Map;
/**
* Created by Mitisky on 16/2/16.
*/
public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
public static final String TITLE = Inter.getLocText("Plugin-ChartF_NewCustom");
//是否选择自定义
private boolean isCustom = false;
private static final long serialVersionUID = -3481633368542654247L;
//切换到自定义组合图时,显示的版面
private JPanel customPane;
private VanChartCustomPlotSelectPane customSelectPane;
private JPanel autoPane;
//自定义和自动版面的容器,cardLayOut布局
private JPanel contentPane;
protected Component[][] getPaneComponents(JPanel typePane){
initContent();
return new Component[][]{
new Component[]{typePane},
new Component[]{stylePane},
new Component[]{contentPane}
};
}
private void initContent() {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
autoPane = new JPanel();
customSelectPane = new VanChartCustomPlotSelectPane();
Component[][] components = new Component[][]{
new Component[]{new JSeparator()},
new Component[]{customSelectPane}
};
double[] columnSize = {p, f};
double[] rowSize = {p, p};
customPane = TableLayoutHelper.createTableLayoutPane(components, rowSize , columnSize);
contentPane = new JPanel(new CardLayout()){
@Override
public Dimension getPreferredSize() {
if(isCustom){
return customPane.getPreferredSize();
} else{
return new Dimension(autoPane.getWidth(), 0);
}
}
};
contentPane.add(autoPane, "auto");
contentPane.add(customPane, "custom");
}
private void checkCardPane() {
CardLayout cardLayout = (CardLayout) contentPane.getLayout();
if (isCustom) {
cardLayout.show(contentPane, "custom");
} else {
cardLayout.show(contentPane, "auto");
}
}
@Override
protected String[] getTypeIconPath() {
return new String[]{"/com/fr/plugin/chart/custom/images/column_line.png",
"/com/fr/plugin/chart/custom/images/column_area.png",
"/com/fr/plugin/chart/custom/images/stack_column_line.png",
"/com/fr/plugin/chart/custom/images/custom.png",
};
}
@Override
protected String[] getTypeTipName() {
return new String[]{
Inter.getLocText("Plugin-ChartF_NewCustom_ColumnLine"),
Inter.getLocText("Plugin-ChartF_NewCustom_ColumnArea"),
Inter.getLocText("Plugin-ChartF_NewCustom_StackColumnLine"),
Inter.getLocText("Plugin-ChartF_NewCustom_Custom")
};
}
@Override
/**
* 返回界面标题
* @return 界面标题
*/
public String title4PopupWindow() {
return Inter.getLocText("Plugin-ChartF_NewCustom");
}
@Override
public void updateBean(Chart chart) {
//保存上次选中的值,其会在super中更新
int lastState = lastTypeIndex;
super.updateBean(chart);
//如果上次的状态和这次的装填不在同一个页面,说明同一个图表內切换了,需要情況数据配置
if (lastState != lastTypeIndex) {
chart.setFilterDefinition(null);
}
Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes;
for(int i = 0, len = customChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
if (i == customChart.length-1){
isCustom = true;
//先重置自定义组合面板,如果不重置,无法获取选择顺序
if (lastState == customChart.length-1 && samePlot) {
//更新数据配置,刪除已经不在的图表数据
dealCustomDefinition(chart);
customSelectPane.updateBean(chart);
}else if (samePlot){//如果是同一个图表切换过来,则重置面板
customSelectPane.populateBean(chart);
}
}
}else {
isCustom = false;
}
}
checkCardPane();
}
private void dealCustomDefinition(Chart chart) {
CustomDefinition definition = (CustomDefinition) chart.getFilterDefinition();
if (definition == null){
return;
}
Map<CustomPlotType, TopDefinitionProvider> definitionMap = definition.getDefinitionProviderMap();
if (definitionMap == null){
return;
}
Map<CustomPlotType, TopDefinitionProvider> newDefinitionMap = new HashMap<CustomPlotType, TopDefinitionProvider>();
VanChartCustomPlot customPlot = (VanChartCustomPlot) chart.getPlot();
for (int i = 0; i < customPlot.getCustomPlotList().size(); i++){
CustomPlotType plotType = CustomPlotFactory.getCustomType(customPlot.getCustomPlotList().get(i));
TopDefinitionProvider definitionProvider = definitionMap.get(plotType);
newDefinitionMap.put(plotType, definitionProvider);
}
definition.setDefinitionProviderMap(newDefinitionMap);
}
/**
* 不同图表切換重置chart屬性
* @param chart
* @param newPlot
*/
@Override
protected void resetChartAttr(Chart chart, Plot newPlot){
super.resetChartAttr(chart, newPlot);
//切换图表清空数据配置
chart.setFilterDefinition(null);
//设置默认不排序
VanChartTools tools = ((VanChart)chart).getVanChartTools();
if (tools != null) {
tools.setSort(false);
}
}
/**
* 更新界面内容
*/
public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false;
}
//获取上次选中的图标
VanChartCustomPlot customPlot = (VanChartCustomPlot)chart.getPlot();
lastTypeIndex = customPlot.getCustomStyle().ordinal();
typeDemo.get(lastTypeIndex).isPressing = true;
isCustom = customPlot.getCustomStyle() == CustomStyle.CUSTOM;
//自定义选择时,更新自定义面板
if (isCustom){
customSelectPane.populateBean(chart);
}
checkCardPane();
checkDemosBackground();
}
/**
* 获取各图表类型界面ID, 本质是plotID
*
* @return 图表类型界面ID
*/
@Override
protected String getPlotTypeID() {
return VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID;
}
protected Plot getSelectedClonedPlot(){
VanChartCustomPlot newPlot = null;
Chart[] customChart = CustomIndependentVanChart.CustomVanChartTypes;
for(int i = 0, len = customChart.length; i < len; i++){
if(typeDemo.get(i).isPressing){
newPlot = (VanChartCustomPlot)customChart[i].getPlot();
}
}
Plot cloned = null;
try {
cloned = (Plot)newPlot.clone();
} catch (CloneNotSupportedException e) {
FRLogger.getLogger().error("Error In ScatterChart");
}
return cloned;
}
public Chart getDefaultChart() {
return CustomIndependentVanChart.CustomVanChartTypes[0];
}
@Override
/**
*删除配置的条件属性
*/
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot);
}
@Override
/**
* 删除线型配置
*/
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{
if (oldPlot.getConditionCollection() != null) {
ConditionCollection newCondition = new ConditionCollection();
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone());
newPlot.setConditionCollection(newCondition);
//删除线型设置
ConditionAttr attrList = newCondition.getDefaultAttr();
DataSeriesCondition attr = attrList.getExisted(VanChartAttrLine.class);
if (attr != null){
attrList.remove(VanChartAttrLine.class);
}
}
}
}

27
designer_chart/src/com/fr/plugin/chart/custom/component/CategoryCustomPlotTableDataContentPane.java

@ -0,0 +1,27 @@
package com.fr.plugin.chart.custom.component;
import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotTableDataContentPane;
/**
* Created by Fangjie on 2016/5/18.
*/
public class CategoryCustomPlotTableDataContentPane extends CategoryPlotTableDataContentPane {
public CategoryCustomPlotTableDataContentPane() {
super();
}
public CategoryCustomPlotTableDataContentPane(ChartDataPane parent) {
super(parent);
}
/**
* 检查 某些Box是否可用
* 分类不可用
* @param hasUse 是否使用
*/
public void checkBoxUse(boolean hasUse) {
categoryCombox.setEnabled(false);
checkSeriseUse(hasUse);
}
}

103
designer_chart/src/com/fr/plugin/chart/custom/component/ChartImageCheckOutPane.java

@ -0,0 +1,103 @@
package com.fr.plugin.chart.custom.component;
import com.fr.design.constants.UIConstants;
import com.fr.design.dialog.BasicPane;
import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener;
import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import javax.swing.*;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import java.awt.*;
import java.util.ArrayList;
/**
* Created by Fangjie on 2016/4/19.
*/
public class ChartImageCheckOutPane extends BasicPane implements UIObserver {
private JCheckBox checkBox;
private CustomPlotType customPlotType;
private ArrayList<ChangeListener> changeListeners = new ArrayList<ChangeListener>();
public ChartImageCheckOutPane(CustomPlotType type){
this(type, false);
}
public ChartImageCheckOutPane( CustomPlotType type, boolean isSelected){
this.customPlotType = type;
initCheckBox(isSelected);
this.add(checkBox, BorderLayout.CENTER);
}
public CustomPlotType getCustomPlotType() {
return customPlotType;
}
private void initCheckBox(boolean isSelected) {
this.checkBox = new JCheckBox();
this.checkBox.setSelected(isSelected);
//设置提示
this.checkBox.setToolTipText(CustomPlotFactory.getTooltipText(this.customPlotType));
//背景
checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType,isSelected))));
this.setLayout(new BorderLayout());
}
private String getIconPath(CustomPlotType customPlotType, boolean isSelected) {
return isSelected ? CustomPlotFactory.getTypeIconPath(customPlotType)[0] : CustomPlotFactory.getTypeIconPath(customPlotType)[1];
}
public JCheckBox getCheckBox() {
return checkBox;
}
public void checkIconImage(){
checkBox.setIcon(new ImageIcon(getClass().getResource(getIconPath(customPlotType, checkBox.isSelected()))));
}
public void setPaneBorder(boolean isRightLine, boolean isBottomLine){
this.setBorder(BorderFactory.createMatteBorder(1, 1, isBottomLine ? 1 : 0, isRightLine ? 1 : 0, UIConstants.LINE_COLOR));
}
public void setSelected(boolean isSelected){
checkBox.setSelected(isSelected);
}
public boolean isSelected(){
return checkBox.isSelected();
}
@Override
protected String title4PopupWindow() {
return null;
}
public void fireStateChange() {
for (int i = 0; i < changeListeners.size(); i++) {
changeListeners.get(i).stateChanged(new ChangeEvent(this));
}
}
@Override
public void registerChangeListener(final UIObserverListener listener) {
changeListeners.add(new ChangeListener() {
public void stateChanged(ChangeEvent e) {
listener.doChange();
}
});
}
@Override
public boolean shouldResponseChangeListener() {
return false;
}
}

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save