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

Loading…
Cancel
Save