From 43528c866fd0f3777056624a418f5fbc723c4818 Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 11 Apr 2018 15:45:58 +0800 Subject: [PATCH 1/4] CHART-2109 --- .../fr/design/ChartTypeInterfaceManager.java | 76 ++++++++----------- .../AreaIndependentChartInterface.java | 4 + .../BarIndependentChartInterface.java | 5 ++ .../BubbleIndependentChartInterface.java | 5 ++ .../ColumnIndependentChartInterface.java | 5 ++ .../CustomIndependentChartInterface.java | 5 ++ .../DonutIndependentChartInterface.java | 5 ++ .../FunnelIndependentChartInterface.java | 5 ++ .../GanttIndependentChartInterface.java | 5 ++ .../GisMapIndependentChartInterface.java | 5 ++ .../LineIndependentChartInterface.java | 5 ++ .../MapIndependentChartInterface.java | 5 ++ .../MeterIndependentChartInterface.java | 5 ++ .../PieIndependentChartInterface.java | 5 ++ .../RadarIndependentChartInterface.java | 5 ++ .../RangeIndependentChartInterface.java | 5 ++ .../StockIndependentChartInterface.java | 5 ++ .../XYScatterIndependentChartInterface.java | 5 ++ .../mainframe/chart/gui/ChartTypePane.java | 23 +++--- 19 files changed, 131 insertions(+), 52 deletions(-) diff --git a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java index 55eba57f36..e28e2fcca9 100644 --- a/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer_chart/src/com/fr/design/ChartTypeInterfaceManager.java @@ -100,13 +100,14 @@ import java.util.Map; import static com.fr.chart.charttypes.ChartTypeManager.CHART_PRIORITY; import static com.fr.chart.charttypes.ChartTypeManager.VAN_CHART_PRIORITY; +import static com.fr.chart.charttypes.ChartTypeManager.enabledChart; /** * Created by eason on 14/12/29. */ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerProvider { - - + + private static ChartTypeInterfaceManager classManager = new ChartTypeInterfaceManager(); private static LinkedHashMap> chartTypeInterfaces = @@ -139,7 +140,7 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } private static WidgetOption[] initWidgetOption() { - + ChartInternationalNameContentBean[] typeName = ChartTypeManager.getInstance().getAllChartBaseNames(); ChartWidgetOption[] child = new ChartWidgetOption[typeName.length]; final Chart[][] allCharts = new Chart[typeName.length][]; @@ -297,24 +298,42 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr } return name; } - - public String[] getTitle4PopupWindow(String priority) { - - if (StringUtils.isEmpty(priority)) { - return getTitle4PopupWindow(); - } - String[] names = new String[getChartSize(priority)]; + + private void addTitles(String priority, List list) { if (chartTypeInterfaces != null && chartTypeInterfaces.containsKey(priority)) { + Map chartUIList = chartTypeInterfaces.get(priority); + Iterator> iterator = chartUIList.entrySet().iterator(); - int i = 0; while (iterator.hasNext()) { Map.Entry entry = iterator.next(); - names[i++] = getChartName(entry.getKey(), entry.getValue()); + String plotID = entry.getKey(); + + if (enabledChart(plotID)) { + list.add(getChartName(plotID, entry.getValue())); + } } - return names; } - return new String[0]; + } + + public String[] getTitle4PopupWindow() { + List priorityList = getPriorityInOrder(); + + List result = new ArrayList(); + + for (Integer priority : priorityList) { + addTitles(String.valueOf(priority), result); + } + + return result.toArray(new String[result.size()]); + } + + public String[] getTitle4PopupWindow(String priority) { + List list = new ArrayList(); + + addTitles(priority, list); + + return list.toArray(new String[list.size()]); } /** @@ -341,35 +360,6 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr return StringUtils.EMPTY; } - private String[] getTitle4PopupWindow() { - - List priorityList = getPriorityInOrder(); - - if (priorityList.size() == 0) { - return new String[0]; - } - - int size = 0; - //获取总得图表格式 - for (Integer aPriorityList : priorityList) { - size += getChartSize(String.valueOf(aPriorityList)); - } - String[] names = new String[size]; - - int index = 0; - for (Integer aPriorityList : priorityList) { - String priority = String.valueOf(aPriorityList); - Iterator> chartUI = chartTypeInterfaces.get(priority).entrySet().iterator(); - while (chartUI.hasNext()) { - Map.Entry chartUIEntry = chartUI.next(); - - names[index++] = getChartName(chartUIEntry.getKey(), chartUIEntry.getValue()); - } - } - - return names; - } - private List getPriorityInOrder() { List priorityList = new ArrayList(); diff --git a/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java index ff8a06ac76..f17d2a57e7 100644 --- a/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java @@ -21,6 +21,10 @@ import com.fr.design.mainframe.chart.gui.type.AreaPlotPane; * Created by eason on 15/4/21. */ public class AreaIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } public AbstractChartTypePane getPlotTypePane(){ return new AreaPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java index de1160b102..0fcff5de5b 100644 --- a/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java @@ -23,6 +23,11 @@ import com.fr.design.mainframe.chart.gui.type.BarPlotPane; */ public class BarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new BarPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java index b9d0b232ce..9cee004846 100644 --- a/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java @@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.BubblePlotPane; */ public class BubbleIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new BubblePlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java index fcbfbc6b2f..a07115530a 100644 --- a/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java @@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.ColumnPlotPane; * Created by eason on 15/4/21. */ public class ColumnIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new ColumnPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java index 3d2af68125..6b9698698d 100644 --- a/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java @@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.CustomPlotPane; */ public class CustomIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new CustomPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java index 96235ed20f..e24510c1f5 100644 --- a/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java @@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.DonutPlotPane; */ public class DonutIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new DonutPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java index 00891e628c..a1a93a7936 100644 --- a/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java @@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.FunnelPlotPane; */ public class FunnelIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new FunnelPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java index 5c8c6f6d5b..bd1e1d710d 100644 --- a/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java @@ -17,6 +17,11 @@ import com.fr.design.mainframe.chart.gui.type.GanttPlotPane; */ public class GanttIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new GanttPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java index 1e172750a8..db137569a5 100644 --- a/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java @@ -13,6 +13,11 @@ import com.fr.design.mainframe.chart.gui.type.GisMapPlotPane; */ public class GisMapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new GisMapPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java index 413ed6b52c..80f303e7f5 100644 --- a/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java @@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.LinePlotPane; */ public class LineIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new LinePlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java index a1f933a1c4..81425de939 100644 --- a/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java @@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.MapPlotPane; */ public class MapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new MapPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java index 5131075565..eac3e79137 100644 --- a/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java @@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.MeterPlotPane; */ public class MeterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new MeterPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java index fabd3f265f..0a63505077 100644 --- a/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java @@ -22,6 +22,11 @@ import com.fr.design.mainframe.chart.gui.type.PiePlotPane; */ public class PieIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new PiePlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java index d0320f8fd3..487c4705d6 100644 --- a/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java @@ -20,6 +20,11 @@ import com.fr.design.mainframe.chart.gui.type.RadarPlotPane; */ public class RadarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new RadarPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java index 04f238192b..c62b84ea73 100644 --- a/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java @@ -18,6 +18,11 @@ import com.fr.design.mainframe.chart.gui.type.RangePlotPane; */ public class RangeIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new RangePlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java index 647c11a919..456fa86449 100644 --- a/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java @@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.StockPlotPane; */ public class StockIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new StockPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java index 23f3630837..dd1ee6a619 100644 --- a/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java @@ -21,6 +21,11 @@ import com.fr.design.mainframe.chart.gui.type.XYScatterPlotPane; */ public class XYScatterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { + @Override + public boolean needChartChangePane() { + return false; + } + public AbstractChartTypePane getPlotTypePane(){ return new XYScatterPlotPane(); } diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java index b2f3141831..0c1e426844 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypePane.java @@ -17,7 +17,6 @@ import com.fr.design.mainframe.chart.PaneTitleConstants; import com.fr.design.mainframe.chart.gui.item.FlexibleComboBox; import com.fr.design.mainframe.chart.gui.item.ItemEventType; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.extended.chart.AbstractChart; import com.fr.general.ComparatorUtils; import com.fr.stable.StringUtils; @@ -202,21 +201,27 @@ public class ChartTypePane extends AbstractChartAttrPane{ public void relayout(ChartCollection collection){ //重构需要重构下拉框选项和cardNames Chart chart = collection.getSelectedChart(); - String chartID = chart.getPriority(); - if (collection.getState() == SwitchState.DEFAULT){ - chartID = StringUtils.EMPTY; - } + String priority = chart.getPriority(); + String plotID = chart.getPlot().getPlotID(); + boolean enabledChart = ChartTypeManager.enabledChart(plotID); + String item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority, plotID); + //第一步就是重构cardNames - cardNames = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID); + if (enabledChart) { + cardNames = collection.getState() == SwitchState.DEFAULT + ? ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow() + : ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(priority); + } else { + cardNames = new String[]{item}; + } + //下拉框重构开始。为了防止重构是触发update ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.REACTOR); //重构下拉框选项 reactorComboBox(); //重新选择选中的下拉项 - chartID = chart.getPriority(); - String plotID = chart.getPlot().getPlotID(); - Object item = ChartTypeInterfaceManager.getInstance().getTitle4PopupWindow(chartID, plotID); jcb.setSelectedItem(item); + jcb.setEnabled(enabledChart); //下拉框重构结束 ((FlexibleComboBox)jcb).setItemEvenType(ItemEventType.DEFAULT); //重新选中 From 7bce2c1ce31afc1ddb9dc50f7f098f5d8486ddab Mon Sep 17 00:00:00 2001 From: zheng Date: Wed, 11 Apr 2018 16:57:41 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=B8=80=E6=B3=A2assets/?= =?UTF-8?q?map=20assist/phantomjs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/com/fr/van/chart/DownloadOnlineSourcesHelper.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java b/designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java index 394eaf5430..23b4339eea 100644 --- a/designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java +++ b/designer_chart/src/com/fr/van/chart/DownloadOnlineSourcesHelper.java @@ -1,6 +1,7 @@ package com.fr.van.chart; import com.fr.base.FRContext; +import com.fr.chart.base.ChartConstants; import com.fr.design.RestartHelper; import com.fr.design.extra.PluginConstants; import com.fr.design.gui.ilable.UILabel; @@ -59,17 +60,17 @@ public class DownloadOnlineSourcesHelper implements DownloadSourcesEvent { private static final double PHANTOM_MB = 96.1 * 1024 * 1024; public void addPhantomSiteInfo() { - this.addSiteInfo("plugin.phantomjs", "/assist/phantomjs", PHANTOM_MB); + this.addSiteInfo("plugin.phantomjs", ChartConstants.PHANTOMJS_URL, PHANTOM_MB); } private static final double MAP_JSON_MB = 3.8 * 1024 * 1024; public void addMapJSONSiteInfo() { - this.addSiteInfo("map.json", "/assets/map", MAP_JSON_MB); + this.addSiteInfo("map.json", ChartConstants.MAP_JSON_URL, MAP_JSON_MB); } public void addSiteInfo(String siteKind, String localDir, double megaBits) { - if (new File(FRContext.getCurrentEnv().getPath() + localDir).exists()) { + if (new File(StableUtils.pathJoin(FRContext.getCurrentEnv().getPath(), localDir)).exists()) { //本地有这个资源,不下载 return; } From b1bf6aac1dcff7fb1f3513949ea8b270c9c29105 Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 12 Apr 2018 13:41:46 +0800 Subject: [PATCH 3/4] disable add button not whole button pan --- .../AreaIndependentChartInterface.java | 4 ---- .../BarIndependentChartInterface.java | 5 ----- .../BubbleIndependentChartInterface.java | 5 ----- .../ColumnIndependentChartInterface.java | 4 ---- .../CustomIndependentChartInterface.java | 4 ---- .../DonutIndependentChartInterface.java | 4 ---- .../FunnelIndependentChartInterface.java | 4 ---- .../GanttIndependentChartInterface.java | 4 ---- .../GisMapIndependentChartInterface.java | 4 ---- .../LineIndependentChartInterface.java | 4 ---- .../MapIndependentChartInterface.java | 4 ---- .../MeterIndependentChartInterface.java | 4 ---- .../PieIndependentChartInterface.java | 4 ---- .../RadarIndependentChartInterface.java | 4 ---- .../RangeIndependentChartInterface.java | 4 ---- .../StockIndependentChartInterface.java | 4 ---- .../XYScatterIndependentChartInterface.java | 4 ---- .../mainframe/chart/gui/ChartTypeButtonPane.java | 16 +++++++++++++--- 18 files changed, 13 insertions(+), 73 deletions(-) diff --git a/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java index f17d2a57e7..ff8a06ac76 100644 --- a/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/AreaIndependentChartInterface.java @@ -21,10 +21,6 @@ import com.fr.design.mainframe.chart.gui.type.AreaPlotPane; * Created by eason on 15/4/21. */ public class AreaIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new AreaPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java index 0fcff5de5b..de1160b102 100644 --- a/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/BarIndependentChartInterface.java @@ -23,11 +23,6 @@ import com.fr.design.mainframe.chart.gui.type.BarPlotPane; */ public class BarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } - public AbstractChartTypePane getPlotTypePane(){ return new BarPlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java index 9cee004846..b9d0b232ce 100644 --- a/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/BubbleIndependentChartInterface.java @@ -20,11 +20,6 @@ import com.fr.design.mainframe.chart.gui.type.BubblePlotPane; */ public class BubbleIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } - public AbstractChartTypePane getPlotTypePane(){ return new BubblePlotPane(); } diff --git a/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java index a07115530a..8a9249274f 100644 --- a/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/ColumnIndependentChartInterface.java @@ -22,10 +22,6 @@ import com.fr.design.mainframe.chart.gui.type.ColumnPlotPane; * Created by eason on 15/4/21. */ public class ColumnIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new ColumnPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java index 6b9698698d..584cdb5e1e 100644 --- a/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/CustomIndependentChartInterface.java @@ -20,10 +20,6 @@ import com.fr.design.mainframe.chart.gui.type.CustomPlotPane; */ public class CustomIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new CustomPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java index e24510c1f5..8b5894384a 100644 --- a/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/DonutIndependentChartInterface.java @@ -22,10 +22,6 @@ import com.fr.design.mainframe.chart.gui.type.DonutPlotPane; */ public class DonutIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new DonutPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java index a1a93a7936..75ca4e6f82 100644 --- a/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/FunnelIndependentChartInterface.java @@ -20,10 +20,6 @@ import com.fr.design.mainframe.chart.gui.type.FunnelPlotPane; */ public class FunnelIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new FunnelPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java index bd1e1d710d..b032b7ca25 100644 --- a/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/GanttIndependentChartInterface.java @@ -17,10 +17,6 @@ import com.fr.design.mainframe.chart.gui.type.GanttPlotPane; */ public class GanttIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new GanttPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java index db137569a5..04cdbd8b29 100644 --- a/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/GisMapIndependentChartInterface.java @@ -13,10 +13,6 @@ import com.fr.design.mainframe.chart.gui.type.GisMapPlotPane; */ public class GisMapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new GisMapPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java index 80f303e7f5..a133a200ac 100644 --- a/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/LineIndependentChartInterface.java @@ -21,10 +21,6 @@ import com.fr.design.mainframe.chart.gui.type.LinePlotPane; */ public class LineIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new LinePlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java index 81425de939..2fc17e1476 100644 --- a/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/MapIndependentChartInterface.java @@ -18,10 +18,6 @@ import com.fr.design.mainframe.chart.gui.type.MapPlotPane; */ public class MapIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new MapPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java index eac3e79137..ce1f5b07bf 100644 --- a/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/MeterIndependentChartInterface.java @@ -18,10 +18,6 @@ import com.fr.design.mainframe.chart.gui.type.MeterPlotPane; */ public class MeterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new MeterPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java index 0a63505077..0583186ebf 100644 --- a/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/PieIndependentChartInterface.java @@ -22,10 +22,6 @@ import com.fr.design.mainframe.chart.gui.type.PiePlotPane; */ public class PieIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new PiePlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java index 487c4705d6..04ca36dcbc 100644 --- a/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/RadarIndependentChartInterface.java @@ -20,10 +20,6 @@ import com.fr.design.mainframe.chart.gui.type.RadarPlotPane; */ public class RadarIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new RadarPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java index c62b84ea73..85866c339e 100644 --- a/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/RangeIndependentChartInterface.java @@ -18,10 +18,6 @@ import com.fr.design.mainframe.chart.gui.type.RangePlotPane; */ public class RangeIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new RangePlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java index 456fa86449..7d73d8594f 100644 --- a/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/StockIndependentChartInterface.java @@ -21,10 +21,6 @@ import com.fr.design.mainframe.chart.gui.type.StockPlotPane; */ public class StockIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new StockPlotPane(); diff --git a/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java b/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java index dd1ee6a619..64de95eae1 100644 --- a/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java +++ b/designer_chart/src/com/fr/design/chartinterface/XYScatterIndependentChartInterface.java @@ -21,10 +21,6 @@ import com.fr.design.mainframe.chart.gui.type.XYScatterPlotPane; */ public class XYScatterIndependentChartInterface extends AbstractIndependentChartUIWithAPILevel { - @Override - public boolean needChartChangePane() { - return false; - } public AbstractChartTypePane getPlotTypePane(){ return new XYScatterPlotPane(); diff --git a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java index dfd06f08b1..8913febc13 100644 --- a/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java +++ b/designer_chart/src/com/fr/design/mainframe/chart/gui/ChartTypeButtonPane.java @@ -5,6 +5,7 @@ import com.fr.chart.base.AttrChangeConfig; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.SwitchState; +import com.fr.chart.charttypes.ChartTypeManager; import com.fr.design.beans.BasicBeanPane; import com.fr.design.dialog.DialogActionListener; import com.fr.design.dialog.UIDialog; @@ -21,8 +22,17 @@ import com.fr.general.FRLogger; import com.fr.general.Inter; import com.fr.stable.StringUtils; -import javax.swing.*; -import java.awt.*; +import javax.swing.BorderFactory; +import javax.swing.BoxLayout; +import javax.swing.JPanel; +import javax.swing.SwingUtilities; +import java.awt.BorderLayout; +import java.awt.Dimension; +import java.awt.FlowLayout; +import java.awt.Graphics; +import java.awt.GridLayout; +import java.awt.Image; +import java.awt.Rectangle; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.FocusEvent; @@ -302,7 +312,7 @@ public class ChartTypeButtonPane extends BasicBeanPane implemen } private void checkConfigButtonVisible() { - addButton.setVisible(true); + addButton.setVisible(ChartTypeManager.enabledChart(editingCollection.getSelectedChart().getPlot().getPlotID())); //新建一个collection if(editingCollection.getState() == SwitchState.DEFAULT && editingCollection.getSelectedChart() != null){ //Chart 不支持图表切换 From cc8470f8810e88605121b5cf4ad2876f1fe4c316 Mon Sep 17 00:00:00 2001 From: zheng Date: Thu, 12 Apr 2018 17:24:31 +0800 Subject: [PATCH 4/4] update --- designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java b/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java index 1edf25e047..eb7ed11682 100644 --- a/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java +++ b/designer_chart/src/com/fr/extended/chart/ExtendedOtherPane.java @@ -105,7 +105,7 @@ public class ExtendedOtherPane extends AbstractChartAttrPane { panel.add(refreshEnabled, BorderLayout.NORTH); panel.add(contentPane, BorderLayout.CENTER); - JPanel gapPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Designer_Auto_Refresh"), panel); + JPanel gapPane = TableLayout4VanChartHelper.createGapTableLayoutPane(Inter.getLocText("FR-Design-Chart_Auto_Refresh"), panel); return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Inter.getLocText("Chart-Use_Refresh"), gapPane); }