|
|
|
@ -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.data.report.AbstractReportDataContentPane; |
|
|
|
|
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.form.ui.ChartEditor; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
@ -89,14 +90,16 @@ import com.fr.stable.EnvChangedListener;
|
|
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
import com.fr.stable.plugin.ExtraChartDesignClassManagerProvider; |
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
|
import javax.swing.Icon; |
|
|
|
|
import java.util.ArrayList; |
|
|
|
|
import java.util.HashMap; |
|
|
|
|
import java.util.Iterator; |
|
|
|
|
import java.util.LinkedHashMap; |
|
|
|
|
import java.util.List; |
|
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
|
|
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. |
|
|
|
@ -109,6 +112,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>(); |
|
|
|
|
|
|
|
|
|
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>(); |
|
|
|
|
|
|
|
|
|
public synchronized static ChartTypeInterfaceManager getInstance() { |
|
|
|
|
|
|
|
|
|
return classManager; |
|
|
|
@ -185,32 +190,28 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
private static void readVanChart() { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces.containsKey(ChartTypeManager.VAN_CHART_PRIORITY)) { |
|
|
|
|
if (chartTypeInterfaces.containsKey(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); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, PiePlot4VanChart.VAN_CHART_PIE_PLOT, new PieIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_COLUMN_PLOT_ID, new ColumnIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartColumnPlot.VAN_CHART_BAR_PLOT_ID, new BarIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartLinePlot.VAN_CHART_LINE_PLOT, new LineIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartAreaPlot.VAN_CHART_AREA_PLOT_ID, new AreaIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGaugePlot.VAN_CHART_GAUGE_PLOT, new GaugeIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartRadarPlot.VAN_CHART_RADAR_PLOT, new RadarIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartScatterPlot.VAN_CHART_SCATTER_PLOT_ID, new ScatterIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); |
|
|
|
|
addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new StructureIndependentVanChartInterface()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -219,54 +220,27 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
if (chartTypeInterfaces.containsKey(CHART_PRIORITY)) { |
|
|
|
|
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) { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
for (Map.Entry<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> entry : chartTypeInterfaces.entrySet()) { |
|
|
|
|
String priority = entry.getKey(); |
|
|
|
|
String imagePath = getIconPath(priority, plotID); |
|
|
|
|
if (StringUtils.isNotEmpty(imagePath)) { |
|
|
|
|
return imagePath; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.LINE_CHART, new LineIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.BAR_CHART, new BarIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.PIE_CHART, new PieIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); |
|
|
|
|
addChartTypeInterface(CHART_PRIORITY, ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); |
|
|
|
|
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()); |
|
|
|
|
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) { |
|
|
|
|
|
|
|
|
|
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) { |
|
|
|
|
private static void addChartTypeInterface(String priority, String plotID, IndependentChartUIProvider provider) { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
|
@ -281,9 +255,19 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
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里 |
|
|
|
@ -295,11 +279,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
List<Integer> priorityList = getPriorityInOrder(); |
|
|
|
|
for (Integer aPriorityList : priorityList) { |
|
|
|
|
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()) { |
|
|
|
|
Map.Entry chartUIEntry = (Map.Entry) chartUIIterator.next(); |
|
|
|
|
IndependentChartUIProvider provider = (IndependentChartUIProvider) chartUIEntry.getValue(); |
|
|
|
|
paneList.add(provider.getPlotTypePane()); |
|
|
|
|
Map.Entry<String, IndependentChartUIProvider> chartUIEntry = chartUIIterator.next(); |
|
|
|
|
IndependentChartUIProvider provider = chartUIEntry.getValue(); |
|
|
|
|
AbstractChartTypePane pane = provider.getPlotTypePane(); |
|
|
|
|
pane.setPlotID(chartUIEntry.getKey()); |
|
|
|
|
paneList.add(pane); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -397,22 +383,24 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
return index; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { |
|
|
|
|
public String getIconPath(String plotID) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
return getChartDataPane(priority, plotID, listener); |
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getIconPath(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
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) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
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); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getAttrPaneArray(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) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
return getTableDataSourcePane(priority, plot, parent); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return getTableDataSourcePane(CHART_PRIORITY, plot, parent); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getTableDataSourcePane(plot, parent); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private AbstractTableDataContentPane getTableDataSourcePane(String priority, Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getTableDataSourcePane(plot, parent); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
String plotID = plot.getPlotID(); |
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
return getReportDataSourcePane(priority, plot, parent); |
|
|
|
|
} |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getReportDataSourcePane(plot, parent); |
|
|
|
|
} |
|
|
|
|
return getReportDataSourcePane(CHART_PRIORITY, plot, parent); |
|
|
|
|
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean plotInChart(String plotID, String priority) { |
|
|
|
@ -485,47 +452,25 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
&& 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) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
return getPlotConditionPane(priority, plot); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return getPlotConditionPane(CHART_PRIORITY, plot); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getPlotConditionPane(plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ConditionAttributesPane getPlotConditionPane(String priority, Plot plot) { |
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotConditionPane(plot); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plot.getPlotID(), priority)) { |
|
|
|
|
return getPlotSeriesPane(priority, parent, plot); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return getPlotSeriesPane(CHART_PRIORITY, parent, plot); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getPlotSeriesPane(parent, plot); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private BasicBeanPane<Plot> getPlotSeriesPane(String priority, ChartStylePane parent, Plot plot) { |
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces.get(priority).get(plot.getPlotID()).getPlotSeriesPane(parent, plot); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
@ -536,22 +481,23 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
*/ |
|
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
|
|
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (chartTypeInterfaces.get(priority).containsKey(plotID)) { |
|
|
|
|
return isUseDefaultPane(priority, plotID); |
|
|
|
|
} |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.isUseDefaultPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean isUseDefaultPane(String priority, String plotID) { |
|
|
|
|
|
|
|
|
|
return !(chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) || chartTypeInterfaces.get(priority).get(plotID).isUseDefaultPane(); |
|
|
|
|
public boolean needChartChangePane(Chart chart) { |
|
|
|
|
if (chart != null && chart.getPlot() != null) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(chart.getPlot().getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.needChartChangePane(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@ -561,7 +507,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
String priority = injection.getAttribute("priority", CHART_PRIORITY); |
|
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
|
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) { |
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
return getChartEditPane(priority, plotID); |
|
|
|
|
} |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getChartEditPane(plotID); |
|
|
|
|
} |
|
|
|
|
return getChartEditPane(CHART_PRIORITY, plotID); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ChartEditPane getChartEditPane(String priority, String plotID) { |
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getChartEditPane(plotID); |
|
|
|
|
return new ChartEditPane(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
if (plotInChart(plotID, priority)) { |
|
|
|
|
return getChartConfigPane(priority, plotID); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return getChartConfigPane(CHART_PRIORITY, plotID); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getChartConfigPane(plotID); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private ChartsConfigPane getChartConfigPane(String priority, String plotID) { |
|
|
|
|
return chartTypeInterfaces.get(priority).get(plotID).getChartConfigPane(plotID); |
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |