|
|
|
@ -1,13 +1,15 @@
|
|
|
|
|
package com.fr.design; |
|
|
|
|
|
|
|
|
|
import com.fr.chart.base.ChartConstants; |
|
|
|
|
import com.fr.chart.base.ChartInternationalNameContentBean; |
|
|
|
|
import com.fr.chart.chartattr.Chart; |
|
|
|
|
import com.fr.chart.chartattr.Plot; |
|
|
|
|
import com.fr.chart.charttypes.ChartTypeManager; |
|
|
|
|
import com.fr.chart.fun.ChartTypeProvider; |
|
|
|
|
import com.fr.chartx.attr.ChartProvider; |
|
|
|
|
import com.fr.common.annotations.Compatible; |
|
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
|
import com.fr.design.beans.FurtherBasicBeanPane; |
|
|
|
|
import com.fr.design.chart.fun.IndependentChartUIProvider; |
|
|
|
|
import com.fr.design.chart.fun.ChartTypeUIProvider; |
|
|
|
|
import com.fr.design.chart.gui.ChartWidgetOption; |
|
|
|
|
import com.fr.design.chartinterface.AreaIndependentChartInterface; |
|
|
|
|
import com.fr.design.chartinterface.BarIndependentChartInterface; |
|
|
|
@ -38,10 +40,13 @@ import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPa
|
|
|
|
|
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.extended.chart.AbstractChart; |
|
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
|
import com.fr.plugin.chart.PiePlot4VanChart; |
|
|
|
|
import com.fr.plugin.chart.area.VanChartAreaPlot; |
|
|
|
|
import com.fr.plugin.chart.bubble.VanChartBubblePlot; |
|
|
|
@ -112,8 +117,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
private static ChartTypeInterfaceManager classManager = new ChartTypeInterfaceManager(); |
|
|
|
|
|
|
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>(); |
|
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>>(); |
|
|
|
|
|
|
|
|
|
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>(); |
|
|
|
|
|
|
|
|
@ -156,18 +161,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
public static WidgetOption[] initWidgetOption() { |
|
|
|
|
|
|
|
|
|
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); |
|
|
|
|
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; |
|
|
|
|
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); |
|
|
|
|
ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; |
|
|
|
|
int index = 0; |
|
|
|
|
for (ChartInternationalNameContentBean bean : typeName) { |
|
|
|
|
String plotID = bean.getChartID(); |
|
|
|
|
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); |
|
|
|
|
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(plotID)) { |
|
|
|
|
for (String chartID : chartIDs) { |
|
|
|
|
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(chartID); |
|
|
|
|
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(chartID)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); |
|
|
|
|
String name = ChartTypeInterfaceManager.getInstance().getName(chartID); |
|
|
|
|
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID); |
|
|
|
|
Icon icon = IOUtils.readIcon(iconPath); |
|
|
|
|
child[index] = new ChartWidgetOption(InterProviderFactory.getProvider().getLocText(bean.getName()), icon, ChartEditor.class, plotID); |
|
|
|
|
child[index] = new ChartWidgetOption(name, icon, ChartEditor.class, chartID); |
|
|
|
|
index++; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -219,17 +224,17 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
addChartTypeInterface(DEPRECATED_CHART_PRIORITY, ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static void addChartTypeInterface(String priority, String plotID, IndependentChartUIProvider provider) { |
|
|
|
|
private static void addChartTypeInterface(String priority, String plotID, ChartTypeUIProvider provider) { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
|
|
//新建一个具体图表列表
|
|
|
|
|
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList |
|
|
|
|
= new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
|
CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap> chartUIList |
|
|
|
|
= new CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
|
chartTypeInterfaces.put(priority, chartUIList); |
|
|
|
|
} else { |
|
|
|
|
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
if (!chartUIList.containsKey(plotID)) { |
|
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
|
} |
|
|
|
@ -238,7 +243,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private IndependentChartUIProvider getChartTypeInterface(String plotID) { |
|
|
|
|
private ChartTypeUIProvider getChartTypeInterface(String plotID) { |
|
|
|
|
if (idAndPriorityMap.containsKey(plotID)) { |
|
|
|
|
String priority = idAndPriorityMap.get(plotID); |
|
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
@ -267,95 +272,201 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { |
|
|
|
|
|
|
|
|
|
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
|
|
|
|
|
Iterator<Map.Entry<String, IndependentChartUIProvider>> iterator = chartUIList.entrySet().iterator(); |
|
|
|
|
Iterator<Map.Entry<String, ChartTypeUIProvider>> iterator = chartUIList.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry<String, IndependentChartUIProvider> entry = iterator.next(); |
|
|
|
|
String plotID = entry.getKey(); |
|
|
|
|
|
|
|
|
|
AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); |
|
|
|
|
if (AssistUtils.equals(pane.title4PopupWindow(), TYPE_PANE_DEFAULT_TITLE)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
pane.setPlotID(plotID); |
|
|
|
|
paneList.add(pane); |
|
|
|
|
|
|
|
|
|
if (allChartTypePane.get(priority) == null) { |
|
|
|
|
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends ChartProvider>>()); |
|
|
|
|
try { |
|
|
|
|
Map.Entry<String, ChartTypeUIProvider> entry = iterator.next(); |
|
|
|
|
String plotID = entry.getKey(); |
|
|
|
|
|
|
|
|
|
AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); |
|
|
|
|
if (AssistUtils.equals(pane.title4PopupWindow(), TYPE_PANE_DEFAULT_TITLE)) { |
|
|
|
|
continue; |
|
|
|
|
} |
|
|
|
|
pane.reLayout(plotID); |
|
|
|
|
paneList.add(pane); |
|
|
|
|
|
|
|
|
|
if (allChartTypePane.get(priority) == null) { |
|
|
|
|
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends ChartProvider>>()); |
|
|
|
|
} |
|
|
|
|
allChartTypePane.get(priority).put(plotID, pane); |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
FineLoggerFactory.getLogger().error(e.getMessage(), e); |
|
|
|
|
} |
|
|
|
|
allChartTypePane.get(priority).put(plotID, pane); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private String getChartName(String plotID, IndependentChartUIProvider provider) { |
|
|
|
|
String name = provider.getPlotTypeTitle4PopupWindow(); |
|
|
|
|
if (StringUtils.isEmpty(name)) { |
|
|
|
|
name = ChartTypeManager.getInstance().getChartName(plotID); |
|
|
|
|
} |
|
|
|
|
return name; |
|
|
|
|
@Compatible |
|
|
|
|
public String getTitle4PopupWindow(String plotID) { |
|
|
|
|
return getName(plotID); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getTitle4PopupWindow(String plotID) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getPlotTypeTitle4PopupWindow(); |
|
|
|
|
private List<Integer> getPriorityInOrder() { |
|
|
|
|
|
|
|
|
|
List<Integer> priorityList = new ArrayList<Integer>(); |
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
priorityList.add(Integer.valueOf(priority)); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
return ChartTypeManager.orderInPriority(priorityList); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取指定图表的标题 |
|
|
|
|
*/ |
|
|
|
|
public String getTitle4PopupWindow(String priority, String plotID) { |
|
|
|
|
public String getIconPath(String plotID) { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) { |
|
|
|
|
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID); |
|
|
|
|
return getChartName(plotID, provider); |
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getIconPath(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String[] getDemoImagePath(String chartID) { |
|
|
|
|
|
|
|
|
|
//兼容老的插件
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String defaultPriority = (String) entry.getKey(); |
|
|
|
|
if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) { |
|
|
|
|
return getChartName(plotID, chartTypeInterfaces.get(defaultPriority).get(plotID)); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
String[] result = null; |
|
|
|
|
try { |
|
|
|
|
result = provider.getDemoImagePath(); |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
return ArrayUtils.isEmpty(result) ? getCompatibleDemoImagePath(chartID) : result; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
|
|
return new String[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private List<Integer> getPriorityInOrder() { |
|
|
|
|
private String[] getCompatibleDemoImagePath(String chartID) { |
|
|
|
|
String[] result = null; |
|
|
|
|
try { |
|
|
|
|
//AbstractIndependentChartsProvider
|
|
|
|
|
ChartTypeProvider chartTypeProvider = Reflect.on(ChartTypeManager.getInstanceWithCheck()).call("getChartType", chartID).get(); |
|
|
|
|
result = new String[]{ |
|
|
|
|
Reflect.on(chartTypeProvider).call("getChartImagePath").get() |
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
if (ArrayUtils.isNotEmpty(result)) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
List<Integer> priorityList = new ArrayList<Integer>(); |
|
|
|
|
try { |
|
|
|
|
//兼容 图表类型选择界面会调到这边
|
|
|
|
|
ChartProvider[] charts = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID); |
|
|
|
|
result = new String[charts.length]; |
|
|
|
|
for (int i = 0; i < charts.length; i++) { |
|
|
|
|
//Chart && AbstractChart
|
|
|
|
|
ChartProvider chart = charts[i]; |
|
|
|
|
if (!(chart instanceof AbstractChart)) {//扩展图表
|
|
|
|
|
chart = Reflect.on(chart).field("subChart").get(); |
|
|
|
|
} |
|
|
|
|
result[i] = Reflect.on(chart).call("demoImagePath").get(); |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return new String[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String[] getSubName(String chartID) { |
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
|
while (iterator.hasNext()) { |
|
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
|
priorityList.add(Integer.valueOf(priority)); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
String[] subNames = null; |
|
|
|
|
try { |
|
|
|
|
subNames = provider.getSubName(); |
|
|
|
|
} catch (Throwable throwable) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
return ArrayUtils.isEmpty(subNames) ? getCompatibleSubName(chartID, provider) : subNames; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ChartTypeManager.orderInPriority(priorityList); |
|
|
|
|
return new String[0]; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getIconPath(String plotID) { |
|
|
|
|
//兼容
|
|
|
|
|
private String[] getCompatibleSubName(String chartID, ChartTypeUIProvider provider) { |
|
|
|
|
ChartProvider[] chartProviders = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID); |
|
|
|
|
|
|
|
|
|
if (chartProviders.length == 1) { |
|
|
|
|
return new String[]{getName(chartID)}; |
|
|
|
|
} |
|
|
|
|
String[] result = new String[chartProviders.length]; |
|
|
|
|
for (int i = 0; i < chartProviders.length; i++) { |
|
|
|
|
if (chartProviders[i] instanceof Chart) { |
|
|
|
|
//Chart && AbstractChart
|
|
|
|
|
result[i] = ((Chart) chartProviders[i]).getChartName(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public String getName(String chartID) { |
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getIconPath(); |
|
|
|
|
String name = null; |
|
|
|
|
try { |
|
|
|
|
name = provider.getName(); |
|
|
|
|
} catch (Throwable throwable) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return StringUtils.isEmpty(name) ? getCompatibleName(chartID, provider) : name; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
//兼容
|
|
|
|
|
private static String getCompatibleName(String chartID, ChartTypeUIProvider provider) { |
|
|
|
|
|
|
|
|
|
String result = null; |
|
|
|
|
try { |
|
|
|
|
//AbstractIndependentChartsProvider
|
|
|
|
|
ChartTypeProvider chartTypeProvider = Reflect.on(ChartTypeManager.getInstanceWithCheck()).call("getChartType", chartID).get(); |
|
|
|
|
result = Reflect.on(chartTypeProvider).call("getChartName").get();//国际化的key
|
|
|
|
|
result = InterProviderFactory.getProvider().getLocText(result); |
|
|
|
|
if (StringUtils.isNotEmpty(result)) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
ChartProvider chartProvider = ChartTypeManager.getInstanceWithCheck().getChartTypes(chartID)[0]; |
|
|
|
|
if (chartProvider instanceof Chart) { |
|
|
|
|
//AbstractExtendedChartUIProvider
|
|
|
|
|
result = ((Chart) chartProvider).getChartName(); |
|
|
|
|
} |
|
|
|
|
if (StringUtils.isNotEmpty(result) && !"Charts".equals(result)) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} catch (Exception e) { |
|
|
|
|
//do nothing
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
return provider.getPlotTypePane().title4PopupWindow(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getChartDataPane(listener); |
|
|
|
|
} |
|
|
|
@ -363,20 +474,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
return new ChartDataPane(listener); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 获取对应ID的图表数量 |
|
|
|
|
* |
|
|
|
|
*/ |
|
|
|
|
private int getChartSize(String key) { |
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(key)) { |
|
|
|
|
return chartTypeInterfaces.get(key).size(); |
|
|
|
|
} |
|
|
|
|
return 0; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getAttrPaneArray(listener); |
|
|
|
|
} |
|
|
|
@ -387,7 +486,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getTableDataSourcePane(plot, parent); |
|
|
|
|
} |
|
|
|
@ -397,7 +496,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getReportDataSourcePane(plot, parent); |
|
|
|
|
} |
|
|
|
@ -405,17 +504,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
return null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private boolean plotInChart(String plotID, String priority) { |
|
|
|
|
|
|
|
|
|
return chartTypeInterfaces != null |
|
|
|
|
&& chartTypeInterfaces.containsKey(priority) |
|
|
|
|
&& chartTypeInterfaces.get(priority).containsKey(plotID); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ConditionAttributesPane getPlotConditionPane(Plot plot) { |
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getPlotConditionPane(plot); |
|
|
|
|
} |
|
|
|
@ -425,7 +516,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getPlotSeriesPane(parent, plot); |
|
|
|
|
} |
|
|
|
@ -441,7 +532,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
*/ |
|
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.isUseDefaultPane(); |
|
|
|
|
} |
|
|
|
@ -452,7 +543,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
public boolean needChartChangePane(ChartProvider chart) { |
|
|
|
|
if (chart != null) { |
|
|
|
|
String chartID = chart.getID(); |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.needChartChangePane(); |
|
|
|
|
} |
|
|
|
@ -467,7 +558,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
if (isIndependentChartUIProvider(injection)) { |
|
|
|
|
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY); |
|
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
|
IndependentChartUIProvider instance = (IndependentChartUIProvider) injection.getObject(); |
|
|
|
|
ChartTypeUIProvider instance = (ChartTypeUIProvider) injection.getObject(); |
|
|
|
|
addChartTypeInterface(priority, plotID, instance); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -487,7 +578,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
|
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
|
chartUIList.remove(plotID); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -496,12 +587,12 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
|
|
|
|
|
private boolean isIndependentChartUIProvider(PluginSingleInjection injection) { |
|
|
|
|
|
|
|
|
|
return !(injection == null || injection.getObject() == null) && IndependentChartUIProvider.XML_TAG.equals(injection.getName()) && injection.getObject() instanceof IndependentChartUIProvider; |
|
|
|
|
return !(injection == null || injection.getObject() == null) && ChartTypeUIProvider.XML_TAG.equals(injection.getName()) && injection.getObject() instanceof ChartTypeUIProvider; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public ChartEditPane getChartEditPane(String plotID) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getChartEditPane(plotID); |
|
|
|
|
} |
|
|
|
@ -509,7 +600,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
if (provider != null) { |
|
|
|
|
return provider.getChartConfigPane(plotID); |
|
|
|
|
} |
|
|
|
|