Browse Source

CHART-18070 富文本新增字段支持组合图

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
1803689c0b
  1. 2
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java
  2. 4
      designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java
  3. 21
      designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java
  4. 15
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java
  5. 15
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java
  6. 11
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java
  7. 35
      designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java
  8. 2
      designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java
  9. 3
      designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java

2
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartOtherPane.java

@ -111,7 +111,7 @@ public class ChartOtherPane extends AbstractChartAttrPane {
public void populateBean(Chart chart) { public void populateBean(Chart chart) {
interactivePane.populateBean(chart); interactivePane.populateBean(chart);
if (ChartOtherPane.this.isHaveCondition()) { if (ChartOtherPane.this.isHaveCondition()) {
VanChartRichEditorPane.refreshFieldNames(chart); VanChartRichEditorPane.refreshCommonChartFieldNames(chart);
conditionAttrPane.populateBean(chart); conditionAttrPane.populateBean(chart);
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomConditionAttrPane.java

@ -39,7 +39,9 @@ public class VanChartCustomConditionAttrPane extends BasicScrollPane<Chart> {
layoutContentPane(); layoutContentPane();
} }
if(conditionAttrPane != null) { if(conditionAttrPane != null) {
conditionAttrPane.populateBean((VanChartCustomPlot)chart.getPlot()); conditionAttrPane.setChart(chart);
conditionAttrPane.populateBean(chart.getPlot());
conditionAttrPane.tabChanged();
} }
} }

21
designer-chart/src/main/java/com/fr/van/chart/custom/other/VanChartCustomPlotConditionAttrTabPane.java

@ -1,11 +1,13 @@
package com.fr.van.chart.custom.other; package com.fr.van.chart.custom.other;
import com.fr.chart.chartattr.Chart;
import com.fr.design.dialog.BasicPane; import com.fr.design.dialog.BasicPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType; import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.van.chart.custom.component.VanChartCustomPlotTabPane; import com.fr.van.chart.custom.component.VanChartCustomPlotTabPane;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane;
import com.fr.van.chart.designer.other.VanChartConditionAttrPane; import com.fr.van.chart.designer.other.VanChartConditionAttrPane;
import javax.swing.JPanel; import javax.swing.JPanel;
@ -16,10 +18,17 @@ import java.util.List;
* Created by Fangjie on 2016/4/28. * Created by Fangjie on 2016/4/28.
*/ */
public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTabPane<VanChartCustomPlot, VanChartCustomPlot> { public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTabPane<VanChartCustomPlot, VanChartCustomPlot> {
private Chart chart;
public VanChartCustomPlotConditionAttrTabPane(VanChartCustomPlot plot, BasicPane parent) { public VanChartCustomPlotConditionAttrTabPane(VanChartCustomPlot plot, BasicPane parent) {
super(plot, parent); super(plot, parent);
} }
public void setChart(Chart chart) {
this.chart = chart;
}
@Override @Override
protected void initTabTitle() { protected void initTabTitle() {
List<VanChartPlot> customPlotList = plot.getCustomPlotList(); List<VanChartPlot> customPlotList = plot.getCustomPlotList();
@ -73,6 +82,18 @@ public class VanChartCustomPlotConditionAttrTabPane extends VanChartCustomPlotTa
} }
} }
protected void tabChanged() {
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
int index = getSelectedIndex();
if (customPlotList.size() > index && paneList.size() > index) {
VanChartPlot chartPlot = customPlotList.get(index);
CustomPlotType plotType = CustomPlotFactory.getCustomType(chartPlot);
VanChartRichEditorPane.refreshCustomChartTableFieldNames(chart, plotType);
}
}
@Override @Override
public VanChartCustomPlot updateBean() { public VanChartCustomPlot updateBean() {
return null; return null;

15
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotLabelTabPane.java

@ -68,6 +68,21 @@ public class VanChartCustomPlotLabelTabPane extends VanChartCustomPlotTabPane<Va
} }
} }
protected void tabChanged() {
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
int index = getSelectedIndex();
if (customPlotList.size() > index && paneList.size() > index) {
VanChartPlot chartPlot = customPlotList.get(index);
VanChartPlotLabelPane labelPane = (VanChartPlotLabelPane)paneList.get(index);
VanChartCustomStylePane stylePane = (VanChartCustomStylePane)labelPane.getParentPane();
if (stylePane != null) {
stylePane.refreshTableFieldNames(chartPlot);
}
}
}
@Override @Override
public VanChartCustomPlot updateBean() { public VanChartCustomPlot updateBean() {
return null; return null;

15
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomPlotTooltipTabPane.java

@ -67,6 +67,21 @@ public class VanChartCustomPlotTooltipTabPane extends VanChartCustomPlotTabPane<
} }
} }
protected void tabChanged() {
List<VanChartPlot> customPlotList = plot.getCustomPlotList();
int index = getSelectedIndex();
if (customPlotList.size() > index && paneList.size() > index) {
VanChartPlot chartPlot = customPlotList.get(index);
VanChartPlotTooltipPane tooltipPane = (VanChartPlotTooltipPane)paneList.get(index);
VanChartCustomStylePane stylePane = (VanChartCustomStylePane)tooltipPane.getParentPane();
if (stylePane != null) {
stylePane.refreshTableFieldNames(chartPlot);
}
}
}
@Override @Override
public VanChartCustomPlot updateBean() { public VanChartCustomPlot updateBean() {
return null; return null;

11
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomStylePane.java

@ -5,8 +5,11 @@ import com.fr.design.dialog.BasicPane;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane; import com.fr.design.mainframe.chart.gui.style.series.ChartSeriesPane;
import com.fr.plugin.chart.attr.plot.VanChartAxisPlot; import com.fr.plugin.chart.attr.plot.VanChartAxisPlot;
import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.custom.CustomPlotFactory; import com.fr.plugin.chart.custom.CustomPlotFactory;
import com.fr.plugin.chart.custom.VanChartCustomPlot; import com.fr.plugin.chart.custom.VanChartCustomPlot;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.van.chart.designer.component.richText.VanChartRichEditorPane;
import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.designer.style.VanChartStylePane;
import java.util.List; import java.util.List;
@ -68,4 +71,12 @@ public class VanChartCustomStylePane extends VanChartStylePane {
CustomPlotFactory.dataSheetSynchronization((VanChartCustomPlot) collection.getSelectedChart().getPlot()); CustomPlotFactory.dataSheetSynchronization((VanChartCustomPlot) collection.getSelectedChart().getPlot());
} }
public void refreshTableFieldNames(VanChartPlot plot) {
CustomPlotType plotType = CustomPlotFactory.getCustomType(plot);
VanChartRichEditorPane.refreshCustomChartTableFieldNames(getChart(), plotType);
}
public void refreshTableFieldNames() {
}
} }

35
designer-chart/src/main/java/com/fr/van/chart/designer/component/richText/VanChartRichEditorPane.java

@ -16,6 +16,8 @@ import com.fr.general.ComparatorUtils;
import com.fr.general.IOUtils; import com.fr.general.IOUtils;
import com.fr.log.FineLoggerFactory; import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.base.AttrTooltipRichText; import com.fr.plugin.chart.base.AttrTooltipRichText;
import com.fr.plugin.chart.custom.CustomDefinition;
import com.fr.plugin.chart.custom.type.CustomPlotType;
import com.fr.plugin.chart.type.TextAlign; import com.fr.plugin.chart.type.TextAlign;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import com.fr.van.chart.designer.PlotFactory; import com.fr.van.chart.designer.PlotFactory;
@ -48,21 +50,46 @@ public class VanChartRichEditorPane {
return fieldNames; return fieldNames;
} }
public static void refreshFieldNames(Chart chart) { // 更新普通图表中指定plot的数据集字段
VanChartRichEditorPane.fieldNames = null; public static void refreshCommonChartFieldNames(Chart chart) {
if (chart == null) { if (chart == null) {
return; return;
} }
Plot plot = chart.getPlot(); Plot plot = chart.getPlot();
if (plot == null || !PlotFactory.plotSupportAddTableField(plot)) { if (plot == null) {
return;
}
VanChartRichEditorPane.fieldNames = null;
if (!PlotFactory.plotSupportAddTableField(plot)) {
return; return;
} }
TopDefinitionProvider definition = chart.getFilterDefinition(); TopDefinitionProvider definition = chart.getFilterDefinition();
VanChartRichEditorPane.refreshFieldNames(definition);
}
// 更新组合图表中指定plot的数据集字段
public static void refreshCustomChartTableFieldNames(Chart chart, CustomPlotType plotType) {
if (chart == null || plotType == null) {
return;
}
VanChartRichEditorPane.fieldNames = null;
TopDefinitionProvider filterDefinition = chart.getFilterDefinition();
if (filterDefinition instanceof CustomDefinition) {
CustomDefinition customDefinition = (CustomDefinition) filterDefinition;
Map<CustomPlotType, TopDefinitionProvider> definitionProviderMap = customDefinition.getDefinitionProviderMap();
VanChartRichEditorPane.refreshFieldNames(definitionProviderMap.get(plotType));
}
}
// 更新富文本数据集字段
public static void refreshFieldNames(TopDefinitionProvider definition) {
if (definition == null) { if (definition == null) {
return; return;
} }

2
designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartStylePane.java

@ -78,6 +78,6 @@ public class VanChartStylePane extends ChartStylePane {
} }
public void refreshTableFieldNames() { public void refreshTableFieldNames() {
VanChartRichEditorPane.refreshFieldNames(getChart()); VanChartRichEditorPane.refreshCommonChartFieldNames(getChart());
} }
} }

3
designer-chart/src/main/java/com/fr/van/chart/designer/style/tooltip/VanChartPlotTooltipPane.java

@ -98,6 +98,9 @@ public class VanChartPlotTooltipPane extends BasicPane {
return components; return components;
} }
public VanChartStylePane getParentPane() {
return parent;
}
protected void initTooltipContentPane(Plot plot){ protected void initTooltipContentPane(Plot plot){
tooltipContentPane = PlotFactory.createPlotTooltipContentPane(plot, parent, VanChartPlotTooltipPane.this); tooltipContentPane = PlotFactory.createPlotTooltipContentPane(plot, parent, VanChartPlotTooltipPane.this);

Loading…
Cancel
Save