Browse Source

CHART-19694 地图标签支持多系列

feature/10.0
白岳 3 years ago
parent
commit
0456e91914
  1. 45
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java

45
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelContentPane.java

@ -1,6 +1,9 @@
package com.fr.van.chart.map.designer.style.label;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.i18n.Toolkit;
import com.fr.design.layout.TableLayout;
import com.fr.design.ui.ModernUIPane;
import com.fr.plugin.chart.base.AttrTooltipContent;
import com.fr.plugin.chart.base.format.AttrTooltipAreaNameFormat;
@ -10,6 +13,7 @@ import com.fr.plugin.chart.base.format.AttrTooltipPercentFormat;
import com.fr.plugin.chart.base.format.AttrTooltipSeriesFormat;
import com.fr.plugin.chart.base.format.AttrTooltipValueFormat;
import com.fr.plugin.chart.type.TextAlign;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLabelContentPane;
import com.fr.van.chart.designer.component.format.MapAreaNameFormatPaneWithCheckBox;
import com.fr.van.chart.designer.component.format.PercentFormatPaneWithCheckBox;
@ -23,12 +27,17 @@ import com.fr.van.chart.designer.style.VanChartStylePane;
import com.fr.van.chart.map.designer.style.VanChartMapRichTextFieldListPane;
import javax.swing.JPanel;
import java.awt.BorderLayout;
import java.awt.Component;
/**
* Created by Mitisky on 16/5/20.
*/
public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
private UICheckBox showAllSeries;
private JPanel checkPane;
public VanChartMapLabelContentPane(VanChartStylePane parent, JPanel showOnPane, boolean inCondition) {
super(parent, showOnPane, inCondition);
}
@ -55,6 +64,31 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
};
}
protected JPanel getLabelContentPane(JPanel contentPane) {
showAllSeries = new UICheckBox(Toolkit.i18nText("Fine-Design_Chart_Show_All_Series"));
double f = TableLayout.FILL;
double e = TableLayout4VanChartHelper.EDIT_AREA_WIDTH;
double[] columnSize = {f, e};
double p = TableLayout.PREFERRED;
double[] row = {p, p};
Component[][] components = {
new Component[]{null, null},
new Component[]{new UILabel(Toolkit.i18nText("Fine-Design_Chart_Display_Strategy")), showAllSeries}
};
checkPane = TableLayout4VanChartHelper.createGapTableLayoutPane(components, row, columnSize);
JPanel panel = new JPanel(new BorderLayout());
panel.add(contentPane, BorderLayout.CENTER);
panel.add(checkPane, BorderLayout.SOUTH);
return createTableLayoutPaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Content"), panel);
}
protected void checkCardPane() {
super.checkCardPane();
checkPane.setVisible(getContent().getSelectedIndex() == COMMON_INDEX);
}
protected String[] getRichTextFieldNames() {
return new String[]{
Toolkit.i18nText("Fine-Design_Chart_Area_Name"),
@ -82,4 +116,15 @@ public class VanChartMapLabelContentPane extends VanChartLabelContentPane {
content.setRichTextValueFormat(new AttrTooltipMapValueFormat());
return content;
}
public AttrTooltipContent updateBean() {
AttrTooltipContent attrTooltipContent = super.updateBean();
attrTooltipContent.setShowAllSeries(showAllSeries.isSelected());
return attrTooltipContent;
}
public void populateBean(AttrTooltipContent attrTooltipContent) {
super.populateBean(attrTooltipContent);
showAllSeries.setSelected(attrTooltipContent.isShowAllSeries());
}
}

Loading…
Cancel
Save