Browse Source

CHART-14346

feature/big-screen
白岳 5 years ago
parent
commit
40fb79cbf4
  1. 51
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java

51
designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java

@ -23,7 +23,7 @@ import java.util.Map;
*/
public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTabPane<VanChartCustomPlot, ChartCollection> {
private boolean supportCellData = true;
private boolean supportCellData;
public VanChartCustomPlotDataContentsTabPane(VanChartCustomPlot plot, VanChartCustomDataPane parent, AttributeChangeListener listener) {
super(plot, parent, listener);
@ -34,9 +34,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
}
public void setSupportCellData(boolean supportCellData) {
for (JPanel jPanel : paneList) {
((VanChartDataPane) jPanel).setSupportCellData(supportCellData);
}
this.supportCellData = supportCellData;
}
@Override
@ -73,6 +71,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
for (int i = 0; i < customPlotList.size(); i++) {
//根据不同的plot创建不同的数据配置界面
ChartDataPane contentPane = new VanChartDataPane(listener);
contentPane.setSupportCellData(supportCellData);
paneList.add(contentPane);
}
@ -84,38 +83,34 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot();
if (paneList == null) {
paneList = initPaneList();
}
if (paneList != null) {
try {
paneList = initPaneList();
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
relayoutWhenListChange();
try {
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) {
//將plot包裝起来,主要是为了获取dataDefinition
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
//设置collection的plot
cloneCollection.getSelectedChart().setPlot(customPlotList.get(i));
for (int i = 0; i < paneList.size() && i < customPlotList.size(); i++) {
//將plot包裝起来,主要是为了获取dataDefinition
ChartCollection cloneCollection = (ChartCollection) chartCollection.clone();
//获取definitionMap中的dataDefinition
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
TopDefinitionProvider dataDefinition = null;
if (definition != null && definition instanceof CustomDefinition) {
Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap();
dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i)));
}
cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition);
//设置collection的plot
cloneCollection.getSelectedChart().setPlot(customPlotList.get(i));
((ChartDataPane) paneList.get(i)).populate(cloneCollection);
//获取definitionMap中的dataDefinition
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
TopDefinitionProvider dataDefinition = null;
if (definition != null && definition instanceof CustomDefinition) {
Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap();
dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i)));
}
} catch (Exception e) {
return;
cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition);
((ChartDataPane) paneList.get(i)).populate(cloneCollection);
}
} catch (Exception e) {
return;
}
}

Loading…
Cancel
Save