Browse Source

Pull request #3194: CHART-17661 多层饼图面板

Merge in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '2f68f0db7c323a482b3a79a56dcb4780fa4f5b5a':
  CHART-17661 多层饼图面板
feature/big-screen
Bjorn 4 years ago
parent
commit
ebf31c3cd6
  1. 19
      designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java
  2. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java

19
designer-chart/src/main/java/com/fr/van/chart/designer/PlotFactory.java

@ -166,6 +166,12 @@ public class PlotFactory {
tooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureTooltipContentPane.class);
}
private static Map<Class<? extends Plot>, Class<? extends VanChartPlotLabelPane>> labelMap = new HashMap<>();
static {
labelMap.put(PiePlot4VanChart.class, VanChartPiePlotLabelPane.class);
labelMap.put(VanChartGaugePlot.class, VanChartGaugePlotLabelPane.class);
}
/**
* 监控刷新 自动数据点提示Map
@ -208,10 +214,15 @@ public class PlotFactory {
}
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) {
if (plot instanceof VanChartGaugePlot) {
return new VanChartGaugePlotLabelPane(plot, stylePane);
} else if (plot instanceof PiePlot4VanChart) {
return new VanChartPiePlotLabelPane(plot, stylePane, inCondition);
Class<? extends Plot> key = plot.getClass();
if (labelMap.containsKey(key)) {
try {
Class<? extends VanChartPlotLabelPane> cl = labelMap.get(key);
Constructor<? extends VanChartPlotLabelPane> constructor = cl.getConstructor(Plot.class, VanChartStylePane.class, boolean.class);
return constructor.newInstance(plot, stylePane, inCondition);
} catch (Exception e) {
FineLoggerFactory.getLogger().error(e.getMessage(), e);
}
}
return new VanChartPlotLabelPane(plot, stylePane, inCondition);
}

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/label/VanChartGaugePlotLabelPane.java

@ -25,8 +25,8 @@ public class VanChartGaugePlotLabelPane extends VanChartPlotLabelPane {
private VanChartPlotLabelDetailPane gaugeValueLabelPane;
public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent) {
super(plot, parent);
public VanChartGaugePlotLabelPane(Plot plot, VanChartStylePane parent, boolean inCondition) {
super(plot, parent, inCondition);
}
protected void createLabelPane() {

Loading…
Cancel
Save