From 9f7ae36eee9903209276c524c1dd5800ff96bda5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 10 Jun 2020 14:40:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?CHART-14106=20=E6=8E=A7=E4=BB=B6=E7=9A=84?= =?UTF-8?q?=E9=BC=A0=E6=A0=87=E6=97=B6=E9=97=B4=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../designer/style/VanChartPlotLegendPane.java | 18 +++++------------- .../designer/style/VanChartTitlePane.java | 17 ++++------------- 2 files changed, 9 insertions(+), 26 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java index 7e597bd5d9..3c5e992b92 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartPlotLegendPane.java @@ -253,23 +253,15 @@ public class VanChartPlotLegendPane extends BasicPane { }); customFloatPositionButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if(!customFloatPositionButton.isSelected()){ - customFloatPositionButton.setSelected(true); - checkLayoutPaneVisible(); - checkDisplayStrategyUse(); - } - } - - @Override - public void mousePressed(MouseEvent e) { - location.setSelectedIndex(-1); - } @Override public void mouseReleased(MouseEvent e) { super.mouseReleased(e); + location.setSelectedIndex(-1); + customFloatPositionButton.setSelected(true); + checkLayoutPaneVisible(); + checkDisplayStrategyUse(); + if(customFloatPositionPane == null) { customFloatPositionPane = new VanChartFloatPositionPane(); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java index 908a75d212..761bf12fd1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/designer/style/VanChartTitlePane.java @@ -214,23 +214,14 @@ public class VanChartTitlePane extends AbstractVanChartScrollPane { }); customFloatPositionButton.addMouseListener(new MouseAdapter() { - @Override - public void mouseClicked(MouseEvent e) { - if (!customFloatPositionButton.isSelected()) { - customFloatPositionButton.setSelected(true); - checkDisplayStrategyUse(); - } - } - - @Override - public void mousePressed(MouseEvent e) { - alignmentPane.setSelectedIndex(-1); - } - @Override public void mouseReleased(MouseEvent e) { super.mouseReleased(e); + alignmentPane.setSelectedIndex(-1); + customFloatPositionButton.setSelected(true); + checkDisplayStrategyUse(); + if (customFloatPositionPane == null) { customFloatPositionPane = new VanChartFloatPositionPane(); } From 1db565b58cfec6482668d9237b3463c3f4ba7b23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Wed, 10 Jun 2020 16:24:27 +0800 Subject: [PATCH 2/2] =?UTF-8?q?CHART-14062=20=E9=A2=84=E5=AE=9A=E4=B9=89?= =?UTF-8?q?=E9=85=8D=E8=89=B2=E9=83=BD=E8=A2=AB=E5=88=A0=E5=85=89=E4=B9=8B?= =?UTF-8?q?=E5=90=8E=E7=9A=84=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combobox/ColorSchemeComboBox.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java index db59179a31..e7a7ab929b 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/component/combobox/ColorSchemeComboBox.java @@ -2,6 +2,8 @@ package com.fr.design.chartx.component.combobox; import com.fr.base.ChartColorMatching; import com.fr.base.ChartPreStyleConfig; +import com.fr.cert.token.lang.Collections; +import com.fr.chart.base.ChartConstants; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBoxRenderer; import com.fr.design.i18n.Toolkit; @@ -60,13 +62,20 @@ public class ColorSchemeComboBox extends UIComboBox { //添加默认的方案和第一个方案 String defaultName = config.getCurrentStyle(); ChartColorMatching defaultStyle = (ChartColorMatching) config.getPreStyle(defaultName); - Object firstName = names.next(); - ChartColorMatching firstStyle = (ChartColorMatching) config.getPreStyle(firstName); - if (defaultStyle == null) { - defaultStyle = firstStyle; + if (names.hasNext()) { + Object firstName = names.next(); + ChartColorMatching firstStyle = (ChartColorMatching) config.getPreStyle(firstName); + if (defaultStyle == null) { + defaultStyle = firstStyle; + } + colorSchemes.put(Toolkit.i18nText("Fine-Design_Report_Default"), colorMatchingToColorInfo(defaultStyle)); + colorSchemes.put(firstStyle.getId(), colorMatchingToColorInfo(firstStyle)); + } else { + ColorInfo colorInfo = new ColorInfo(); + colorInfo.setGradient(false); + colorInfo.setColors(Collections.arrayToList(ChartConstants.CHART_COLOR_ARRAY)); + colorSchemes.put(Toolkit.i18nText("Fine-Design_Report_Default"), colorInfo); } - colorSchemes.put(Toolkit.i18nText("Fine-Design_Report_Default"), colorMatchingToColorInfo(defaultStyle)); - colorSchemes.put(firstStyle.getId(), colorMatchingToColorInfo(firstStyle)); //添加其他的配色方案 while (names.hasNext()) {