Browse Source

CHART-22531 多分类轴分层设置标签样式—设计器面板

feature/x
方磊 3 years ago
parent
commit
9105c2d33f
  1. 33
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java
  2. 34
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java
  3. 2
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisPane.java
  4. 10
      designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisTabPane.java
  5. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateReportDataContentPane.java
  6. 7
      designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java
  7. 4
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java
  8. 68
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java
  9. 12
      designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java

33
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/report/CategoryPlotMoreCateReportDataContentPane.java

@ -26,7 +26,8 @@ import java.awt.Dimension;
import java.awt.FlowLayout; import java.awt.FlowLayout;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.LinkedHashMap; import java.util.ArrayList;
import java.util.List;
import java.util.Map; import java.util.Map;
@ -41,10 +42,10 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
private JPanel boxPane; private JPanel boxPane;
private UIButton addButton; private UIButton addButton;
private Map<String, TinyFormulaPane> formualList = new LinkedHashMap<>(); private List<TinyFormulaPane> formualList = new ArrayList<TinyFormulaPane>();
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public Map<String, TinyFormulaPane> getFormualList() { public List<TinyFormulaPane> getFormualList() {
return formualList; return formualList;
} }
@ -100,17 +101,12 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
} }
private TinyFormulaPane addNewCatePane() { private TinyFormulaPane addNewCatePane() {
String uuid = UUIDUtil.generate();
return addNewCatePane(uuid);
}
private TinyFormulaPane addNewCatePane(String uuid) {
final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY); final TinyFormulaPane pane = initCategoryBox(StringUtils.EMPTY);
pane.setPreferredSize(new Dimension(100, 16)); pane.setPreferredSize(new Dimension(100, 16));
pane.registerChangeListener(uiobListener); pane.registerChangeListener(uiobListener);
formualList.put(uuid, pane); formualList.add(pane);
final JPanel newButtonPane = new JPanel(); final JPanel newButtonPane = new JPanel();
newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0)); newButtonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 0));
@ -125,7 +121,7 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(newButtonPane); boxPane.remove(newButtonPane);
formualList.remove(uuid); formualList.remove(pane);
checkComponent(); checkComponent();
relayoutPane(); relayoutPane();
} }
@ -177,11 +173,11 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider definition = collection.getSelectedChart().getFilterDefinition();
if (definition instanceof NormalReportDataDefinition) { if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition; NormalReportDataDefinition reportDefinition = (NormalReportDataDefinition) definition;
Map<String, Object> moreCateLabels = reportDefinition.getMoreCateLabels(); int size = reportDefinition.getMoreCateSize();
if (reportDefinition.getCategoryName() != null && !moreCateLabels.isEmpty()) { if (reportDefinition.getCategoryName() != null && size > 0) {
for (Map.Entry<String, Object> entry : moreCateLabels.entrySet()) { for(int i = 0; i < size; i++) {
TinyFormulaPane pane = addNewCatePane(entry.getKey()); TinyFormulaPane pane = addNewCatePane();
pane.populateBean(Utils.objectToString(entry.getValue())); pane.populateBean(Utils.objectToString(reportDefinition.getMoreCateWithIndex(i)));
} }
} }
} }
@ -204,10 +200,9 @@ public class CategoryPlotMoreCateReportDataContentPane extends CategoryPlotRepor
} }
protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) { protected void updateMoreCate(NormalReportDataDefinition reportDefinition, Plot plot) {
for (Map.Entry<String, TinyFormulaPane> entry : formualList.entrySet()) { for (int i = 0, size = formualList.size(); i < size; i++) {
String uuid = entry.getKey(); TinyFormulaPane pane = formualList.get(i);
TinyFormulaPane pane = entry.getValue(); reportDefinition.addMoreCate(canBeFormula(pane.updateBean()));
reportDefinition.addMoreCate(uuid, canBeFormula(pane.updateBean()));
} }
} }
} }

34
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/CategoryPlotMoreCateTableDataContentPane.java

@ -6,7 +6,6 @@ import com.fr.chart.chartattr.Bar2DPlot;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.decision.base.util.UUIDUtil;
import com.fr.design.event.UIObserver; import com.fr.design.event.UIObserver;
import com.fr.design.event.UIObserverListener; import com.fr.design.event.UIObserverListener;
import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.ibutton.UIButton;
@ -27,9 +26,8 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.LinkedHashMap; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 多分类轴 的数据集定义界面. * 多分类轴 的数据集定义界面.
@ -45,12 +43,12 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
private JPanel boxPane; private JPanel boxPane;
private Map<String, UIComboBox> boxList = new LinkedHashMap<>(); private List<UIComboBox> boxList = new ArrayList<UIComboBox>();
private UIButton addButton; private UIButton addButton;
private UIObserverListener uiobListener = null; private UIObserverListener uiobListener = null;
public Map<String, UIComboBox> getBoxList() { public List<UIComboBox> getBoxList() {
return boxList; return boxList;
} }
@ -114,11 +112,6 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
} }
private UIComboBox addNewCombox() { private UIComboBox addNewCombox() {
String uuid = UUIDUtil.generate();
return addNewCombox(uuid);
}
private UIComboBox addNewCombox(String uuid) {
final JPanel buttonPane = new JPanel(); final JPanel buttonPane = new JPanel();
buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2)); buttonPane.setLayout(new FlowLayout(FlowLayout.RIGHT, 0, 2));
@ -145,7 +138,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png")); UIButton delButton = new UIButton(BaseUtils.readIcon("com/fr/design/images/toolbarbtn/close.png"));
buttonPane.add(delButton); buttonPane.add(delButton);
boxPane.add(buttonPane); boxPane.add(buttonPane);
boxList.put(uuid, combox); boxList.add(combox);
checkComponent(); checkComponent();
@ -153,7 +146,7 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
@Override @Override
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
boxPane.remove(buttonPane); boxPane.remove(buttonPane);
boxList.remove(uuid); boxList.remove(combox);
checkComponent(); checkComponent();
relayoutPane(); relayoutPane();
} }
@ -227,10 +220,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider top = collection.getSelectedChart().getFilterDefinition();
if (top instanceof NormalTableDataDefinition) { if (top instanceof NormalTableDataDefinition) {
NormalTableDataDefinition normal = (NormalTableDataDefinition) top; NormalTableDataDefinition normal = (NormalTableDataDefinition) top;
Map<String, String> moreCateLabels = normal.getMoreCateLabels(); int size = normal.getMoreCateSize();
for(Map.Entry<String, String> entry : moreCateLabels.entrySet()) { for (int i = 0; i < size; i++) {
UIComboBox box = addNewCombox(entry.getKey()); UIComboBox box = addNewCombox();
box.setSelectedItem(entry.getValue()); box.setSelectedItem(normal.getMoreCateWithIndex(i));
} }
} }
@ -256,11 +249,10 @@ public class CategoryPlotMoreCateTableDataContentPane extends CategoryPlotTableD
} }
protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) { protected void updateMoreCate(NormalTableDataDefinition normal, Plot plot) {
for (Map.Entry<String, UIComboBox> entry : boxList.entrySet()) { for (int i = 0, size = boxList.size(); i < size; i++) {
String uuid = entry.getKey(); UIComboBox box = boxList.get(i);
UIComboBox comboBox = entry.getValue(); if (box.getSelectedItem() != null) {
if (comboBox != null && comboBox.getSelectedItem() != null) { normal.addMoreCate(box.getSelectedItem().toString());
normal.addMoreCate(uuid, comboBox.getSelectedItem().toString());
} }
} }
} }

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

@ -54,7 +54,7 @@ public class VanChartCustomAxisPane extends BasicScrollPane<Chart> {
} }
if(axisPane != null) { if(axisPane != null) {
axisPane.populateBean((VanChartCustomPlot) chart.getPlot()); axisPane.populateBean((VanChart) chart);
} }
} }

10
designer-chart/src/main/java/com/fr/van/chart/custom/style/VanChartCustomAxisTabPane.java

@ -87,11 +87,16 @@ public class VanChartCustomAxisTabPane extends VanChartCustomPlotTabPane<VanChar
} }
@Override @Override
public void populateBean(VanChartCustomPlot plot) {
}
/** /**
* 标准坐标轴属性存在最外层的customPlot的坐标轴变量中 * 标准坐标轴属性存在最外层的customPlot的坐标轴变量中
* 不使用标准坐标轴的坐标轴属性存在相应的plot中的坐标轴变量中 * 不使用标准坐标轴的坐标轴属性存在相应的plot中的坐标轴变量中
*/ */
public void populateBean(VanChartCustomPlot plot) { public void populateBean(VanChart chart) {
VanChartCustomPlot plot = (VanChartCustomPlot) chart.getPlot();
List<VanChartPlot> customPlotList = plot.getCustomPlotList(); List<VanChartPlot> customPlotList = plot.getCustomPlotList();
ArrayList<Integer> plotOrder = plot.getDiffAxisOrder(); ArrayList<Integer> plotOrder = plot.getDiffAxisOrder();
@ -100,12 +105,13 @@ public class VanChartCustomAxisTabPane extends VanChartCustomPlotTabPane<VanChar
//先更新标准坐标轴界面 //先更新标准坐标轴界面
//获取相应点的属性,并更新界面 //获取相应点的属性,并更新界面
VanChartPlot vanChartPlot = customPlotList.get(plotOrder.get(i)); VanChartPlot vanChartPlot = customPlotList.get(plotOrder.get(i));
((VanChartAxisPane)paneList.get(i)).setChart(chart);
((VanChartAxisPane)paneList.get(i)).populateBean(vanChartPlot); ((VanChartAxisPane)paneList.get(i)).populateBean(vanChartPlot);
} }
if (plot.isHaveStandardAxis()){ if (plot.isHaveStandardAxis()){
((VanChartAxisPane)paneList.get(paneList.size() - 1)).setChart(chart);
((VanChartAxisPane)paneList.get(paneList.size() - 1)).populateBean(plot); ((VanChartAxisPane)paneList.get(paneList.size() - 1)).populateBean(plot);
} }
} }

7
designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateReportDataContentPane.java

@ -3,14 +3,11 @@ package com.fr.van.chart.designer.data;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalReportDataDefinition; import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotMoreCateReportDataContentPane; import com.fr.design.mainframe.chart.gui.data.report.CategoryPlotMoreCateReportDataContentPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import java.util.Map;
/** /**
* Created by mengao on 2017/7/3. * Created by mengao on 2017/7/3.
*/ */
@ -44,8 +41,8 @@ public class VanChartMoreCateReportDataContentPane extends CategoryPlotMoreCateR
private void checkBoxList(boolean isSupportMulticategory) { private void checkBoxList(boolean isSupportMulticategory) {
if (getFormualList().size() != 0) { if (getFormualList().size() != 0) {
for (Map.Entry<String, TinyFormulaPane> entry : getFormualList().entrySet()) { for (int i = 0; i < getFormualList().size(); i++) {
entry.getValue().setEnabled(isSupportMulticategory); getFormualList().get(i).setEnabled(isSupportMulticategory);
} }
} }
} }

7
designer-chart/src/main/java/com/fr/van/chart/designer/data/VanChartMoreCateTableDataContentPane.java

@ -3,14 +3,11 @@ package com.fr.van.chart.designer.data;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartdata.NormalTableDataDefinition; import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotMoreCateTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.CategoryPlotMoreCateTableDataContentPane;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot; import com.fr.plugin.chart.attr.plot.VanChartRectanglePlot;
import java.util.Map;
/** /**
* Created by mengao on 2017/7/3. * Created by mengao on 2017/7/3.
*/ */
@ -46,8 +43,8 @@ public class VanChartMoreCateTableDataContentPane extends CategoryPlotMoreCateTa
private void checkBoxList(boolean isSupportMulticategory) { private void checkBoxList(boolean isSupportMulticategory) {
if (getBoxList().size() != 0) { if (getBoxList().size() != 0) {
for (Map.Entry<String, UIComboBox> entry : getBoxList().entrySet()) { for (int i = 0; i < getBoxList().size(); i++) {
entry.getValue().setEnabled(isSupportMulticategory); getBoxList().get(i).setEnabled(isSupportMulticategory);
} }
} }
} }

4
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartAxisPane.java

@ -287,4 +287,8 @@ public class VanChartAxisPane extends BasicBeanPane<VanChart> {
public VanChart updateBean() { public VanChart updateBean() {
return null; return null;
} }
public void setChart(Chart chart) {
this.chart = chart;
}
} }

68
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/VanChartBaseAxisPane.java

@ -7,8 +7,6 @@ import com.fr.base.chart.chartdata.TopDefinitionProvider;
import com.fr.chart.base.TextAttr; import com.fr.chart.base.TextAttr;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Title; import com.fr.chart.chartattr.Title;
import com.fr.chart.chartdata.NormalReportDataDefinition;
import com.fr.chart.chartdata.NormalTableDataDefinition;
import com.fr.design.beans.FurtherBasicBeanPane; import com.fr.design.beans.FurtherBasicBeanPane;
import com.fr.design.formula.TinyFormulaPane; import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.gui.frpane.UINumberDragPane; import com.fr.design.gui.frpane.UINumberDragPane;
@ -51,9 +49,7 @@ import java.awt.Component;
import java.awt.event.ActionEvent; import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 坐标轴的基础配置项分类时间值等公共的部分 * 坐标轴的基础配置项分类时间值等公共的部分
@ -616,73 +612,44 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
} }
categoryStylePane.removeAll(); categoryStylePane.removeAll();
categoryStyles.clear(); categoryStyles.clear();
populateDefaultCateLabelStyle(axis); populateCateLabelStyle(axis);
populateMoreCateLabelStyle(axis);
categoryStylePane.revalidate(); categoryStylePane.revalidate();
} }
/**
* 默认一定会有一个分类标签就populate这个
*/
private void populateDefaultCateLabelStyle(VanChartAxis axis) {
populateCategoryStyles(axis, VanChartAxis.DEFAULT_CATEGORY_UUID, 0);
}
/** /**
* populate其余的分类标签 * populate分类标签
* *
* @param axis * @param axis
*/ */
private void populateMoreCateLabelStyle(VanChartAxis axis) { private void populateCateLabelStyle(VanChartAxis axis) {
Chart chart = axis.getChart(); Chart chart = axis.getChart();
Map<String, String> moreCateLabels = new LinkedHashMap<>(); int size;
TopDefinitionProvider definition = chart.getFilterDefinition(); TopDefinitionProvider definition = chart.getFilterDefinition();
if (definition == null) { size = definition == null ? 1 : definition.getMoreCateSize() + 1;
return;
}
if (definition instanceof NormalTableDataDefinition) {
NormalTableDataDefinition tableDataDefinition = (NormalTableDataDefinition) definition;
moreCateLabels.putAll(tableDataDefinition.getMoreCateLabels());
} else if (definition instanceof NormalReportDataDefinition) {
NormalReportDataDefinition reportDataDefinition = (NormalReportDataDefinition) definition;
for (Map.Entry<String, Object> entry : reportDataDefinition.getMoreCateLabels().entrySet()) {
String uuid = entry.getKey();
String cateLabel = Utils.objectToString(entry.getValue());
moreCateLabels.put(uuid, cateLabel);
}
}
int i = 1; for (int i = 0; i < size; i++) {
List<String> uuids = new ArrayList<>(); populateCategoryStyles(axis, i);
for (Map.Entry<String, String> entry : moreCateLabels.entrySet()) {
String uuid = entry.getKey();
uuids.add(uuid);
populateCategoryStyles(axis, uuid, i);
i++;
} }
axis.retainUsefulCategoryStyles(uuids);
} }
private void populateCategoryStyles(VanChartAxis axis, String uuid, int index) { private void populateCategoryStyles(VanChartAxis axis, int index) {
VanChartCategoryStylePaneWithCheckBox pane = new VanChartCategoryStylePaneWithCheckBox(parent, this, Toolkit.i18nText("Fine-Design_Chart_Style_Category") + (index + 1)); VanChartCategoryStylePaneWithCheckBox pane = new VanChartCategoryStylePaneWithCheckBox(parent, this, Toolkit.i18nText("Fine-Design_Chart_Style_Category") + (index + 1));
VanChartAxisLabelStyle style = populateAxisCategoryStyles(axis, uuid, index); VanChartAxisLabelStyle style = populateAxisCategoryStyles(axis, index);
pane.populate(style, uuid); pane.populate(style);
categoryStyles.add(pane); categoryStyles.add(pane);
categoryStylePane.add(createCateLableStylePanel(), BorderLayout.NORTH); categoryStylePane.add(createCateLableStylePanel(), BorderLayout.NORTH);
} }
private VanChartAxisLabelStyle populateAxisCategoryStyles(VanChartAxis axis, String uuid, int index) { private VanChartAxisLabelStyle populateAxisCategoryStyles(VanChartAxis axis, int index) {
VanChartAxisLabelStyle style; VanChartAxisLabelStyle style;
if (axis.getCategoryStyle(uuid) != null) { if (axis.getCategoryStylesSize() > index && axis.getCategoryStyle(index) != null) {
style = axis.getCategoryStyle(uuid); style = axis.getCategoryStyle(index);
} else { } else {
style = axis.getCategoryStyleByIndex(index);
if (style == null) {
style = new VanChartAxisLabelStyle(); style = new VanChartAxisLabelStyle();
} axis.addCategoryStyle(style);
axis.addCategoryStyle(uuid, style);
} }
return style; return style;
} }
@ -875,12 +842,11 @@ public class VanChartBaseAxisPane extends FurtherBasicBeanPane<VanChartAxis> {
* @param axis * @param axis
*/ */
private void updateLayerDisplayPane(VanChartAxis axis) { private void updateLayerDisplayPane(VanChartAxis axis) {
List<VanChartAxisLabelStyle> styles = new ArrayList<>();
for (VanChartCategoryStylePaneWithCheckBox categoryStyle : categoryStyles) { for (VanChartCategoryStylePaneWithCheckBox categoryStyle : categoryStyles) {
Map<String, VanChartAxisLabelStyle> styleMap = categoryStyle.update(); styles.add(categoryStyle.update());
for (Map.Entry<String, VanChartAxisLabelStyle> entry : styleMap.entrySet()) {
axis.addCategoryStyle(entry.getKey(), entry.getValue());
}
} }
axis.setCategoryStyles(styles);
} }
//轴线样式 //轴线样式

12
designer-chart/src/main/java/com/fr/van/chart/designer/style/axis/component/VanChartCategoryStylePaneWithCheckBox.java

@ -19,8 +19,6 @@ import java.awt.event.ActionEvent;
import java.awt.event.ActionListener; import java.awt.event.ActionListener;
import java.awt.event.MouseAdapter; import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent; import java.awt.event.MouseEvent;
import java.util.LinkedHashMap;
import java.util.Map;
public class VanChartCategoryStylePaneWithCheckBox extends JPanel { public class VanChartCategoryStylePaneWithCheckBox extends JPanel {
private UICheckBox checkBox; // 复选框 private UICheckBox checkBox; // 复选框
@ -30,7 +28,6 @@ public class VanChartCategoryStylePaneWithCheckBox extends JPanel {
private JPanel showOnPane; private JPanel showOnPane;
private AbstractAttrNoScrollPane parent; private AbstractAttrNoScrollPane parent;
private String axisId;
private VanChartAxisLabelStyle axis; private VanChartAxisLabelStyle axis;
public VanChartCategoryStylePaneWithCheckBox(AbstractAttrNoScrollPane parent, JPanel showOnPane, String checkBoxName) { public VanChartCategoryStylePaneWithCheckBox(AbstractAttrNoScrollPane parent, JPanel showOnPane, String checkBoxName) {
@ -88,16 +85,13 @@ public class VanChartCategoryStylePaneWithCheckBox extends JPanel {
} }
} }
public void populate(VanChartAxisLabelStyle style, String uuid) { public void populate(VanChartAxisLabelStyle style) {
this.axis = style; this.axis = style;
this.axisId = uuid;
checkBox.setSelected(axis.isShowLabel()); checkBox.setSelected(axis.isShowLabel());
} }
public Map<String, VanChartAxisLabelStyle> update() { public VanChartAxisLabelStyle update() {
axis.setShowLabel(checkBox.isSelected()); axis.setShowLabel(checkBox.isSelected());
Map<String, VanChartAxisLabelStyle> map = new LinkedHashMap<>(); return axis;
map.put(axisId, axis);
return map;
} }
} }

Loading…
Cancel
Save