Browse Source

CHART-11810

research/11.0
白岳 5 years ago
parent
commit
7a0154ca96
  1. 61
      designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java
  2. 7
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java
  3. 14
      designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java
  4. 8
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  5. 14
      designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java
  6. 12
      designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java
  7. 26
      designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java
  8. 7
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java
  9. 34
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java
  10. 25
      designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java
  11. 14
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java
  12. 13
      designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java
  13. 14
      designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java

61
designer-chart/src/main/java/com/fr/van/chart/bubble/VanChartBubblePlotPane.java

@ -7,7 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.attr.ZoomAttribute; import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.bubble.BubbleIndependentVanChart; import com.fr.plugin.chart.bubble.BubbleIndependentVanChart;
import com.fr.plugin.chart.bubble.VanChartBubblePlot; import com.fr.plugin.chart.bubble.VanChartBubblePlot;
@ -33,26 +39,26 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
}; };
} }
private void removeDefaultAttr(ConditionAttr conditionAttr, Class <? extends DataSeriesCondition> targetClass) { private void removeDefaultAttr(ConditionAttr conditionAttr, Class<? extends DataSeriesCondition> targetClass) {
DataSeriesCondition attr = conditionAttr.getExisted(targetClass); DataSeriesCondition attr = conditionAttr.getExisted(targetClass);
if (attr != null){ if (attr != null) {
conditionAttr.remove(targetClass); conditionAttr.remove(targetClass);
} }
} }
protected Plot getSelectedClonedPlot(){ protected Plot getSelectedClonedPlot() {
VanChartBubblePlot newPlot = null; VanChartBubblePlot newPlot = null;
Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes; Chart[] bubbleChart = BubbleIndependentVanChart.BubbleVanChartTypes;
for(int i = 0, len = bubbleChart.length; i < len; i++){ for (int i = 0, len = bubbleChart.length; i < len; i++) {
if(typeDemo.get(i).isPressing){ if (typeDemo.get(i).isPressing) {
newPlot = (VanChartBubblePlot)bubbleChart[i].getPlot(); newPlot = (VanChartBubblePlot) bubbleChart[i].getPlot();
} }
} }
Plot cloned = null; Plot cloned = null;
try { try {
if(newPlot != null) { if (newPlot != null) {
cloned = (Plot) newPlot.clone(); cloned = (Plot) newPlot.clone();
} }
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In BubbleChart"); FineLoggerFactory.getLogger().error("Error In BubbleChart");
} }
@ -64,16 +70,16 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
} }
@Override @Override
/** /**
* 力學氣泡圖切換到其他氣泡圖時刪除條件屬性 * 力學氣泡圖切換到其他氣泡圖時刪除條件屬性
* 并且将bubbleAttr属性重置 * 并且将bubbleAttr属性重置
*/ */
protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ protected void cloneOldConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
cloneOldDefaultAttrConditionCollection(oldPlot, newPlot); cloneOldDefaultAttrConditionCollection(oldPlot, newPlot);
} }
@Override @Override
protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ protected void cloneOldDefaultAttrConditionCollection(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
if (oldPlot.getConditionCollection() != null) { if (oldPlot.getConditionCollection() != null) {
ConditionCollection newCondition = new ConditionCollection(); ConditionCollection newCondition = new ConditionCollection();
newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone()); newCondition.setDefaultAttr((ConditionAttr) oldPlot.getConditionCollection().getDefaultAttr().clone());
@ -88,7 +94,7 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
removeDefaultAttr(attrList, ScatterAttrLabel.class); removeDefaultAttr(attrList, ScatterAttrLabel.class);
AttrAlpha attrAlpha = new AttrAlpha(); AttrAlpha attrAlpha = new AttrAlpha();
attrAlpha.setAlpha(((VanChartBubblePlot)newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA); attrAlpha.setAlpha(((VanChartBubblePlot) newPlot).isForceBubble() ? FORCE_ALPHA : ALPHA);
attrList.addDataSeriesCondition(attrAlpha); attrList.addDataSeriesCondition(attrAlpha);
} }
@ -96,8 +102,8 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
@Override @Override
protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException { protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
if(oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot){ if (oldPlot instanceof VanChartBubblePlot && newPlot instanceof VanChartBubblePlot) {
if(((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()){ if (((VanChartBubblePlot) oldPlot).isForceBubble() == ((VanChartBubblePlot) newPlot).isForceBubble()) {
super.cloneHotHyperLink(oldPlot, newPlot); super.cloneHotHyperLink(oldPlot, newPlot);
} }
} }
@ -112,12 +118,27 @@ public class VanChartBubblePlotPane extends AbstractVanChartTypePane {
/** /**
* 气泡图相同图表类型之间切换的时候chart的部分属性也需要重置 * 气泡图相同图表类型之间切换的时候chart的部分属性也需要重置
*
* @param chart * @param chart
*/ */
@Override @Override
protected void resetChartAttr4SamePlot(Chart chart){ protected void resetChartAttr4SamePlot(Chart chart) {
((VanChart) chart).setZoomAttribute(new ZoomAttribute()); ((VanChart) chart).setZoomAttribute(new ZoomAttribute());
//重置监控刷新选项 //重置监控刷新选项
resetRefreshMoreLabelAttr((VanChart)chart); resetRefreshMoreLabelAttr((VanChart) chart);
}
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
boolean isForce = ((VanChartBubblePlot) vanChartPlot).isForceBubble();
if (isForce) {
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
return columnFieldCollection instanceof BubbleColumnFieldCollection;
}
return false;
} }
} }

7
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotPane.java

@ -7,11 +7,13 @@ import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.data.AbstractDataDefinition; import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.CustomChartDataDefinition; import com.fr.chartx.data.CustomChartDataDefinition;
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.type.ChartImagePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.custom.CustomDefinition; import com.fr.plugin.chart.custom.CustomDefinition;
@ -295,4 +297,9 @@ public class VanChartCustomPlotPane extends AbstractVanChartTypePane {
} }
} }
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof CustomDefinition;
}
} }

14
designer-chart/src/main/java/com/fr/van/chart/designer/type/AbstractVanChartTypePane.java

@ -8,6 +8,10 @@ import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chart.chartglyph.DataSheet; import com.fr.chart.chartglyph.DataSheet;
import com.fr.chartx.attr.ZoomAttribute; import com.fr.chartx.attr.ZoomAttribute;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.design.ChartTypeInterfaceManager; import com.fr.design.ChartTypeInterfaceManager;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.MultilineLabel; import com.fr.design.gui.ilable.MultilineLabel;
@ -108,11 +112,19 @@ public abstract class AbstractVanChartTypePane extends AbstractChartTypePane<Cha
} }
if(chart instanceof VanChart if(chart instanceof VanChart
&& oldPlot.getDefinitionType()!=newPlot.getDefinitionType()) { && !acceptDefinition(((VanChart) chart).getChartDataDefinition(), newPlot)) {
((VanChart) chart).setChartDataDefinition(null); ((VanChart) chart).setChartDataDefinition(null);
} }
} }
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
return false;
}
protected void resetChartAttr4SamePlot(Chart chart){ protected void resetChartAttr4SamePlot(Chart chart){
resetRefreshMoreLabelAttr((VanChart) chart); resetRefreshMoreLabelAttr((VanChart) chart);
} }

8
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java

@ -2,9 +2,12 @@ package com.fr.van.chart.drillmap.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart; import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.map.designer.type.VanChartMapPlotPane; import com.fr.van.chart.map.designer.type.VanChartMapPlotPane;
@ -66,4 +69,9 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
drillMapPlot.setLayerLevelList(new ArrayList<ZoomLevel>()); drillMapPlot.setLayerLevelList(new ArrayList<ZoomLevel>());
drillMapPlot.setLayerMapTypeList(new ArrayList<MapType>()); drillMapPlot.setLayerMapTypeList(new ArrayList<MapType>());
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof DrillMapDefinition;
}
} }

14
designer-chart/src/main/java/com/fr/van/chart/funnel/designer/type/VanChartFunnelTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.funnel.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.ColumnFieldCollectionWithSeriesValue;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.funnel.FunnelIndependentVanChart; import com.fr.plugin.chart.funnel.FunnelIndependentVanChart;
import com.fr.plugin.chart.funnel.VanChartFunnelPlot; import com.fr.plugin.chart.funnel.VanChartFunnelPlot;
@ -43,4 +48,13 @@ public class VanChartFunnelTypePane extends AbstractVanChartTypePane {
public Chart getDefaultChart() { public Chart getDefaultChart() {
return FunnelIndependentVanChart.FunnelVanChartTypes[0]; return FunnelIndependentVanChart.FunnelVanChartTypes[0];
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection.getClass().equals(ColumnFieldCollectionWithSeriesValue.class);
}
return false;
}
} }

12
designer-chart/src/main/java/com/fr/van/chart/gantt/designer/type/VanChartGanttPlotPane.java

@ -2,7 +2,10 @@ package com.fr.van.chart.gantt.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.GanttChartDataDefinition;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.gantt.GanttIndependentVanChart; import com.fr.plugin.chart.gantt.GanttIndependentVanChart;
import com.fr.plugin.chart.gantt.VanChartGanttPlot; import com.fr.plugin.chart.gantt.VanChartGanttPlot;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane; import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
@ -21,16 +24,21 @@ public class VanChartGanttPlotPane extends AbstractVanChartTypePane {
return GanttIndependentVanChart.ganttVanChartTypes[0]; return GanttIndependentVanChart.ganttVanChartTypes[0];
} }
protected Plot getSelectedClonedPlot(){ protected Plot getSelectedClonedPlot() {
Chart chart = getDefaultChart(); Chart chart = getDefaultChart();
VanChartGanttPlot newPlot = (VanChartGanttPlot) chart.getPlot(); VanChartGanttPlot newPlot = (VanChartGanttPlot) chart.getPlot();
Plot cloned = null; Plot cloned = null;
try { try {
cloned = (Plot)newPlot.clone(); cloned = (Plot) newPlot.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
return cloned; return cloned;
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof GanttChartDataDefinition;
}
} }

26
designer-chart/src/main/java/com/fr/van/chart/gauge/VanChartGaugePlotPane.java

@ -2,9 +2,16 @@ package com.fr.van.chart.gauge;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.GaugeColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiCategoryColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.gauge.GaugeIndependentVanChart; import com.fr.plugin.chart.gauge.GaugeIndependentVanChart;
import com.fr.plugin.chart.gauge.VanChartGaugePlot; import com.fr.plugin.chart.gauge.VanChartGaugePlot;
import com.fr.plugin.chart.type.GaugeStyle;
import com.fr.van.chart.designer.type.AbstractVanChartTypePane; import com.fr.van.chart.designer.type.AbstractVanChartTypePane;
/** /**
@ -73,4 +80,23 @@ public class VanChartGaugePlotPane extends AbstractVanChartTypePane {
} }
} }
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
GaugeStyle gaugeStyle = ((VanChartGaugePlot) vanChartPlot).getGaugeStyle();
switch (gaugeStyle) {
case RING:
case SLOT:
case THERMOMETER:
return columnFieldCollection instanceof GaugeColumnFieldCollection;
case POINTER:
case POINTER_SEMI:
default:
return columnFieldCollection instanceof MultiCategoryColumnFieldCollection;
}
}
return false;
}
} }

7
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/type/VanChartHeatMapTypePane.java

@ -2,8 +2,10 @@ package com.fr.van.chart.heatmap.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart; import com.fr.plugin.chart.heatmap.HeatMapIndependentVanChart;
import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot; import com.fr.plugin.chart.heatmap.VanChartHeatMapPlot;
@ -70,4 +72,9 @@ public class VanChartHeatMapTypePane extends VanChartMapPlotPane {
public Chart getDefaultChart() { public Chart getDefaultChart() {
return HeatMapIndependentVanChart.HeatMapVanCharts[0]; return HeatMapIndependentVanChart.HeatMapVanCharts[0];
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return false;
}
} }

34
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -2,9 +2,12 @@ package com.fr.van.chart.map.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.MapChartDataDefinition;
import com.fr.design.mainframe.chart.gui.type.ChartImagePane; import com.fr.design.mainframe.chart.gui.type.ChartImagePane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.MapIndependentVanChart; import com.fr.plugin.chart.map.MapIndependentVanChart;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
@ -31,10 +34,10 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
}; };
} }
protected Component[][] getPaneComponents(JPanel typePane){ protected Component[][] getPaneComponents(JPanel typePane) {
try { try {
sourceChoosePane = createSourceChoosePane(); sourceChoosePane = createSourceChoosePane();
} catch (Exception e){ } catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
return new Component[][]{ return new Component[][]{
@ -51,10 +54,10 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
* 更新界面内容 * 更新界面内容
*/ */
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
for(ChartImagePane imagePane : typeDemo) { for (ChartImagePane imagePane : typeDemo) {
imagePane.isPressing = false; imagePane.isPressing = false;
} }
VanChartMapPlot plot = (VanChartMapPlot)chart.getPlot(); VanChartMapPlot plot = (VanChartMapPlot) chart.getPlot();
typeDemo.get(plot.getDetailType()).isPressing = true; typeDemo.get(plot.getDetailType()).isPressing = true;
populateSourcePane(plot); populateSourcePane(plot);
@ -69,7 +72,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
protected void populateSourcePane(VanChartMapPlot plot) { protected void populateSourcePane(VanChartMapPlot plot) {
//populate需要使用clone的plot //populate需要使用clone的plot
try { try {
VanChartMapPlot mapPlot = (VanChartMapPlot)plot.clone(); VanChartMapPlot mapPlot = (VanChartMapPlot) plot.clone();
sourceChoosePane.populateBean(mapPlot); sourceChoosePane.populateBean(mapPlot);
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
@ -79,9 +82,9 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
public void updateBean(Chart chart) { public void updateBean(Chart chart) {
super.updateBean(chart); super.updateBean(chart);
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
if(plot instanceof VanChartMapPlot) { if (plot instanceof VanChartMapPlot) {
sourceChoosePane.updateBean((VanChartMapPlot) plot); sourceChoosePane.updateBean((VanChartMapPlot) plot);
if(!isSamePlot() || (typeChanged && isSamePlot())){ if (!isSamePlot() || (typeChanged && isSamePlot())) {
resetAttr(plot); resetAttr(plot);
} }
} }
@ -89,11 +92,12 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
/** /**
* 不同地图类型的超链不需要复制 * 不同地图类型的超链不需要复制
*
* @param oldPlot * @param oldPlot
* @param newPlot * @param newPlot
* @throws CloneNotSupportedException * @throws CloneNotSupportedException
*/ */
protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException{ protected void cloneHotHyperLink(Plot oldPlot, Plot newPlot) throws CloneNotSupportedException {
} }
@ -106,11 +110,11 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
sourceChoosePane.resetComponentValue((VanChartMapPlot) plot); sourceChoosePane.resetComponentValue((VanChartMapPlot) plot);
} }
protected Plot getSelectedClonedPlot(){ protected Plot getSelectedClonedPlot() {
VanChartMapPlot newPlot = null; VanChartMapPlot newPlot = null;
Chart[] charts = getDefaultCharts(); Chart[] charts = getDefaultCharts();
for(int i = 0, len = charts.length; i < len; i++){ for (int i = 0, len = charts.length; i < len; i++) {
if(typeDemo.get(i).isPressing){ if (typeDemo.get(i).isPressing) {
newPlot = (VanChartMapPlot) charts[i].getPlot(); newPlot = (VanChartMapPlot) charts[i].getPlot();
} }
} }
@ -119,7 +123,7 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
return cloned; return cloned;
} }
try { try {
cloned = (Plot)newPlot.clone(); cloned = (Plot) newPlot.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e); FineLoggerFactory.getLogger().error(e.getMessage(), e);
} }
@ -142,8 +146,12 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
return MapIndependentVanChart.MapVanCharts[0]; return MapIndependentVanChart.MapVanCharts[0];
} }
public VanChartMapSourceChoosePane getSourceChoosePane(){ public VanChartMapSourceChoosePane getSourceChoosePane() {
return this.sourceChoosePane; return this.sourceChoosePane;
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
return definition instanceof MapChartDataDefinition;
}
} }

25
designer-chart/src/main/java/com/fr/van/chart/multilayer/VanChartMultiPiePlotPane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.multilayer;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.MultiPieColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChart; import com.fr.plugin.chart.multilayer.MultiPieIndependentVanChart;
import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot; import com.fr.plugin.chart.multilayer.VanChartMultiPiePlot;
@ -20,11 +25,11 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
} }
@Override @Override
protected Plot getSelectedClonedPlot(){ protected Plot getSelectedClonedPlot() {
VanChartMultiPiePlot newPlot = null; VanChartMultiPiePlot newPlot = null;
Chart[] multilayerCharts = MultiPieIndependentVanChart.MultilayerVanChartTypes; Chart[] multilayerCharts = MultiPieIndependentVanChart.MultilayerVanChartTypes;
for(int i = 0, len = multilayerCharts.length; i < len; i++){ for (int i = 0, len = multilayerCharts.length; i < len; i++) {
if(typeDemo.get(i).isPressing){ if (typeDemo.get(i).isPressing) {
newPlot = (VanChartMultiPiePlot) multilayerCharts[i].getPlot(); newPlot = (VanChartMultiPiePlot) multilayerCharts[i].getPlot();
} }
} }
@ -34,7 +39,7 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
return cloned; return cloned;
} }
try { try {
cloned = (Plot)newPlot.clone(); cloned = (Plot) newPlot.clone();
} catch (CloneNotSupportedException e) { } catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error In MultiPieChart"); FineLoggerFactory.getLogger().error("Error In MultiPieChart");
} }
@ -43,13 +48,14 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
/** /**
* 防止新建其他图表从而切换很卡 * 防止新建其他图表从而切换很卡
*
* @return * @return
*/ */
public Chart getDefaultChart() { public Chart getDefaultChart() {
return MultiPieIndependentVanChart.MultilayerVanChartTypes[0]; return MultiPieIndependentVanChart.MultilayerVanChartTypes[0];
} }
protected void resetChartAttr(Chart chart, Plot newPlot){ protected void resetChartAttr(Chart chart, Plot newPlot) {
super.resetChartAttr(chart, newPlot); super.resetChartAttr(chart, newPlot);
//重置工具栏选项 //重置工具栏选项
VanChartTools tools = ((VanChart) chart).getVanChartTools(); VanChartTools tools = ((VanChart) chart).getVanChartTools();
@ -59,4 +65,13 @@ public class VanChartMultiPiePlotPane extends AbstractVanChartTypePane {
tools.setExport(false); tools.setExport(false);
} }
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if (definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof MultiPieColumnFieldCollection;
}
return false;
}
} }

14
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterPlotPane.java

@ -5,7 +5,12 @@ import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.ConditionAttr; import com.fr.chart.chartglyph.ConditionAttr;
import com.fr.chart.chartglyph.ConditionCollection; import com.fr.chart.chartglyph.ConditionCollection;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.BubbleColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartAttrLine; import com.fr.plugin.chart.base.VanChartAttrLine;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.scatter.ScatterIndependentVanChart; import com.fr.plugin.chart.scatter.ScatterIndependentVanChart;
@ -81,4 +86,13 @@ public class VanChartScatterPlotPane extends AbstractVanChartTypePane {
} }
} }
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof BubbleColumnFieldCollection;
}
return false;
}
} }

13
designer-chart/src/main/java/com/fr/van/chart/structure/desinger/type/VanChartStructureTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.structure.desinger.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.StructureColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.structure.StructureIndependentVanChart; import com.fr.plugin.chart.structure.StructureIndependentVanChart;
import com.fr.plugin.chart.structure.VanChartStructurePlot; import com.fr.plugin.chart.structure.VanChartStructurePlot;
@ -54,4 +59,12 @@ public class VanChartStructureTypePane extends AbstractVanChartTypePane {
return WordCloudIndependentVanChart.WordCloudVanCharts[0]; return WordCloudIndependentVanChart.WordCloudVanCharts[0];
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof StructureColumnFieldCollection;
}
return false;
}
} }

14
designer-chart/src/main/java/com/fr/van/chart/wordcloud/designer/type/VanChartWordCloudTypePane.java

@ -2,7 +2,12 @@ package com.fr.van.chart.wordcloud.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.AbstractDataDefinition;
import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.chartx.data.field.AbstractColumnFieldCollection;
import com.fr.chartx.data.field.diff.WordCloudColumnFieldCollection;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot; import com.fr.plugin.chart.wordcloud.VanChartWordCloudPlot;
import com.fr.plugin.chart.wordcloud.WordCloudIndependentVanChart; import com.fr.plugin.chart.wordcloud.WordCloudIndependentVanChart;
@ -63,4 +68,13 @@ public class VanChartWordCloudTypePane extends AbstractVanChartTypePane {
public Chart getDefaultChart() { public Chart getDefaultChart() {
return WordCloudIndependentVanChart.WordCloudVanCharts[0]; return WordCloudIndependentVanChart.WordCloudVanCharts[0];
} }
@Override
protected boolean acceptDefinition(ChartDataDefinitionProvider definition, VanChartPlot vanChartPlot) {
if(definition instanceof AbstractDataDefinition) {
AbstractColumnFieldCollection columnFieldCollection = ((AbstractDataDefinition) definition).getColumnFieldCollection();
return columnFieldCollection instanceof WordCloudColumnFieldCollection;
}
return false;
}
} }

Loading…
Cancel
Save