Browse Source

插件顺序

master
xiaohu 8 years ago
parent
commit
b5b3bc4c4c
  1. 73
      designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

73
designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java

@ -1,23 +1,30 @@
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.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.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.IndependentChartUIProvider;
import com.fr.design.chart.gui.ChartWidgetOption;
import com.fr.design.chartinterface.*; import com.fr.design.chartinterface.*;
import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.condition.ConditionAttributesPane;
import com.fr.design.gui.core.WidgetOption;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.AbstractChartAttrPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.module.DesignModuleFactory;
import com.fr.file.XMLFileManager; import com.fr.file.XMLFileManager;
import com.fr.form.ui.ChartEditor;
import com.fr.general.FRLogger; import com.fr.general.FRLogger;
import com.fr.general.GeneralContext; import com.fr.general.GeneralContext;
import com.fr.general.IOUtils;
import com.fr.general.Inter;
import com.fr.plugin.PluginCollector; import com.fr.plugin.PluginCollector;
import com.fr.plugin.PluginLicenseManager; import com.fr.plugin.PluginLicenseManager;
import com.fr.plugin.PluginMessage; import com.fr.plugin.PluginMessage;
@ -30,6 +37,7 @@ import com.fr.stable.plugin.PluginSimplify;
import com.fr.stable.xml.XMLPrintWriter; import com.fr.stable.xml.XMLPrintWriter;
import com.fr.stable.xml.XMLableReader; import com.fr.stable.xml.XMLableReader;
import javax.swing.*;
import java.util.Iterator; import java.util.Iterator;
import java.util.LinkedHashMap; import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
@ -72,46 +80,59 @@ public class ChartTypeInterfaceManager extends XMLFileManager implements ExtraCh
public void success() { public void success() {
if (chartTypeInterfaces != null) { if (chartTypeInterfaces != null) {
readDefault(); readDefault();
//重新注册designModuleFactory
DesignModuleFactory.registerExtraWidgetOptions(initWidgetOption());
} }
} }
}); });
} }
public static WidgetOption[] initWidgetOption(){
ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames();
ChartWidgetOption[] child = new ChartWidgetOption[typeName.length];
for (int i = 0; i < typeName.length; i++) {
String plotID = typeName[i].getPlotID();
Chart[] rowChart = ChartTypeManager.getInstance().getChartTypes(plotID);
if(rowChart == null) {
continue;
}
String iconPath = ChartTypeInterfaceManager.getInstance().getIconPath(plotID);
Icon icon = IOUtils.readIcon(iconPath);
child[i] = new ChartWidgetOption(Inter.getLocText(typeName[i].getName()), icon, ChartEditor.class, rowChart[0]);
}
return child;
}
private synchronized static void envChanged() { private synchronized static void envChanged() {
classManager = null; classManager = null;
} }
private static void readDefault() { private static void readDefault() {
chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface());
if (!isReadDefault) { chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.COLUMN_CHART, new ColumnIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.LINE_CHART, new LineIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BAR_CHART, new BarIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.PIE_CHART, new PieIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.AREA_CHART, new AreaIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.SCATTER_CHART, new XYScatterIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.BUBBLE_CHART, new BubbleIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RADAR_CHART, new RadarIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.STOCK_CHART, new StockIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.METER_CHART, new MeterIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.RANGE_CHART, new RangeIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.CUSTOM_CHART, new CustomIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GANTT_CHART, new GanttIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.DONUT_CHART, new DonutIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.MAP_CHART, new MapIndependentChartInterface()); chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.GIS_CHAER, new GisMapIndependentChartInterface());
chartTypeInterfaces.put(ChartConstants.FUNNEL_CHART, new FunnelIndependentChartInterface());
isReadDefault = true;
}
} }
public String getIconPath(String plotID) { public String getIconPath(String plotID) {
if (!isReadDefault){ if (chartTypeInterfaces.get(plotID) != null) {
readDefault(); return chartTypeInterfaces.get(plotID).getIconPath();
}else {
return StringUtils.EMPTY;
} }
return chartTypeInterfaces.get(plotID).getIconPath();
} }
/** /**

Loading…
Cancel
Save