Browse Source

CHART-10233 对新接口做了适配和兼容

research/11.0
白岳 5 years ago
parent
commit
6c6b165226
  1. 22
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  2. 4
      designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java
  3. 2
      designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

22
designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java

@ -555,11 +555,14 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
@Override @Override
public void mount(PluginSingleInjection injection) { public void mount(PluginSingleInjection injection) {
if (isIndependentChartUIProvider(injection)) { if (isChartTypeUIProvider(injection)) {
String id = injection.getAttribute("chartID");
if (StringUtils.isEmpty(id)) {
id = injection.getAttribute("plotID");
}
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY); String priority = injection.getAttribute("priority", DEFAULT_PRIORITY);
String plotID = injection.getAttribute("plotID");
ChartTypeUIProvider instance = (ChartTypeUIProvider) injection.getObject(); ChartTypeUIProvider instance = (ChartTypeUIProvider) injection.getObject();
addChartTypeInterface(priority, plotID, instance); addChartTypeInterface(priority, id, instance);
} }
} }
@ -567,10 +570,13 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
@Override @Override
public void demount(PluginSingleInjection injection) { public void demount(PluginSingleInjection injection) {
if (isIndependentChartUIProvider(injection)) { if (isChartTypeUIProvider(injection)) {
String priority = injection.getAttribute("priority", DEFAULT_PRIORITY); String priority = injection.getAttribute("priority", DEFAULT_PRIORITY);
String plotID = injection.getAttribute("plotID"); String id = injection.getAttribute("chartID");
removeChartTypeInterface(priority, plotID); if (StringUtils.isEmpty(id)) {
id = injection.getAttribute("plotID");
}
removeChartTypeInterface(priority, id);
} }
} }
@ -585,9 +591,9 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr
} }
private boolean isIndependentChartUIProvider(PluginSingleInjection injection) { private boolean isChartTypeUIProvider(PluginSingleInjection injection) {
return !(injection == null || injection.getObject() == null) && ChartTypeUIProvider.XML_TAG.equals(injection.getName()) && injection.getObject() instanceof ChartTypeUIProvider; return !(injection == null || injection.getObject() == null) && (ChartTypeUIProvider.XML_TAG.equals(injection.getName()) || ChartTypeUIProvider.OLD_TAG.equals(injection.getName())) && injection.getObject() instanceof ChartTypeUIProvider;
} }

4
designer-chart/src/main/java/com/fr/design/chart/fun/ChartTypeUIProvider.java

@ -23,7 +23,9 @@ import com.fr.stable.fun.Level;
*/ */
public interface ChartTypeUIProvider extends Level { public interface ChartTypeUIProvider extends Level {
String XML_TAG = SpecialLevel.IndependentChartUIProvider.getTagName(); String XML_TAG = "ChartTypeUIProvider";
String OLD_TAG = SpecialLevel.IndependentChartUIProvider.getTagName();
int CURRENT_API_LEVEL = 3; int CURRENT_API_LEVEL = 3;

2
designer-chart/src/main/java/com/fr/design/chart/fun/impl/AbstractChartTypeUI.java

@ -16,10 +16,12 @@ 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.stable.fun.impl.AbstractProvider; import com.fr.stable.fun.impl.AbstractProvider;
import com.fr.stable.fun.mark.API;
/** /**
* Created by shine on 2019/09/03. * Created by shine on 2019/09/03.
*/ */
@API(level = ChartTypeUIProvider.CURRENT_API_LEVEL)
public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider { public abstract class AbstractChartTypeUI extends AbstractProvider implements ChartTypeUIProvider {
@Override @Override

Loading…
Cancel
Save