From d3058022afa23d7e3be40b6db8813d66b5c06ed5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 5 Aug 2020 10:58:09 +0800 Subject: [PATCH] =?UTF-8?q?CHART-12124=20=E4=BB=A3=E7=A0=81=E8=B4=A8?= =?UTF-8?q?=E9=87=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../style/VanChartRangeLegendPane.java | 30 +++++++------------ 1 file changed, 10 insertions(+), 20 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java index 837f00dead..5fa030a287 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartRangeLegendPane.java @@ -1,16 +1,13 @@ package com.fr.van.chart.designer.style; -import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; import com.fr.plugin.chart.attr.VanChartLegend; import com.fr.plugin.chart.range.SectionLegend; import com.fr.plugin.chart.range.VanChartRangeLegend; import com.fr.plugin.chart.type.LegendType; -import com.fr.van.chart.range.component.GradualLegendPane; import com.fr.van.chart.range.component.LegendLabelFormatPane; -import com.fr.van.chart.range.component.SectionLegendPane; import javax.swing.JPanel; import java.awt.CardLayout; @@ -25,16 +22,9 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { private static final long serialVersionUID = 1614283200308877353L; //散点图不同类型面板容器,容器布局管理 - private JPanel rangeLegendPane; - - //图例切换按钮 - private UIButtonGroup legendTypeButton; + private JPanel rangeLabelPane; //普通图例面板(因为普通图例没有新内容,故而为空) - private JPanel ordinaryLegendPane; - //渐变色图例面板 - private GradualLegendPane gradualLegendPane; - //区域段图例面板 - private SectionLegendPane sectionLegendPane; + private JPanel ordinaryLabelPane; private LegendLabelFormatPane gradualLabelFormPane; @@ -50,8 +40,8 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { super(parent); } - private JPanel createRangeLegendPane() { - ordinaryLegendPane = new JPanel(); + private JPanel createRangeLabelPane() { + ordinaryLabelPane = new JPanel(); gradualLabelFormPane = new LegendLabelFormatPane(); gradualLabelFormPane.setParentPane(this.getLegendPaneParent()); sectionLabelFormPane = new LegendLabelFormatPane() { @@ -66,7 +56,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { @Override public Dimension getPreferredSize() { if (legendType == LegendType.ORDINARY) { - return new Dimension(ordinaryLegendPane.getWidth(), 0); + return new Dimension(ordinaryLabelPane.getWidth(), 0); } else if (legendType == LegendType.GRADUAL) { return gradualLabelFormPane.getPreferredSize(); } else { @@ -75,7 +65,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { } }; - panel.add(ordinaryLegendPane, LegendType.ORDINARY.getStringType()); + panel.add(ordinaryLabelPane, LegendType.ORDINARY.getStringType()); panel.add(gradualLabelFormPane, LegendType.GRADUAL.getStringType()); panel.add(sectionLabelFormPane, LegendType.SECTION.getStringType()); @@ -88,7 +78,7 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { @Override protected JPanel createLegendPane() { - rangeLegendPane = createRangeLegendPane(); + rangeLabelPane = createRangeLabelPane(); //不包含新内容的普通面板内容 JPanel commonLegendPane = this.createCommonLegendPane(); @@ -98,15 +88,15 @@ public class VanChartRangeLegendPane extends VanChartPlotLegendPane { double[] col = {f}; double[] row = {p, p}; Component[][] components = new Component[][]{ - new Component[]{rangeLegendPane}, + new Component[]{rangeLabelPane}, new Component[]{commonLegendPane} }; return TableLayoutHelper.createTableLayoutPane(components, row, col); } private void checkCardPane() { - CardLayout cardLayout = (CardLayout) rangeLegendPane.getLayout(); - cardLayout.show(rangeLegendPane, legendType.getStringType()); + CardLayout cardLayout = (CardLayout) rangeLabelPane.getLayout(); + cardLayout.show(rangeLabelPane, legendType.getStringType()); } @Override