|
|
@ -37,6 +37,7 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.ChartStylePane; |
|
|
|
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.AbstractReportDataContentPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; |
|
|
|
|
|
|
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
@ -89,14 +90,16 @@ import com.fr.stable.EnvChangedListener; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; |
|
|
|
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.Icon; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.ArrayList; |
|
|
|
|
|
|
|
import java.util.HashMap; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.Iterator; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.LinkedHashMap; |
|
|
|
import java.util.List; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
|
|
import static com.fr.chart.charttypes.ChartTypeManager.CHART_PRIORITY; |
|
|
|
import static com.fr.chart.charttypes.ChartTypeManager.CHART_PRIORITY; |
|
|
|
|
|
|
|
import static com.fr.chart.charttypes.ChartTypeManager.VAN_CHART_PRIORITY; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Created by eason on 14/12/29. |
|
|
|
* Created by eason on 14/12/29. |
|
|
@ -109,6 +112,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>(); |
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>(); |
|
|
|
|
|
|
|
|
|
|
|
public synchronized static ChartTypeInterfaceManager getInstance() { |
|
|
|
public synchronized static ChartTypeInterfaceManager getInstance() { |
|
|
|
|
|
|
|
|
|
|
|
return classManager; |
|
|
|
return classManager; |
|
|
@ -185,32 +190,28 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
private static void readVanChart() { |
|
|
|
private static void readVanChart() { |
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces.containsKey(ChartTypeManager.VAN_CHART_PRIORITY)) { |
|
|
|
if (chartTypeInterfaces.containsKey(VAN_CHART_PRIORITY)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList = |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface()); |
|
|
|
new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface()); |
|
|
|
chartUIList.put(PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGaugePlot.VAN_CHART_GAUGE_PLOT, new GaugeIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartRadarPlot.VAN_CHART_RADAR_PLOT, new RadarIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartGaugePlot.VAN_CHART_GAUGE_PLOT, new GaugeIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID, new ScatterIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartRadarPlot.VAN_CHART_RADAR_PLOT, new RadarIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID, new ScatterIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); |
|
|
|
chartUIList.put(VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); |
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface()); |
|
|
|
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); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -219,54 +220,27 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
if (chartTypeInterfaces.containsKey(CHART_PRIORITY)) { |
|
|
|
if (chartTypeInterfaces.containsKey(CHART_PRIORITY)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList = |
|
|
|
|
|
|
|
new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); |
|
|
|
|
|
|
|
chartUIList.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
chartTypeInterfaces.put(CHART_PRIORITY, chartUIList); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String getIconPath(String plotID) { |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.LINE_CHART, new LineIndependentChartInterface()); |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.BAR_CHART, new BarIndependentChartInterface()); |
|
|
|
for (Map.Entry<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> entry : chartTypeInterfaces.entrySet()) { |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.PIE_CHART, new PieIndependentChartInterface()); |
|
|
|
String priority = entry.getKey(); |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); |
|
|
|
String imagePath = getIconPath(priority, plotID); |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); |
|
|
|
if (StringUtils.isNotEmpty(imagePath)) { |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); |
|
|
|
return imagePath; |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); |
|
|
|
} |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); |
|
|
|
} |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.METER_CHART, new MeterIndependentChartInterface()); |
|
|
|
} |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); |
|
|
|
return StringUtils.EMPTY; |
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.MAP_CHART, new MapIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface()); |
|
|
|
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private String getIconPath(String priority, String plotID) { |
|
|
|
private static void addChartTypeInterface(String priority, String plotID, IndependentChartUIProvider provider) { |
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces.get(priority) != null && chartTypeInterfaces.get(priority).get(plotID) != null) { |
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getIconPath(); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static void addChartTypeInterface(IndependentChartUIProvider provider, String priority, String plotID) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
@ -281,9 +255,19 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
idAndPriorityMap.put(plotID, priority); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static IndependentChartUIProvider getChartTypeInterface(String plotID) { |
|
|
|
|
|
|
|
if (idAndPriorityMap.containsKey(plotID)) { |
|
|
|
|
|
|
|
String priority = idAndPriorityMap.get(plotID); |
|
|
|
|
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return null; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* 把所有的pane加到list里 |
|
|
|
* 把所有的pane加到list里 |
|
|
@ -295,11 +279,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
List<Integer> priorityList = getPriorityInOrder(); |
|
|
|
List<Integer> priorityList = getPriorityInOrder(); |
|
|
|
for (Integer aPriorityList : priorityList) { |
|
|
|
for (Integer aPriorityList : priorityList) { |
|
|
|
String priority = String.valueOf(aPriorityList); |
|
|
|
String priority = String.valueOf(aPriorityList); |
|
|
|
Iterator chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); |
|
|
|
Iterator<Map.Entry<String, IndependentChartUIProvider>> chartUIIterator = chartTypeInterfaces.get(priority).entrySet().iterator(); |
|
|
|
while (chartUIIterator.hasNext()) { |
|
|
|
while (chartUIIterator.hasNext()) { |
|
|
|
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); |
|
|
|
Map.Entry<String, IndependentChartUIProvider> chartUIEntry = chartUIIterator.next(); |
|
|
|
IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue(); |
|
|
|
IndependentChartUIProvider provider = chartUIEntry.getValue(); |
|
|
|
paneList.add(provider.getPlotTypePane()); |
|
|
|
AbstractChartTypePane pane = provider.getPlotTypePane(); |
|
|
|
|
|
|
|
pane.setPlotID(chartUIEntry.getKey()); |
|
|
|
|
|
|
|
paneList.add(pane); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -397,22 +383,24 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
return index; |
|
|
|
return index; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { |
|
|
|
public String getIconPath(String plotID) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
while (iterator.hasNext()) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
if (provider != null) { |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
return provider.getIconPath(); |
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
|
|
|
return getChartDataPane(priority, plotID, listener); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return getChartDataPane(CHART_PRIORITY, plotID, listener); |
|
|
|
return StringUtils.EMPTY; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ChartDataPane getChartDataPane(String priority, String plotID, AttributeChangeListener listener) { |
|
|
|
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { |
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
|
|
|
if (provider != null) { |
|
|
|
|
|
|
|
return provider.getChartDataPane(listener); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getChartDataPane(listener); |
|
|
|
return new ChartDataPane(listener); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -428,54 +416,33 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) { |
|
|
|
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) { |
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
if (provider != null) { |
|
|
|
while (iterator.hasNext()) { |
|
|
|
return provider.getAttrPaneArray(listener); |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
|
|
|
return getAttrPaneArray(priority, plotID, listener); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getAttrPaneArray(CHART_PRIORITY, plotID, listener); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private AbstractChartAttrPane[] getAttrPaneArray(String priority, String plotID, AttributeChangeListener listener) { |
|
|
|
return new AbstractChartAttrPane[0]; |
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getAttrPaneArray(listener); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getTableDataSourcePane(plot, parent); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
|
|
|
return getTableDataSourcePane(priority, plot, parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getTableDataSourcePane(CHART_PRIORITY, plot, parent); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private AbstractTableDataContentPane getTableDataSourcePane(String priority, Plot plot, ChartDataPane parent) { |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getTableDataSourcePane(plot, parent); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getReportDataSourcePane(plot, parent); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
String plotID = plot.getPlotID(); |
|
|
|
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
|
|
|
return getReportDataSourcePane(priority, plot, parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return getReportDataSourcePane(CHART_PRIORITY, plot, parent); |
|
|
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean plotInChart(String plotID, String priority) { |
|
|
|
private boolean plotInChart(String plotID, String priority) { |
|
|
@ -485,47 +452,25 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
&& chartTypeInterfaces.get(priority).containsKey(plotID); |
|
|
|
&& chartTypeInterfaces.get(priority).containsKey(plotID); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private AbstractReportDataContentPane getReportDataSourcePane(String priority, Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getReportDataSourcePane(plot, parent); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ConditionAttributesPane getPlotConditionPane(Plot plot) { |
|
|
|
public ConditionAttributesPane getPlotConditionPane(Plot plot) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getPlotConditionPane(plot); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
|
|
|
return getPlotConditionPane(priority, plot); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getPlotConditionPane(CHART_PRIORITY, plot); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ConditionAttributesPane getPlotConditionPane(String priority, Plot plot) { |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotConditionPane(plot); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getPlotSeriesPane(parent, plot); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
|
|
|
return getPlotSeriesPane(priority, parent, plot); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getPlotSeriesPane(CHART_PRIORITY, parent, plot); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private BasicBeanPane<Plot> getPlotSeriesPane(String priority, ChartStylePane parent, Plot plot) { |
|
|
|
return null; |
|
|
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotSeriesPane(parent, plot); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
@ -536,22 +481,23 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.isUseDefaultPane(); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (chartTypeInterfaces.get(priority).containsKey(plotID)) { |
|
|
|
|
|
|
|
return isUseDefaultPane(priority, plotID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private boolean isUseDefaultPane(String priority, String plotID) { |
|
|
|
public boolean needChartChangePane(Chart chart) { |
|
|
|
|
|
|
|
if (chart != null && chart.getPlot() != null) { |
|
|
|
return !(chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) || chartTypeInterfaces.get(priority).get(plotID).isUseDefaultPane(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(chart.getPlot().getPlotID()); |
|
|
|
|
|
|
|
if (provider != null) { |
|
|
|
|
|
|
|
return provider.needChartChangePane(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -561,7 +507,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
String priority = injection.getAttribute("priority", CHART_PRIORITY); |
|
|
|
String priority = injection.getAttribute("priority", CHART_PRIORITY); |
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
IndependentChartUIProvider instance = (IndependentChartUIProvider) injection.getObject(); |
|
|
|
IndependentChartUIProvider instance = (IndependentChartUIProvider) injection.getObject(); |
|
|
|
addChartTypeInterface(instance, priority, plotID); |
|
|
|
addChartTypeInterface(priority, plotID, instance); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -593,37 +539,21 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//获取指定图表的编辑面板
|
|
|
|
|
|
|
|
public ChartEditPane getChartEditPane(String plotID) { |
|
|
|
public ChartEditPane getChartEditPane(String plotID) { |
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getChartEditPane(plotID); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
|
|
|
return getChartEditPane(priority, plotID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
return getChartEditPane(CHART_PRIORITY, plotID); |
|
|
|
return new ChartEditPane(); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private ChartEditPane getChartEditPane(String priority, String plotID) { |
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getChartEditPane(plotID); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
return provider.getChartConfigPane(plotID); |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
|
|
|
return getChartConfigPane(priority, plotID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return getChartConfigPane(CHART_PRIORITY, plotID); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private ChartsConfigPane getChartConfigPane(String priority, String plotID) { |
|
|
|
return null; |
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getChartConfigPane(plotID); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |