|
|
@ -166,6 +166,12 @@ public class PlotFactory { |
|
|
|
tooltipContentMap.put(VanChartStructurePlot.class, VanChartStructureTooltipContentPane.class); |
|
|
|
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 |
|
|
|
* 监控刷新 自动数据点提示Map |
|
|
@ -208,10 +214,15 @@ public class PlotFactory { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { |
|
|
|
public static VanChartPlotLabelPane createPlotLabelPane(Plot plot, VanChartStylePane stylePane, boolean inCondition) { |
|
|
|
if (plot instanceof VanChartGaugePlot) { |
|
|
|
Class<? extends Plot> key = plot.getClass(); |
|
|
|
return new VanChartGaugePlotLabelPane(plot, stylePane); |
|
|
|
if (labelMap.containsKey(key)) { |
|
|
|
} else if (plot instanceof PiePlot4VanChart) { |
|
|
|
try { |
|
|
|
return new VanChartPiePlotLabelPane(plot, stylePane, inCondition); |
|
|
|
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); |
|
|
|
return new VanChartPlotLabelPane(plot, stylePane, inCondition); |
|
|
|
} |
|
|
|
} |
|
|
|