Browse Source

CHART-14346 悬浮窗图表组合图不允许选择单元格数据源

feature/big-screen
白岳 4 years ago
parent
commit
b44b3b3585
  1. 32
      designer-chart/src/main/java/com/fr/van/chart/custom/VanChartCustomPlotDataContentsTabPane.java

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

@ -34,13 +34,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
} }
public void setSupportCellData(boolean supportCellData) { public void setSupportCellData(boolean supportCellData) {
this.supportCellData = supportCellData; for (JPanel jPanel : paneList) {
((VanChartDataPane) jPanel).setSupportCellData(supportCellData);
}
} }
@Override @Override
protected void initTabTitle() { protected void initTabTitle() {
if (plot == null){ if (plot == null) {
return; return;
} }
@ -60,7 +62,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
@Override @Override
protected List<JPanel> initPaneList() { protected List<JPanel> initPaneList() {
if (plot == null){ if (plot == null) {
return null; return null;
} }
@ -68,10 +70,9 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
List<VanChartPlot> customPlotList = plot.getCustomPlotList(); List<VanChartPlot> customPlotList = plot.getCustomPlotList();
for (int i = 0; i < customPlotList.size(); i++){ for (int i = 0; i < customPlotList.size(); i++) {
//根据不同的plot创建不同的数据配置界面 //根据不同的plot创建不同的数据配置界面
ChartDataPane contentPane = new VanChartDataPane(listener); ChartDataPane contentPane = new VanChartDataPane(listener);
contentPane.setSupportCellData(supportCellData);
paneList.add(contentPane); paneList.add(contentPane);
} }
@ -79,15 +80,15 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
} }
@Override @Override
public void populateBean(ChartCollection chartCollection){ public void populateBean(ChartCollection chartCollection) {
plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot(); plot = (VanChartCustomPlot) chartCollection.getSelectedChart().getPlot();
if (paneList == null){ if (paneList == null) {
paneList = initPaneList(); paneList = initPaneList();
} }
if (paneList != null){ if (paneList != null) {
try { try {
@ -105,14 +106,14 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider definition = chartCollection.getSelectedChart().getFilterDefinition();
TopDefinitionProvider dataDefinition = null; TopDefinitionProvider dataDefinition = null;
if (definition != null && definition instanceof CustomDefinition) { if (definition != null && definition instanceof CustomDefinition) {
Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = ((CustomDefinition)definition).getDefinitionProviderMap(); Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = ((CustomDefinition) definition).getDefinitionProviderMap();
dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i))); dataDefinition = definitionProviderMap.get(CustomPlotFactory.getCustomType(customPlotList.get(i)));
} }
cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition); cloneCollection.getSelectedChart().setFilterDefinition(dataDefinition);
((ChartDataPane) paneList.get(i)).populate(cloneCollection); ((ChartDataPane) paneList.get(i)).populate(cloneCollection);
} }
}catch (Exception e){ } catch (Exception e) {
return; return;
} }
} }
@ -124,8 +125,8 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
} }
@Override @Override
public void updateBean(ChartCollection collection){ public void updateBean(ChartCollection collection) {
if (paneList == null || plot == null){ if (paneList == null || plot == null) {
return; return;
} }
try { try {
@ -158,7 +159,7 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
customDefinition.setDefinitionProviderMap(definitionMap); customDefinition.setDefinitionProviderMap(definitionMap);
collection.getSelectedChart().setFilterDefinition(customDefinition); collection.getSelectedChart().setFilterDefinition(customDefinition);
}catch (Exception e){ } catch (Exception e) {
return; return;
} }
} }
@ -180,10 +181,11 @@ public class VanChartCustomPlotDataContentsTabPane extends VanChartCustomPlotTab
/** /**
* 返回绑定的属性事件. * 返回绑定的属性事件.
* @param listener 增加监听 *
* @param listener 增加监听
*/ */
public void addAttributeChangeListener(AttributeChangeListener listener) { public void addAttributeChangeListener(AttributeChangeListener listener) {
for (int i = 0; i < paneList.size(); i++){ for (int i = 0; i < paneList.size(); i++) {
((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener); ((ChartDataPane) paneList.get(i)).addAttributeChangeListener(listener);
} }
} }

Loading…
Cancel
Save