|
|
@ -1,13 +1,15 @@ |
|
|
|
package com.fr.design; |
|
|
|
package com.fr.design; |
|
|
|
|
|
|
|
|
|
|
|
import com.fr.chart.base.ChartConstants; |
|
|
|
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.chartattr.Plot; |
|
|
|
import com.fr.chart.charttypes.ChartTypeManager; |
|
|
|
import com.fr.chart.charttypes.ChartTypeManager; |
|
|
|
|
|
|
|
import com.fr.chart.fun.ChartTypeProvider; |
|
|
|
import com.fr.chartx.attr.ChartProvider; |
|
|
|
import com.fr.chartx.attr.ChartProvider; |
|
|
|
|
|
|
|
import com.fr.common.annotations.Compatible; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.BasicBeanPane; |
|
|
|
import com.fr.design.beans.FurtherBasicBeanPane; |
|
|
|
import com.fr.design.beans.FurtherBasicBeanPane; |
|
|
|
import com.fr.design.chart.fun.IndependentChartUIProvider; |
|
|
|
import com.fr.design.chart.fun.ChartTypeUIProvider; |
|
|
|
import com.fr.design.chart.gui.ChartWidgetOption; |
|
|
|
import com.fr.design.chart.gui.ChartWidgetOption; |
|
|
|
import com.fr.design.chartinterface.AreaIndependentChartInterface; |
|
|
|
import com.fr.design.chartinterface.AreaIndependentChartInterface; |
|
|
|
import com.fr.design.chartinterface.BarIndependentChartInterface; |
|
|
|
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.data.table.AbstractTableDataContentPane; |
|
|
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
|
|
|
import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
import com.fr.design.module.DesignModuleFactory; |
|
|
|
|
|
|
|
import com.fr.extended.chart.AbstractChart; |
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
import com.fr.form.ui.ChartEditor; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.GeneralContext; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
import com.fr.general.IOUtils; |
|
|
|
|
|
|
|
import com.fr.invoke.Reflect; |
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
import com.fr.locale.InterProviderFactory; |
|
|
|
|
|
|
|
import com.fr.log.FineLoggerFactory; |
|
|
|
import com.fr.plugin.chart.PiePlot4VanChart; |
|
|
|
import com.fr.plugin.chart.PiePlot4VanChart; |
|
|
|
import com.fr.plugin.chart.area.VanChartAreaPlot; |
|
|
|
import com.fr.plugin.chart.area.VanChartAreaPlot; |
|
|
|
import com.fr.plugin.chart.bubble.VanChartBubblePlot; |
|
|
|
import com.fr.plugin.chart.bubble.VanChartBubblePlot; |
|
|
@ -112,8 +117,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
private static ChartTypeInterfaceManager classManager = new ChartTypeInterfaceManager(); |
|
|
|
private static ChartTypeInterfaceManager classManager = new ChartTypeInterfaceManager(); |
|
|
|
|
|
|
|
|
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
private static LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>> chartTypeInterfaces = |
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>>(); |
|
|
|
new LinkedHashMap<String, CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>>(); |
|
|
|
|
|
|
|
|
|
|
|
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>(); |
|
|
|
private static Map<String, String> idAndPriorityMap = new HashMap<String, String>(); |
|
|
|
|
|
|
|
|
|
|
@ -156,18 +161,18 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
public static WidgetOption[] initWidgetOption() { |
|
|
|
public static WidgetOption[] initWidgetOption() { |
|
|
|
|
|
|
|
|
|
|
|
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); |
|
|
|
String[] chartIDs = ChartTypeManager.getInstance().getAllChartIDs(); |
|
|
|
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; |
|
|
|
ChartWidgetOption[] child = new ChartWidgetOption[chartIDs.length]; |
|
|
|
int index = 0; |
|
|
|
int index = 0; |
|
|
|
for (ChartInternationalNameContentBean bean : typeName) { |
|
|
|
for (String chartID : chartIDs) { |
|
|
|
String plotID = bean.getChartID(); |
|
|
|
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(chartID); |
|
|
|
ChartProvider[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID); |
|
|
|
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(chartID)) { |
|
|
|
if (ArrayUtils.isEmpty(rowChart) && !ChartTypeManager.innerChart(plotID)) { |
|
|
|
|
|
|
|
continue; |
|
|
|
continue; |
|
|
|
} |
|
|
|
} |
|
|
|
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID); |
|
|
|
String name = ChartTypeInterfaceManager.getInstance().getName(chartID); |
|
|
|
|
|
|
|
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(chartID); |
|
|
|
Icon icon = IOUtils.readIcon(iconPath); |
|
|
|
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++; |
|
|
|
index++; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -219,17 +224,17 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
addChartTypeInterface(DEPRECATED_CHART_PRIORITY, ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface()); |
|
|
|
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 != null) { |
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
|
if (!chartTypeInterfaces.containsKey(priority)) { |
|
|
|
//新建一个具体图表列表
|
|
|
|
//新建一个具体图表列表
|
|
|
|
CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap> chartUIList |
|
|
|
CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap> chartUIList |
|
|
|
= new CloseableContainedMap<String, IndependentChartUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
= new CloseableContainedMap<String, ChartTypeUIProvider, LinkedHashMap>(LinkedHashMap.class); |
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
chartTypeInterfaces.put(priority, chartUIList); |
|
|
|
chartTypeInterfaces.put(priority, chartUIList); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
if (!chartUIList.containsKey(plotID)) { |
|
|
|
if (!chartUIList.containsKey(plotID)) { |
|
|
|
chartUIList.put(plotID, provider); |
|
|
|
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)) { |
|
|
|
if (idAndPriorityMap.containsKey(plotID)) { |
|
|
|
String priority = idAndPriorityMap.get(plotID); |
|
|
|
String priority = idAndPriorityMap.get(plotID); |
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
@ -267,95 +272,201 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { |
|
|
|
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()) { |
|
|
|
while (iterator.hasNext()) { |
|
|
|
Map.Entry<String, IndependentChartUIProvider> entry = iterator.next(); |
|
|
|
try { |
|
|
|
String plotID = entry.getKey(); |
|
|
|
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)) { |
|
|
|
AbstractChartTypePane pane = entry.getValue().getPlotTypePane(); |
|
|
|
continue; |
|
|
|
if (AssistUtils.equals(pane.title4PopupWindow(), TYPE_PANE_DEFAULT_TITLE)) { |
|
|
|
} |
|
|
|
continue; |
|
|
|
pane.setPlotID(plotID); |
|
|
|
} |
|
|
|
paneList.add(pane); |
|
|
|
pane.reLayout(plotID); |
|
|
|
|
|
|
|
paneList.add(pane); |
|
|
|
if (allChartTypePane.get(priority) == null) { |
|
|
|
|
|
|
|
allChartTypePane.put(priority, new LinkedHashMap<String, FurtherBasicBeanPane<? extends ChartProvider>>()); |
|
|
|
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) { |
|
|
|
@Compatible |
|
|
|
String name = provider.getPlotTypeTitle4PopupWindow(); |
|
|
|
public String getTitle4PopupWindow(String plotID) { |
|
|
|
if (StringUtils.isEmpty(name)) { |
|
|
|
return getName(plotID); |
|
|
|
name = ChartTypeManager.getInstance().getChartName(plotID); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return name; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getTitle4PopupWindow(String plotID) { |
|
|
|
private List<Integer> getPriorityInOrder() { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
|
|
|
|
if (provider != null) { |
|
|
|
List<Integer> priorityList = new ArrayList<Integer>(); |
|
|
|
return provider.getPlotTypeTitle4PopupWindow(); |
|
|
|
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 getIconPath(String plotID) { |
|
|
|
* 获取指定图表的标题 |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public String getTitle4PopupWindow(String priority, String plotID) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority) && chartTypeInterfaces.get(priority).containsKey(plotID)) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
IndependentChartUIProvider provider = chartTypeInterfaces.get(priority).get(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
return getChartName(plotID, provider); |
|
|
|
if (provider != null) { |
|
|
|
|
|
|
|
return provider.getIconPath(); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return StringUtils.EMPTY; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public String[] getDemoImagePath(String chartID) { |
|
|
|
|
|
|
|
|
|
|
|
//兼容老的插件
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
String[] result = null; |
|
|
|
String defaultPriority = (String) entry.getKey(); |
|
|
|
try { |
|
|
|
if (chartTypeInterfaces.get(defaultPriority).containsKey(plotID)) { |
|
|
|
result = provider.getDemoImagePath(); |
|
|
|
return getChartName(plotID, chartTypeInterfaces.get(defaultPriority).get(plotID)); |
|
|
|
} 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) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
Iterator iterator = chartTypeInterfaces.entrySet().iterator(); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
while (iterator.hasNext()) { |
|
|
|
if (provider != null) { |
|
|
|
Map.Entry entry = (Map.Entry) iterator.next(); |
|
|
|
String[] subNames = null; |
|
|
|
String priority = (String) entry.getKey(); |
|
|
|
try { |
|
|
|
priorityList.add(Integer.valueOf(priority)); |
|
|
|
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) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
if (provider != null) { |
|
|
|
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; |
|
|
|
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) { |
|
|
|
public ChartDataPane getChartDataPane(String plotID, AttributeChangeListener listener) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getChartDataPane(listener); |
|
|
|
return provider.getChartDataPane(listener); |
|
|
|
} |
|
|
|
} |
|
|
@ -363,20 +474,8 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
return new ChartDataPane(listener); |
|
|
|
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) { |
|
|
|
public AbstractChartAttrPane[] getAttrPaneArray(String plotID, AttributeChangeListener listener) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getAttrPaneArray(listener); |
|
|
|
return provider.getAttrPaneArray(listener); |
|
|
|
} |
|
|
|
} |
|
|
@ -387,7 +486,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getTableDataSourcePane(plot, parent); |
|
|
|
return provider.getTableDataSourcePane(plot, parent); |
|
|
|
} |
|
|
|
} |
|
|
@ -397,7 +496,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { |
|
|
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getReportDataSourcePane(plot, parent); |
|
|
|
return provider.getReportDataSourcePane(plot, parent); |
|
|
|
} |
|
|
|
} |
|
|
@ -405,17 +504,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
return null; |
|
|
|
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) { |
|
|
|
public ConditionAttributesPane getPlotConditionPane(Plot plot) { |
|
|
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getPlotConditionPane(plot); |
|
|
|
return provider.getPlotConditionPane(plot); |
|
|
|
} |
|
|
|
} |
|
|
@ -425,7 +516,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
public BasicBeanPane<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) { |
|
|
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plot.getPlotID()); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getPlotSeriesPane(parent, plot); |
|
|
|
return provider.getPlotSeriesPane(parent, plot); |
|
|
|
} |
|
|
|
} |
|
|
@ -441,7 +532,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
public boolean isUseDefaultPane(String plotID) { |
|
|
|
|
|
|
|
|
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.isUseDefaultPane(); |
|
|
|
return provider.isUseDefaultPane(); |
|
|
|
} |
|
|
|
} |
|
|
@ -452,7 +543,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
public boolean needChartChangePane(ChartProvider chart) { |
|
|
|
public boolean needChartChangePane(ChartProvider chart) { |
|
|
|
if (chart != null) { |
|
|
|
if (chart != null) { |
|
|
|
String chartID = chart.getID(); |
|
|
|
String chartID = chart.getID(); |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(chartID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.needChartChangePane(); |
|
|
|
return provider.needChartChangePane(); |
|
|
|
} |
|
|
|
} |
|
|
@ -467,7 +558,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
if (isIndependentChartUIProvider(injection)) { |
|
|
|
if (isIndependentChartUIProvider(injection)) { |
|
|
|
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY); |
|
|
|
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY); |
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
String plotID = injection.getAttribute("plotID"); |
|
|
|
IndependentChartUIProvider instance = (IndependentChartUIProvider) injection.getObject(); |
|
|
|
ChartTypeUIProvider instance = (ChartTypeUIProvider) injection.getObject(); |
|
|
|
addChartTypeInterface(priority, plotID, instance); |
|
|
|
addChartTypeInterface(priority, plotID, instance); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -487,7 +578,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
if (chartTypeInterfaces != null) { |
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
if (chartTypeInterfaces.containsKey(priority)) { |
|
|
|
Map<String, IndependentChartUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
Map<String, ChartTypeUIProvider> chartUIList = chartTypeInterfaces.get(priority); |
|
|
|
chartUIList.remove(plotID); |
|
|
|
chartUIList.remove(plotID); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -496,12 +587,12 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
|
|
|
|
|
|
|
|
private boolean isIndependentChartUIProvider(PluginSingleInjection injection) { |
|
|
|
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) { |
|
|
|
public ChartEditPane getChartEditPane(String plotID) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getChartEditPane(plotID); |
|
|
|
return provider.getChartEditPane(plotID); |
|
|
|
} |
|
|
|
} |
|
|
@ -509,7 +600,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
public ChartsConfigPane getChartConfigPane(String plotID) { |
|
|
|
IndependentChartUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
ChartTypeUIProvider provider = getChartTypeInterface(plotID); |
|
|
|
if (provider != null) { |
|
|
|
if (provider != null) { |
|
|
|
return provider.getChartConfigPane(plotID); |
|
|
|
return provider.getChartConfigPane(plotID); |
|
|
|
} |
|
|
|
} |
|
|
|