From 1b5847da3dc49ebf106558ff46c6a3bc490f95ae Mon Sep 17 00:00:00 2001 From: shine Date: Thu, 14 Nov 2019 11:37:58 +0800 Subject: [PATCH] =?UTF-8?q?CHART-10227=20=E5=9C=B0=E5=9B=BE=20=E9=92=BB?= =?UTF-8?q?=E5=8F=96=E5=9C=B0=E5=9B=BE=20=E7=83=AD=E5=8A=9B=E5=9C=B0?= =?UTF-8?q?=E5=9B=BE=20=E6=95=B0=E6=8D=AE=E9=85=8D=E7=BD=AE=E7=95=8C?= =?UTF-8?q?=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../fr/design/ChartTypeInterfaceManager.java | 12 +- .../design/chartx/AbstractChartDataPane.java | 12 +- .../fr/design/chartx/GanttChartDataPane.java | 52 ---- .../data/drillMap/DrillMapChartDataPane.java | 76 ++++++ .../data/drillMap/DrillMapDataPane.java | 120 ++++++++++ .../data/drillMap}/DrillMapLayerPane.java | 136 ++++++----- .../drillMap/EachLayerDataDefinitionPane.java | 128 ++++++++++ .../data/map/AbstractAreaLngLatPane.java | 111 +++++++++ .../LineMapAreaLngLatPaneWithComboBox.java | 106 +++++++++ .../LineMapAreaLngLatPaneWithTinyFormula.java | 113 +++++++++ .../chartx/data/map/MapChartDataPane.java | 93 ++++++++ .../PointMapAreaLngLatPaneWithComboBox.java | 71 ++++++ ...PointMapAreaLngLatPaneWithTinyFormula.java | 84 +++++++ .../fields/AbstractDataSetFieldsPane.java | 6 +- .../diff/AreaMapCellDataFieldsPane.java | 49 ++++ .../fields/diff/AreaMapDataSetFieldsPane.java | 50 ++++ .../diff/LineMapCellDataFieldsPane.java | 64 +++++ .../fields/diff/LineMapDataSetFieldsPane.java | 61 +++++ .../diff/PointMapCellDataFieldsPane.java | 48 ++++ .../diff/PointMapDataSetFieldsPane.java | 51 ++++ ...rface.java => VanDrillMapChartTypeUI.java} | 8 +- .../data/VanChartDrillMapContentsPane.java | 52 ---- .../data/VanChartDrillMapDataPane.java | 39 --- .../data/VanChartMapLayerAndDataTabPane.java | 130 ---------- .../designer/data/comp/DrillMapDataPane.java | 117 --------- .../comp/EachLayerDataDefinitionPane.java | 171 ------------- .../comp/SingleLayerDataDefinitionPane.java | 94 -------- ...erface.java => VanHeatMapChartTypeUI.java} | 18 +- ...tInterface.java => VanMapChartTypeUI.java} | 36 +-- .../chart/map/designer/VanChartGroupPane.java | 4 + .../data/CustomMapChartDataContentsPane.java | 84 ------- .../map/designer/data/MapDataPaneHelper.java | 177 -------------- .../designer/data/VanChartMapDataPane.java | 121 ---------- .../component/LongitudeLatitudeAndArea.java | 34 --- ...riesNameUseFieldNamePaneWithOutFilter.java | 23 -- ...iesNameUseFieldValuePaneWithOutFilter.java | 29 --- .../SeriesTypeUseComboxPaneWithOutFilter.java | 40 ---- .../report/AbstractLongLatAreaPane.java | 13 - .../data/component/report/AreaPane.java | 65 ----- .../component/report/LineMapAreaPane.java | 71 ------ .../report/LineMapLongLatAreaPane.java | 37 --- .../component/report/LongLatAreaPane.java | 78 ------ .../component/report/PointMapAreaPane.java | 47 ---- .../report/PointMapLongLatAreaPane.java | 14 -- .../table/AbstractLongLatAreaPane.java | 26 -- .../data/component/table/AreaPane.java | 104 -------- .../data/component/table/LineMapAreaPane.java | 100 -------- .../table/LineMapLongLatAreaPane.java | 42 ---- .../data/component/table/LongLatAreaPane.java | 123 ---------- .../component/table/PointMapAreaPane.java | 69 ------ .../table/PointMapLongLatAreaPane.java | 18 -- .../VanAreaMapPlotReportDataContentPane.java | 111 --------- .../VanLineMapPlotReportDataContentPane.java | 24 -- .../VanPointMapPlotReportDataContentPane.java | 171 ------------- .../VanAreaMapPlotTableDataContentPane.java | 177 -------------- .../VanLineMapPlotTableDataContentPane.java | 25 -- .../VanPointMapPlotTableDataContentPane.java | 225 ------------------ 57 files changed, 1341 insertions(+), 2819 deletions(-) delete mode 100644 designer-chart/src/main/java/com/fr/design/chartx/GanttChartDataPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java rename designer-chart/src/main/java/com/fr/{van/chart/drillmap/designer/data/comp => design/chartx/data/drillMap}/DrillMapLayerPane.java (66%) create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java create mode 100644 designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java rename designer-chart/src/main/java/com/fr/van/chart/drillmap/{DrillMapIndependentVanChartInterface.java => VanDrillMapChartTypeUI.java} (89%) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java rename designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/{HeatMapIndependentVanChartInterface.java => VanHeatMapChartTypeUI.java} (78%) rename designer-chart/src/main/java/com/fr/van/chart/map/{MapIndependentVanChartInterface.java => VanMapChartTypeUI.java} (59%) delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java delete mode 100644 designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java diff --git a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java index 317d17bdb0..4eb7258348 100644 --- a/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java +++ b/designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java @@ -82,13 +82,13 @@ import com.fr.van.chart.bar.BarIndependentVanChartInterface; import com.fr.van.chart.bubble.BubbleIndependentVanChartInterface; import com.fr.van.chart.column.VanColumnChartTypeUI; import com.fr.van.chart.custom.CustomIndependentVanChartInterface; -import com.fr.van.chart.drillmap.DrillMapIndependentVanChartInterface; +import com.fr.van.chart.drillmap.VanDrillMapChartTypeUI; import com.fr.van.chart.funnel.designer.FunnelIndependentVanChartInterface; import com.fr.van.chart.gantt.designer.GanttIndependentVanChartInterface; import com.fr.van.chart.gauge.GaugeIndependentVanChartInterface; -import com.fr.van.chart.heatmap.designer.HeatMapIndependentVanChartInterface; +import com.fr.van.chart.heatmap.designer.VanHeatMapChartTypeUI; import com.fr.van.chart.line.LineIndependentVanChartInterface; -import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.multilayer.MultiPieIndependentVanChartInterface; import com.fr.van.chart.pie.PieIndependentVanChartInterface; import com.fr.van.chart.radar.RadarIndependentVanChartInterface; @@ -192,11 +192,11 @@ public class ChartTypeInterfaceManager implements ExtraChartDesignClassManagerPr addChartTypeInterface(VAN_CHART_PRIORITY, VanChartBubblePlot.VAN_CHART_BUBBLE_PLOT_ID, new BubbleIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartCustomPlot.VAN_CHART_CUSTOM_PLOT_ID, new CustomIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMultiPiePlot.VAN_CHART_MULTILAYER_PLOT_ID, new MultiPieIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new MapIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new DrillMapIndependentVanChartInterface()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartMapPlot.VAN_CHART_MAP_ID, new VanMapChartTypeUI()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartDrillMapPlot.VAN_CHART_DRILL_MAP_ID, new VanDrillMapChartTypeUI()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartTreeMapPlot.VAN_CHART_TREE_MAP_PLOT_ID, new TreeMapIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartFunnelPlot.VAN_CHART_FUNNEL_PLOT_ID, new FunnelIndependentVanChartInterface()); - addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new HeatMapIndependentVanChartInterface()); + addChartTypeInterface(VAN_CHART_PRIORITY, VanChartHeatMapPlot.VAN_CHART_HEAT_MAP_ID, new VanHeatMapChartTypeUI()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartWordCloudPlot.WORD_CLOUD_PLOT_ID, new WordCloudIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartGanttPlot.VAN_CHART_GANTT_PLOT_ID, new GanttIndependentVanChartInterface()); addChartTypeInterface(VAN_CHART_PRIORITY, VanChartStructurePlot.STRUCTURE_PLOT_ID, new VanStructureChartTypeUI()); diff --git a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java index b8690f8df6..d072905e60 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java @@ -13,6 +13,12 @@ import java.awt.BorderLayout; */ public abstract class AbstractChartDataPane extends ChartDataPane { + private VanChart vanChart; + + protected VanChart getVanChart() { + return vanChart; + } + public AbstractChartDataPane(AttributeChangeListener listener) { super(listener); } @@ -26,15 +32,15 @@ public abstract class AbstractChartDataPane { - - private AbstractVanSingleDataPane dataPane; - private AbstractVanSingleDataPane linkPane; - - @Override - protected JPanel createContentPane() { - dataPane = new AbstractVanSingleDataPane(listener) { - @Override - protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); - } - }; - linkPane = new AbstractVanSingleDataPane(listener) { - @Override - protected SingleDataPane createSingleDataPane() { - return new SingleDataPane(new MultiCategoryDataSetFieldsPane(), new MultiCategoryCellDataFieldsPane()); - } - }; - return new VanChartGroupPane(new String[]{"data", "link"}, new JPanel[]{dataPane, linkPane}) { - }; - } - - public GanttChartDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - public void populate(GanttChartDataDefinition ganttChartDataDefinition) { - dataPane.populate(ganttChartDataDefinition.getDataDefinition()); - linkPane.populate(ganttChartDataDefinition.getLinkDefinition()); - } - - @Override - public GanttChartDataDefinition update() { - return null; - } -} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java new file mode 100644 index 0000000000..ae52b401de --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java @@ -0,0 +1,76 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.chartx.AbstractChartDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; +import com.fr.van.chart.map.designer.VanChartGroupPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class DrillMapChartDataPane extends AbstractChartDataPane { + private DrillMapLayerPane layerPane; + private DrillMapDataPane dataPane; + + public DrillMapChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + private VanChartDrillMapPlot getDrillMapPlot() { + if (getVanChart() != null) { + return getVanChart().getPlot(); + } + return null; + } + + @Override + protected JPanel createContentPane() { + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + if (drillMapPlot == null) { + return new JPanel(); + } + + layerPane = new DrillMapLayerPane(drillMapPlot); + dataPane = new DrillMapDataPane(drillMapPlot); + return new VanChartGroupPane(new String[]{Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"), Toolkit.i18nText("Fine-Design_Chart_Use_Data")}, + new JPanel[]{layerPane, dataPane}) { + @Override + protected void tabChanged(int index) { + if (index == 0) { + return; + } + dataPane.fireMapTypeChanged(); + } + }; + } + + + @Override + protected void populate(DrillMapChartDataDefinition drillMapChartDataDefinition) { + if (drillMapChartDataDefinition == null) { + return; + } + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + + layerPane.populateBean(drillMapPlot); + dataPane.populateBean(drillMapChartDataDefinition); + } + + @Override + protected DrillMapChartDataDefinition update() { + VanChartDrillMapPlot drillMapPlot = getDrillMapPlot(); + + layerPane.updateBean(drillMapPlot); + + DrillMapChartDataDefinition definition = new DrillMapChartDataDefinition(); + dataPane.updateBean(definition); + + return definition; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java new file mode 100644 index 0000000000..8cd2367db0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java @@ -0,0 +1,120 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.beans.BasicBeanPane; +import com.fr.design.beans.FurtherBasicBeanPane; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.UIComboBoxPane; +import com.fr.design.i18n.Toolkit; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; + +import java.awt.BorderLayout; +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Mitisky on 16/6/20. + * 钻取地图数据配置界面中 和钻取层级平级的数据界面 + */ +public class DrillMapDataPane extends BasicBeanPane { + private UIComboBoxPane dataDefinitionType;//数据定义方式:底层数据汇总/各层级分别指定 + + private SingleDataPane bottomDataPane;//底层数据汇总方式定义钻取地图数据 + + private EachLayerDataDefinitionPane eachLayerDataDefinitionPane;//各层级分别指定 + + public DrillMapDataPane(VanChartDrillMapPlot drillMapPlot) { + bottomDataPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + eachLayerDataDefinitionPane = new EachLayerDataDefinitionPane(drillMapPlot); + + dataDefinitionType = new UIComboBoxPane() { + @Override + protected List> initPaneList() { + + List> paneList = new ArrayList>(); + paneList.add(new BottomLayerDataDefinitionPane()); + paneList.add(eachLayerDataDefinitionPane); + return paneList; + } + + @Override + protected String title4PopupWindow() { + return null; + } + }; + + this.setLayout(new BorderLayout()); + this.add(dataDefinitionType, BorderLayout.CENTER); + } + + public void fireMapTypeChanged() { + eachLayerDataDefinitionPane.fireMapTypeChanged(); + } + + @Override + public void populateBean(DrillMapChartDataDefinition ob) { + + dataDefinitionType.setSelectedIndex(ob.isFromBottomData() ? 0 : 1); + + bottomDataPane.populateBean(ob.getBottomDataDefinition()); + eachLayerDataDefinitionPane.populateBean(ob); + } + + /** + * Update. + */ + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public void updateBean(DrillMapChartDataDefinition drillMapDefinition) { + if (dataDefinitionType.getSelectedIndex() == 0) { + drillMapDefinition.setFromBottomData(true); + drillMapDefinition.setBottomDataDefinition(bottomDataPane.updateBean()); + } else { + drillMapDefinition.setFromBottomData(false); + eachLayerDataDefinitionPane.updateBean(drillMapDefinition); + } + } + + @Override + protected String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Use_Data"); + } + + private class BottomLayerDataDefinitionPane extends FurtherBasicBeanPane { + + private BottomLayerDataDefinitionPane() { + this.setLayout(new BorderLayout()); + this.add(bottomDataPane, BorderLayout.CENTER); + } + + @Override + public boolean accept(Object ob) { + return false; + } + + @Override + public void reset() { + + } + + @Override + public void populateBean(DrillMapChartDataDefinition ob) { + } + + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Bottom_Data_Sum"); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java similarity index 66% rename from designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java rename to designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java index 6fd6ecabbc..b12bf385a0 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java @@ -1,19 +1,18 @@ -package com.fr.van.chart.drillmap.designer.data.comp; +package com.fr.design.chartx.data.drillMap; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.dialog.BasicScrollPane; +import com.fr.chartx.TwoTuple; +import com.fr.design.beans.BasicBeanPane; import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayoutHelper; -import com.fr.general.ComparatorUtils; - -import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.ZoomLevel; import com.fr.van.chart.designer.TableLayout4VanChartHelper; +import com.fr.van.chart.drillmap.designer.data.comp.MapDataTree; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; import javax.swing.BorderFactory; @@ -28,7 +27,7 @@ import java.util.HashMap; * Created by Mitisky on 16/6/20. * 钻取地图数据配置界面--钻取层级界面 */ -public class DrillMapLayerPane extends BasicScrollPane { +public class DrillMapLayerPane extends BasicBeanPane { private static final String[] CUSTOM_MAP_TYPES = new String[]{MapType.AREA.getLocaleString(), MapType.POINT.getLocaleString()}; private static final String[] AREA_MAP_TYPES = new String[]{MapType.AREA.getLocaleString()}; private static final String[] POINT_MAP_TYPES = new String[]{MapType.POINT.getLocaleString()}; @@ -44,25 +43,65 @@ public class DrillMapLayerPane extends BasicScrollPane { private MapDataTree mapDataTree; private Component[][] detailComps; - private int depth; - private MapType oldMapType; - private String oldGeoUrl; - @Override - protected void layoutContentPane() { - leftcontentPane = createContentPane(); - leftcontentPane.setBorder(BorderFactory.createEmptyBorder(10, 0, 0, 0)); - this.add(leftcontentPane); + public DrillMapLayerPane(VanChartDrillMapPlot drillMapPlot) { + + initMapTypeAndZoom(drillMapPlot); + + JPanel contentPane = createContentPane(drillMapPlot); + + this.setLayout(new BorderLayout()); + this.add(contentPane, BorderLayout.CENTER); } - @Override - protected JPanel createContentPane() { + private void initMapTypeAndZoom(VanChartDrillMapPlot drillMapPlot) { + + if (drillMapPlot != null) { + + int depth = getRootAndDepth(drillMapPlot).getSecond(); + + java.util.List levelList = drillMapPlot.getLayerLevelList(); + java.util.List mapTypeList = drillMapPlot.getLayerMapTypeList(); + + //根据层级初始属性,一切以json那边读到的层级为准 + int levelSize = levelList.size(); + for (int i = levelSize; i < depth; i++) { + levelList.add(ZoomLevel.AUTO); + } + MapType mapType = drillMapPlot.getMapType() == MapType.POINT ? MapType.POINT : MapType.AREA; + int typeSize = mapTypeList.size(); + for (int j = typeSize; j < depth; j++) { + mapTypeList.add(mapType); + } + } + } + + public static TwoTuple getRootAndDepth(VanChartDrillMapPlot drillMapPlot) { + int depth = 1; + + DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(drillMapPlot.getGeoUrl()); + if (root != null) { + depth = root.getDepth() + 1;//根节点也算一层 + } + + return new TwoTuple<>(root, depth); + } + + private JPanel createContentPane(VanChartDrillMapPlot drillMapPlot) { + if (drillMapPlot == null) { + return new JPanel(); + } + + DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(drillMapPlot.getGeoUrl()); if (mapDataTree == null) { - mapDataTree = new MapDataTree(CompatibleGeoJSONTreeHelper.getRootNodeWithoutPara(oldGeoUrl)); + mapDataTree = new MapDataTree(root); mapDataTree.setRootVisible(true); + } else { + mapDataTree.changeRootNode(root); } + JPanel mapDataTreePanel = new JPanel(new BorderLayout()); mapDataTreePanel.add(mapDataTree); @@ -71,8 +110,8 @@ public class DrillMapLayerPane extends BasicScrollPane { double[] columnSize = {f}; double[] rowSize = {p, p}; Component[][] components = new Component[][]{ - new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)}, - new Component[]{createTitlePane(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane())} + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Layer_Tree"), mapDataTreePanel)}, + new Component[]{createTitlePane(Toolkit.i18nText("Fine-Design_Chart_Layer_Detail"), createLayerDetailPane(drillMapPlot))} }; JPanel contentPane = TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); @@ -88,7 +127,10 @@ public class DrillMapLayerPane extends BasicScrollPane { return jPanel; } - private JPanel createLayerDetailPane() { + private JPanel createLayerDetailPane(VanChartDrillMapPlot drillMapPlot) { + int depth = getRootAndDepth(drillMapPlot).getSecond(); + String[] items = TEMP.get(drillMapPlot.getMapType()); + double p = TableLayout.PREFERRED; double f = TableLayout.FILL; double[] columnSize = {f, p, p}; @@ -96,62 +138,31 @@ public class DrillMapLayerPane extends BasicScrollPane { detailComps = new Component[depth + 1][3]; rowSize[0] = p; detailComps[0] = new Component[]{ - new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Descriptor")), - new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), - new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Layer_Map_Type")) + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Descriptor")), + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Zoom_Layer")), + new UILabel(Toolkit.i18nText("Fine-Design_Chart_Layer_Map_Type")) }; for (int i = 0; i < depth; i++) { rowSize[i + 1] = p; int d = i + 1; - UILabel label = new UILabel(String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer"))); + UILabel label = new UILabel(String.format("%s%d%s", Toolkit.i18nText("Fine-Design_Chart_Index_Article"), d, Toolkit.i18nText("Fine-Design_Chart_Index_Layer"))); UIComboBox level = new UIComboBox(VanChartMapSourceChoosePane.ZOOM_LEVELS); level.setEnabled(i != 0); - UIComboBox type = new UIComboBox(TEMP.get(oldMapType)); + UIComboBox type = new UIComboBox(items); detailComps[i + 1] = new Component[]{label, level, type}; } return TableLayoutHelper.createGapTableLayoutPane(detailComps, rowSize, columnSize, 10, 6); } - /** - * Populate. - * - * @param ob - */ @Override - public void populateBean(ChartCollection ob) { - VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); + public void populateBean(VanChartDrillMapPlot drillMapPlot) { if (drillMapPlot != null) { java.util.List levelList = drillMapPlot.getLayerLevelList(); java.util.List mapTypeList = drillMapPlot.getLayerMapTypeList(); - if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) { - oldMapType = drillMapPlot.getMapType(); - oldGeoUrl = drillMapPlot.getGeoUrl(); - - DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(oldGeoUrl); - if (root != null) { - mapDataTree.changeRootNode(root); - depth = root.getDepth() + 1;//根节点也算一层 - } - - this.remove(leftcontentPane); - layoutContentPane(); - } - - //根据层级初始属性,一切以json那边读到的层级为准 - int levelSize = levelList.size(); - for (int i = levelSize; i < depth; i++) { - levelList.add(ZoomLevel.AUTO); - } - MapType mapType = drillMapPlot.getMapType() == MapType.POINT ? MapType.POINT : MapType.AREA; - int typeSize = mapTypeList.size(); - for (int j = typeSize; j < depth; j++) { - mapTypeList.add(mapType); - } - - for (int i = 0; i < depth; i++) { + for (int i = 0; i < levelList.size(); i++) { Component[] components = detailComps[i + 1]; if (components != null) { UIComboBox level = (UIComboBox) components[1]; @@ -171,13 +182,12 @@ public class DrillMapLayerPane extends BasicScrollPane { * Update. */ @Override - public ChartCollection updateBean() { + public VanChartDrillMapPlot updateBean() { return null; } @Override - public void updateBean(ChartCollection ob) { - VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); + public void updateBean(VanChartDrillMapPlot drillMapPlot) { if (drillMapPlot != null && detailComps != null) { java.util.List levelList = new ArrayList(); java.util.List mapTypeList = new ArrayList(); @@ -198,6 +208,6 @@ public class DrillMapLayerPane extends BasicScrollPane { @Override protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"); + return Toolkit.i18nText("Fine-Design_Chart_Map_Drill_Level"); } } diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java new file mode 100644 index 0000000000..39e7d94515 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java @@ -0,0 +1,128 @@ +package com.fr.design.chartx.data.drillMap; + +import com.fr.chartx.data.AbstractDataDefinition; +import com.fr.chartx.data.DrillMapChartDataDefinition; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.dialog.BasicPane; +import com.fr.design.dialog.MultiTabPane; +import com.fr.design.i18n.Toolkit; +import com.fr.general.ComparatorUtils; +import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; +import com.fr.plugin.chart.type.MapType; + +import java.util.ArrayList; +import java.util.List; + +/** + * Created by Mitisky on 16/6/20. + * 各层级分别指定的界面 + */ +public class EachLayerDataDefinitionPane extends MultiTabPane { + + private List oldTypeList; + private VanChartDrillMapPlot plot; + + public EachLayerDataDefinitionPane(VanChartDrillMapPlot drillMapPlot) { + this.plot = drillMapPlot; + initComps(); + } + + private void initComps() { + paneList = initPaneList(this.plot); + super.relayoutWhenListChange(); + } + + public void fireMapTypeChanged() { + if (!ComparatorUtils.equals(plot.getLayerMapTypeList(), oldTypeList)) { + initComps(); + } + } + + protected List initPaneList(VanChartDrillMapPlot drillMapPlot) { + List paneList = new ArrayList(); + + oldTypeList = drillMapPlot.getLayerMapTypeList(); + int depth = DrillMapLayerPane.getRootAndDepth(drillMapPlot).getSecond(); + + for (int i = 0; i < depth; i++) { + final String title = String.format("%s%d%s", Toolkit.i18nText("Fine-Design_Chart_Index_Article"), i, Toolkit.i18nText("Fine-Design_Chart_Index_Layer")); + MapType mapType = oldTypeList.get(i); + + SingleDataPane pane = mapType == MapType.AREA ? new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()) { + @Override + protected String title4PopupWindow() { + return title; + } + } : new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()) { + @Override + protected String title4PopupWindow() { + return title; + } + }; + + paneList.add(pane); + } + + return paneList; + } + + @Override + public void relayoutWhenListChange() { + } + + @Override + protected List initPaneList() { + return new ArrayList(); + } + + @Override + public void populateBean(DrillMapChartDataDefinition drillMapChartDataDefinition) { + List eachLayerDataDefinitionList = drillMapChartDataDefinition.getEachLayerDataDefinitionList(); + + if (eachLayerDataDefinitionList == null || eachLayerDataDefinitionList.size() == 0) { + return; + } + + for (int i = 0, len = paneList.size(); i < len; i++) { + BasicPane basicPane = paneList.get(i); + if (basicPane instanceof SingleDataPane) { + ((SingleDataPane) basicPane).populateBean(eachLayerDataDefinitionList.get(i)); + } + } + } + + @Override + public DrillMapChartDataDefinition updateBean() { + return null; + } + + @Override + public void updateBean(DrillMapChartDataDefinition drillMapDefinition) { + List eachLayerDataDefinitionList = new ArrayList(); + for (BasicPane basicPane : paneList) { + if (basicPane instanceof SingleDataPane) { + eachLayerDataDefinitionList.add(((SingleDataPane) basicPane).updateBean()); + } + } + drillMapDefinition.setEachLayerDataDefinitionList(eachLayerDataDefinitionList); + } + + @Override + public boolean accept(Object ob) { + return false; + } + + @Override + public String title4PopupWindow() { + return Toolkit.i18nText("Fine-Design_Chart_Each_Layer_Data_Special"); + } + + @Override + public void reset() { + } + +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java new file mode 100644 index 0000000000..384c3cb8f2 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java @@ -0,0 +1,111 @@ +package com.fr.design.chartx.data.map; + +import com.fr.design.gui.ibutton.UIButtonGroup; +import com.fr.design.gui.ilable.UILabel; +import com.fr.design.i18n.Toolkit; +import com.fr.design.layout.TableLayout; +import com.fr.design.layout.TableLayoutHelper; +import com.fr.design.mainframe.chart.gui.ChartDataPane; + +import javax.swing.JComponent; +import javax.swing.JPanel; +import javax.swing.SwingConstants; +import javax.swing.event.ChangeEvent; +import javax.swing.event.ChangeListener; +import java.awt.BorderLayout; +import java.awt.CardLayout; +import java.awt.Component; +import java.awt.Dimension; +import java.util.Arrays; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public abstract class AbstractAreaLngLatPane extends JPanel { + private JPanel centerPane; + private UIButtonGroup locationType; + + private JPanel areaPane; + private JPanel lngLatAreaPane; + + protected abstract JPanel createAreaPane(); + + protected abstract JPanel createAreaLngLatPane(); + + public AbstractAreaLngLatPane() { + centerPane = new JPanel(new CardLayout()) { + @Override + public Dimension getPreferredSize() { + if (locationType.getSelectedIndex() == 0) { + return areaPane.getPreferredSize(); + } else { + return lngLatAreaPane.getPreferredSize(); + } + } + }; + + locationType = new UIButtonGroup(new String[]{Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")}); + locationType.addChangeListener(new ChangeListener() { + @Override + public void stateChanged(ChangeEvent e) { + checkCenterPane(); + } + }); + + lngLatAreaPane = createAreaLngLatPane(); + areaPane = createAreaPane(); + + centerPane.add(areaPane, "area"); + centerPane.add(lngLatAreaPane, "longLat"); + + locationType.setSelectedIndex(0); + + this.setLayout(new BorderLayout(0, 6)); + this.add(locationType, BorderLayout.NORTH); + this.add(centerPane, BorderLayout.CENTER); + } + + private void checkCenterPane() { + CardLayout cardLayout = (CardLayout) centerPane.getLayout(); + if (locationType.getSelectedIndex() == 0) { + cardLayout.show(centerPane, "area"); + } else { + cardLayout.show(centerPane, "longLat"); + } + } + + public void populate(boolean useAreaName) { + locationType.setSelectedIndex(useAreaName ? 0 : 1); + + checkCenterPane(); + } + + public boolean update() { + return locationType.getSelectedIndex() == 0; + } + + protected JPanel createPane(String[] labels, JComponent... fieldComponents) { + + int len = Math.min(labels.length, fieldComponents.length); + + if (len == 0) { + return new JPanel(); + } + + Component[][] components = new Component[len][2]; + for (int i = 0; i < len; i++) { + components[i] = new Component[]{new UILabel(labels[i], SwingConstants.LEFT), fieldComponents[i]}; + } + double p = TableLayout.PREFERRED; + double[] columnSize = {ChartDataPane.LABEL_WIDTH, 122}; + double[] rowSize = new double[len]; + Arrays.fill(rowSize, p); + + return TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, 0, 6); + } + +} + diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java new file mode 100644 index 0000000000..13a271e813 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java @@ -0,0 +1,106 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class LineMapAreaLngLatPaneWithComboBox extends LineMapAreaLngLatPaneWithTinyFormula { + private UIComboBox fromArea_tab0; + private UIComboBox toArea_tab0; + + private UIComboBox fromArea_tab1; + private UIComboBox fromLng_tab1; + private UIComboBox fromLat_tab1; + private UIComboBox toArea_tab1; + private UIComboBox toLng_tab1; + private UIComboBox toLat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (fromArea_tab0 == null) { + fromArea_tab0 = new UIComboBox(); + toArea_tab0 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")}, + fromArea_tab0, toArea_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (fromArea_tab1 == null) { + fromArea_tab1 = new UIComboBox(); + fromLng_tab1 = new UIComboBox(); + fromLat_tab1 = new UIComboBox(); + toArea_tab1 = new UIComboBox(); + toLng_tab1 = new UIComboBox(); + toLat_tab1 = new UIComboBox(); + } + return createPane( + new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Start_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_Start_Latitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Latitude")}, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1); + } + + protected void populateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.populateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void updateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.updateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void populateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.populateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractDataSetFieldsPane.populateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractDataSetFieldsPane.populateField(toLng_tab1, fieldCollection.getToLng()); + AbstractDataSetFieldsPane.populateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractDataSetFieldsPane.populateField(toLat_tab1, fieldCollection.getToLat()); + } + + protected void updateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractDataSetFieldsPane.updateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractDataSetFieldsPane.updateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractDataSetFieldsPane.updateField(toLng_tab1, fieldCollection.getToLng()); + AbstractDataSetFieldsPane.updateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractDataSetFieldsPane.updateField(toLat_tab1, fieldCollection.getToLat()); + } + + public UIComboBox[] allFieldComboBox() { + return new UIComboBox[]{ + fromArea_tab0, + toArea_tab0, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1 + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java new file mode 100644 index 0000000000..2fb37fee55 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java @@ -0,0 +1,113 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class LineMapAreaLngLatPaneWithTinyFormula extends AbstractAreaLngLatPane { + private TinyFormulaPane fromArea_tab0; + private TinyFormulaPane toArea_tab0; + + private TinyFormulaPane fromArea_tab1; + private TinyFormulaPane fromLng_tab1; + private TinyFormulaPane fromLat_tab1; + private TinyFormulaPane toArea_tab1; + private TinyFormulaPane toLng_tab1; + private TinyFormulaPane toLat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (fromArea_tab0 == null) { + fromArea_tab0 = new TinyFormulaPane(); + toArea_tab0 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")}, + fromArea_tab0, toArea_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (fromArea_tab1 == null) { + fromArea_tab1 = new TinyFormulaPane(); + fromLng_tab1 = new TinyFormulaPane(); + fromLat_tab1 = new TinyFormulaPane(); + toArea_tab1 = new TinyFormulaPane(); + toLng_tab1 = new TinyFormulaPane(); + toLat_tab1 = new TinyFormulaPane(); + } + return createPane( + new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_Start_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_Start_Latitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Area_Name"), + Toolkit.i18nText("Fine-Design_Chart_End_Longitude"), + Toolkit.i18nText("Fine-Design_Chart_End_Latitude")}, + fromArea_tab1, + fromLng_tab1, + fromLat_tab1, + toArea_tab1, + toLng_tab1, + toLat_tab1); + } + + protected void populateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.populateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void updateTab0(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(fromArea_tab0, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.updateField(toArea_tab0, fieldCollection.getToAreaName()); + } + + protected void populateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.populateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractCellDataFieldsPane.populateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractCellDataFieldsPane.populateField(toLng_tab1, fieldCollection.getToLng()); + AbstractCellDataFieldsPane.populateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractCellDataFieldsPane.populateField(toLat_tab1, fieldCollection.getToLat()); + } + + protected void updateTab1(LineMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(fromArea_tab1, fieldCollection.getFromAreaName()); + AbstractCellDataFieldsPane.updateField(toArea_tab1, fieldCollection.getToAreaName()); + AbstractCellDataFieldsPane.updateField(fromLng_tab1, fieldCollection.getFromLng()); + AbstractCellDataFieldsPane.updateField(toLng_tab1, fieldCollection.getToLng()); + AbstractCellDataFieldsPane.updateField(fromLat_tab1, fieldCollection.getFromLat()); + AbstractCellDataFieldsPane.updateField(toLat_tab1, fieldCollection.getToLat()); + } + + public void populate(LineMapColumnFieldCollection fieldCollection) { + super.populate(fieldCollection.isUseAreaName()); + if (fieldCollection.isUseAreaName()) { + populateTab0(fieldCollection); + } else { + populateTab1(fieldCollection); + } + } + + public void update(LineMapColumnFieldCollection fieldCollection) { + fieldCollection.setUseAreaName(super.update()); + if (fieldCollection.isUseAreaName()) { + updateTab0(fieldCollection); + } else { + updateTab1(fieldCollection); + } + } +} + diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java new file mode 100644 index 0000000000..a31f159024 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java @@ -0,0 +1,93 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.MapChartDataDefinition; +import com.fr.design.chartx.AbstractChartDataPane; +import com.fr.design.chartx.fields.diff.AreaMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.AreaMapDataSetFieldsPane; +import com.fr.design.chartx.fields.diff.LineMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.LineMapDataSetFieldsPane; +import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; +import com.fr.design.gui.frpane.AttributeChangeListener; +import com.fr.plugin.chart.map.VanChartMapPlot; +import com.fr.plugin.chart.type.MapType; +import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/12 + */ +public class MapChartDataPane extends AbstractChartDataPane { + + private SingleDataPane areaPane; + private SingleDataPane pointPane; + private SingleDataPane linePane; + + public MapChartDataPane(AttributeChangeListener listener) { + super(listener); + } + + @Override + protected JPanel createContentPane() { + MapType mapType = MapType.AREA; + if (this.getVanChart() != null) { + VanChartMapPlot mapPlot = this.getVanChart().getPlot(); + mapType = mapPlot == null ? mapType : mapPlot.getMapType(); + } + switch (mapType) { + case AREA: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + return areaPane; + case POINT: + pointPane = new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + return pointPane; + case LINE: + linePane = new SingleDataPane(new LineMapDataSetFieldsPane(), new LineMapCellDataFieldsPane()); + return linePane; + case CUSTOM: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + pointPane = new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + linePane = new SingleDataPane(new LineMapDataSetFieldsPane(), new LineMapCellDataFieldsPane()); + return new VanMapAreaPointAndLineGroupPane(areaPane, pointPane, linePane); + default: + areaPane = new SingleDataPane(new AreaMapDataSetFieldsPane(), new AreaMapCellDataFieldsPane()); + return areaPane; + } + } + + @Override + protected void populate(MapChartDataDefinition mapChartDataDefinition) { + if (mapChartDataDefinition == null) { + return; + } + if (areaPane != null) { + areaPane.populateBean(mapChartDataDefinition.getAreaMapDataDefinition()); + } + if (pointPane != null) { + pointPane.populateBean(mapChartDataDefinition.getPointMapDataDefinition()); + } + if (linePane != null) { + linePane.populateBean(mapChartDataDefinition.getLineMapDataDefinition()); + } + + } + + @Override + protected MapChartDataDefinition update() { + MapChartDataDefinition mapChartDataDefinition = new MapChartDataDefinition(); + if (areaPane != null) { + mapChartDataDefinition.setAreaMapDataDefinition(areaPane.updateBean()); + } + if (pointPane != null) { + mapChartDataDefinition.setPointMapDataDefinition(pointPane.updateBean()); + } + if (linePane != null) { + mapChartDataDefinition.setLineMapDataDefinition(linePane.updateBean()); + } + return mapChartDataDefinition; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java new file mode 100644 index 0000000000..4acc2611f0 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java @@ -0,0 +1,71 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractDataSetFieldsPane; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class PointMapAreaLngLatPaneWithComboBox extends PointMapAreaLngLatPaneWithTinyFormula { + private UIComboBox area_tab0; + + private UIComboBox area_tab1; + private UIComboBox lng_tab1; + private UIComboBox lat_tab1; + + @Override + protected JPanel createAreaPane() { + if (area_tab0 == null) { + area_tab0 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name")}, + area_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (area_tab1 == null) { + area_tab1 = new UIComboBox(); + lng_tab1 = new UIComboBox(); + lat_tab1 = new UIComboBox(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name"), Toolkit.i18nText("Fine-Design_Chart_Longitude"), Toolkit.i18nText("Fine-Design_Chart_Latitude")}, + area_tab1, lng_tab1, lat_tab1 + ); + } + + protected void populateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void updateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void populateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.populateField(area_tab1, fieldCollection.getAreaName()); + AbstractDataSetFieldsPane.populateField(lng_tab1, fieldCollection.getLng()); + AbstractDataSetFieldsPane.populateField(lat_tab1, fieldCollection.getLat()); + } + + protected void updateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractDataSetFieldsPane.updateField(area_tab1, fieldCollection.getAreaName()); + AbstractDataSetFieldsPane.updateField(lng_tab1, fieldCollection.getLng()); + AbstractDataSetFieldsPane.updateField(lat_tab1, fieldCollection.getLat()); + } + + public UIComboBox[] allFieldComboBox() { + return new UIComboBox[]{ + area_tab0, area_tab1, lng_tab1, lat_tab1 + }; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java new file mode 100644 index 0000000000..6da5a1b383 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java @@ -0,0 +1,84 @@ +package com.fr.design.chartx.data.map; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.fields.AbstractCellDataFieldsPane; +import com.fr.design.formula.TinyFormulaPane; +import com.fr.design.i18n.Toolkit; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/13 + */ +public class PointMapAreaLngLatPaneWithTinyFormula extends AbstractAreaLngLatPane { + private TinyFormulaPane area_tab0; + + private TinyFormulaPane area_tab1; + private TinyFormulaPane lng_tab1; + private TinyFormulaPane lat_tab1; + + + @Override + protected JPanel createAreaPane() { + if (area_tab0 == null) { + area_tab0 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name")}, + area_tab0 + ); + } + + @Override + protected JPanel createAreaLngLatPane() { + if (area_tab1 == null) { + area_tab1 = new TinyFormulaPane(); + lng_tab1 = new TinyFormulaPane(); + lat_tab1 = new TinyFormulaPane(); + } + return createPane( + new String[]{Toolkit.i18nText("Fine-Design_Chart_Area_Name"), Toolkit.i18nText("Fine-Design_Chart_Longitude"), Toolkit.i18nText("Fine-Design_Chart_Latitude")}, + area_tab1, lng_tab1, lat_tab1 + ); + } + + protected void populateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void updateTab0(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(area_tab0, fieldCollection.getAreaName()); + } + + protected void populateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.populateField(area_tab1, fieldCollection.getAreaName()); + AbstractCellDataFieldsPane.populateField(lng_tab1, fieldCollection.getLng()); + AbstractCellDataFieldsPane.populateField(lat_tab1, fieldCollection.getLat()); + } + + protected void updateTab1(PointMapColumnFieldCollection fieldCollection) { + AbstractCellDataFieldsPane.updateField(area_tab1, fieldCollection.getAreaName()); + AbstractCellDataFieldsPane.updateField(lng_tab1, fieldCollection.getLng()); + AbstractCellDataFieldsPane.updateField(lat_tab1, fieldCollection.getLat()); + } + + public void populate(PointMapColumnFieldCollection fieldCollection) { + super.populate(fieldCollection.isUseAreaName()); + if (fieldCollection.isUseAreaName()) { + populateTab0(fieldCollection); + } else { + populateTab1(fieldCollection); + } + } + + public void update(PointMapColumnFieldCollection fieldCollection) { + fieldCollection.setUseAreaName(super.update()); + if (fieldCollection.isUseAreaName()) { + updateTab0(fieldCollection); + } else { + updateTab1(fieldCollection); + } + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java index 1ad328f0fd..82cc89a62c 100644 --- a/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java @@ -17,10 +17,10 @@ import com.fr.stable.StringUtils; import javax.swing.BorderFactory; import javax.swing.JPanel; import javax.swing.SwingConstants; -import java.util.Arrays; -import java.util.List; import java.awt.BorderLayout; import java.awt.Component; +import java.util.Arrays; +import java.util.List; import static com.fr.design.mainframe.chart.gui.data.table.DataPaneHelper.refreshBoxItems; @@ -37,7 +37,7 @@ public abstract class AbstractDataSetFieldsPane { + private TinyFormulaPane areaName; + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name") + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[]{ + createAreaName() + }; + } + + private TinyFormulaPane createAreaName() { + if (areaName == null) { + areaName = new TinyFormulaPane(); + } + return areaName; + } + + @Override + public void populateBean(AreaMapColumnFieldCollection ob) { + populateField(areaName, ob.getAreaName()); + populateSeriesValuePane(ob); + } + + @Override + public AreaMapColumnFieldCollection updateBean() { + AreaMapColumnFieldCollection fieldCollection = new AreaMapColumnFieldCollection(); + updateField(areaName, fieldCollection.getAreaName()); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java new file mode 100644 index 0000000000..2d8bba01a1 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java @@ -0,0 +1,50 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.AreaMapColumnFieldCollection; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.design.i18n.Toolkit; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/7 + */ +public class AreaMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + + private UIComboBox areaName; + + @Override + protected String[] fieldLabels() { + return new String[]{ + Toolkit.i18nText("Fine-Design_Chart_Area_Name") + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + return new UIComboBox[]{ + createAreaName() + }; + } + + private UIComboBox createAreaName() { + if (areaName == null) { + areaName = new UIComboBox(); + } + return areaName; + } + + @Override + public void populateBean(AreaMapColumnFieldCollection ob) { + populateField(areaName, ob.getAreaName()); + populateSeriesValuePane(ob); + } + + @Override + public AreaMapColumnFieldCollection updateBean() { + AreaMapColumnFieldCollection fieldCollection = new AreaMapColumnFieldCollection(); + updateField(areaName, fieldCollection.getAreaName()); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java new file mode 100644 index 0000000000..7a321f0bec --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java @@ -0,0 +1,64 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.data.map.LineMapAreaLngLatPaneWithTinyFormula; +import com.fr.design.formula.TinyFormulaPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/11 + */ +public class LineMapCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane { + + private LineMapAreaLngLatPaneWithTinyFormula areaLngLatPane; + + private TinyFormulaPane lineName; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new LineMapAreaLngLatPaneWithTinyFormula(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "lineName" + }; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + if (lineName == null) { + lineName = new TinyFormulaPane(); + } + return new TinyFormulaPane[]{ + lineName + }; + } + + @Override + public void populateBean(LineMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + + populateField(lineName, ob.getLineName()); + + populateSeriesValuePane(ob); + } + + @Override + public LineMapColumnFieldCollection updateBean() { + LineMapColumnFieldCollection fieldCollection = new LineMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + + updateField(lineName, fieldCollection.getLineName()); + + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java new file mode 100644 index 0000000000..24220b9930 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java @@ -0,0 +1,61 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.LineMapColumnFieldCollection; +import com.fr.design.chartx.data.map.LineMapAreaLngLatPaneWithComboBox; +import com.fr.design.gui.icombobox.UIComboBox; +import com.fr.third.jodd.util.ArraysUtil; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/11 + */ +public class LineMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + private LineMapAreaLngLatPaneWithComboBox areaLngLatPane; + + private UIComboBox lineName; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new LineMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[]{ + "lineName" + }; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + if (lineName == null) { + lineName = new UIComboBox(); + } + UIComboBox[] result = areaLngLatPane.allFieldComboBox(); + return ArraysUtil.join(new UIComboBox[]{ + lineName + }, result); + } + + @Override + public void populateBean(LineMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateField(lineName, ob.getLineName()); + populateSeriesValuePane(ob); + } + + @Override + public LineMapColumnFieldCollection updateBean() { + LineMapColumnFieldCollection columnFieldCollection = new LineMapColumnFieldCollection(); + areaLngLatPane.update(columnFieldCollection); + updateField(lineName, columnFieldCollection.getLineName()); + updateSeriesValuePane(columnFieldCollection); + return columnFieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java new file mode 100644 index 0000000000..4b701fb714 --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java @@ -0,0 +1,48 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.data.map.PointMapAreaLngLatPaneWithTinyFormula; +import com.fr.design.formula.TinyFormulaPane; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/8 + */ +public class PointMapCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane { + private PointMapAreaLngLatPaneWithTinyFormula areaLngLatPane; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithTinyFormula(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected TinyFormulaPane[] formulaPanes() { + return new TinyFormulaPane[0]; + } + + @Override + public void populateBean(PointMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateSeriesValuePane(ob); + } + + @Override + public PointMapColumnFieldCollection updateBean() { + PointMapColumnFieldCollection fieldCollection = new PointMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java new file mode 100644 index 0000000000..1771637abb --- /dev/null +++ b/designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java @@ -0,0 +1,51 @@ +package com.fr.design.chartx.fields.diff; + +import com.fr.chartx.data.field.diff.PointMapColumnFieldCollection; +import com.fr.design.chartx.data.map.PointMapAreaLngLatPaneWithComboBox; +import com.fr.design.gui.icombobox.UIComboBox; + +import javax.swing.JPanel; + +/** + * @author shine + * @version 10.0 + * Created by shine on 2019/11/8 + */ +public class PointMapDataSetFieldsPane extends AbstractDataSetFieldsWithSeriesValuePane { + private PointMapAreaLngLatPaneWithComboBox areaLngLatPane; + + @Override + protected JPanel createNorthPane() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane; + } + + @Override + protected String[] fieldLabels() { + return new String[0]; + } + + @Override + protected UIComboBox[] filedComboBoxes() { + if (areaLngLatPane == null) { + areaLngLatPane = new PointMapAreaLngLatPaneWithComboBox(); + } + return areaLngLatPane.allFieldComboBox(); + } + + @Override + public void populateBean(PointMapColumnFieldCollection ob) { + areaLngLatPane.populate(ob); + populateSeriesValuePane(ob); + } + + @Override + public PointMapColumnFieldCollection updateBean() { + PointMapColumnFieldCollection fieldCollection = new PointMapColumnFieldCollection(); + areaLngLatPane.update(fieldCollection); + updateSeriesValuePane(fieldCollection); + return fieldCollection; + } +} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java similarity index 89% rename from designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java index f74706b9ad..08ec91b22e 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java @@ -1,5 +1,6 @@ package com.fr.van.chart.drillmap; +import com.fr.design.chartx.data.drillMap.DrillMapChartDataPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; @@ -7,16 +8,15 @@ import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.drillmap.designer.data.VanChartDrillMapDataPane; import com.fr.van.chart.drillmap.designer.other.VanChartDrillMapOtherPane; import com.fr.van.chart.drillmap.designer.type.VanChartDrillMapPlotPane; -import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.map.designer.style.VanChartMapStylePane; /** * Created by Mitisky on 16/6/20. */ -public class DrillMapIndependentVanChartInterface extends MapIndependentVanChartInterface { +public class VanDrillMapChartTypeUI extends VanMapChartTypeUI { @Override public String getName() { return Toolkit.i18nText("Fine-Design_Chart_Drill_Map"); @@ -61,7 +61,7 @@ public class DrillMapIndependentVanChartInterface extends MapIndependentVanChart @Override public ChartDataPane getChartDataPane(AttributeChangeListener listener) { - return new VanChartDrillMapDataPane(listener); + return new DrillMapChartDataPane(listener); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java deleted file mode 100644 index 1ce0dc300d..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.DataContentsPane; - -import javax.swing.JPanel; - -/** - * Created by Mitisky on 16/6/20. - */ -public class VanChartDrillMapContentsPane extends DataContentsPane { - - private VanChartMapLayerAndDataTabPane layerAndDataTabPane; - - private AttributeChangeListener listener; - private ChartDataPane parent; - - public VanChartDrillMapContentsPane(AttributeChangeListener listener, ChartDataPane parent) { - this.listener = listener; - this.parent = parent; - initAll(); - } - - /** - * 设置是否关联单元格数据. - * - * @param supportCellData - */ - @Override - public void setSupportCellData(boolean supportCellData) { - layerAndDataTabPane.setSupportCellData(supportCellData); - } - - @Override - public void populate(ChartCollection collection) { - layerAndDataTabPane.populateBean(collection); - } - - @Override - public void update(ChartCollection collection) { - layerAndDataTabPane.updateBean(collection); - - } - - @Override - protected JPanel createContentPane() { - layerAndDataTabPane = new VanChartMapLayerAndDataTabPane(this.listener, this.parent); - return layerAndDataTabPane; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java deleted file mode 100644 index d4543c8a8a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java +++ /dev/null @@ -1,39 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; - -import javax.swing.JPanel; -import java.awt.BorderLayout; - -/** - * Created by Mitisky on 16/6/20. - */ -public class VanChartDrillMapDataPane extends ChartDataPane{ - - public VanChartDrillMapDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected JPanel createContentPane() { - contentsPane = new VanChartDrillMapContentsPane(listener, VanChartDrillMapDataPane.this); - return contentsPane; - } - - //编辑内置数据集会stateChange,会调用这里 - @Override - protected void repeatLayout(ChartCollection collection) { - if(contentsPane != null) { - this.remove(contentsPane); - } - this.setLayout(new BorderLayout(0, 0)); - - contentsPane = new VanChartDrillMapContentsPane(listener, VanChartDrillMapDataPane.this); - contentsPane.setSupportCellData(isSupportCellData()); - - this.add(contentsPane, BorderLayout.CENTER); - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java deleted file mode 100644 index bbb07acd69..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java +++ /dev/null @@ -1,130 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.MultiTabPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.general.ComparatorUtils; -import com.fr.van.chart.drillmap.designer.data.comp.DrillMapDataPane; -import com.fr.van.chart.drillmap.designer.data.comp.DrillMapLayerPane; -import com.fr.van.chart.map.designer.data.MapDataPaneHelper; - -import java.awt.CardLayout; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Mitisky on 16/6/20. - * 钻取层级和数据界面切换的界面 - */ -public class VanChartMapLayerAndDataTabPane extends MultiTabPane { - - private DrillMapLayerPane layerPane; - private DrillMapDataPane dataPane; - - private ChartCollection chartCollection; - - public VanChartMapLayerAndDataTabPane(AttributeChangeListener listener, ChartDataPane parent) { - cardLayout = new CardLayout(); - layerPane = new DrillMapLayerPane(); - dataPane = new DrillMapDataPane(listener, parent); - paneList = initPaneList(); - initComponents(); - } - - private void initComponents(){ - super.relayoutWhenListChange(); - } - - protected void tabChanged() { - if(getSelectedIndex() == 0){ - return; - } - if(chartCollection == null){ - return; - } - if(!ComparatorUtils.equals(MapDataPaneHelper.getDrillMapLayerMapTypeList(chartCollection), dataPane.getCurrentMapTypeList())){ - dataPane.populateBean(chartCollection); - } - } - - /** - * 当List中的界面变化时, 重新布局 - */ - public void relayoutWhenListChange() { - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - if(layerPane != null) { - paneList.add(layerPane); - } - if(dataPane != null) { - paneList.add(dataPane); - } - - return paneList; - } - - @Override - public void populateBean(ChartCollection ob) { - chartCollection = ob; - layerPane.populateBean(ob); - dataPane.populateBean(ob); - } - - /** - * Update. - */ - @Override - public ChartCollection updateBean() { - return null; - } - - @Override - public void updateBean(ChartCollection ob) { - layerPane.updateBean(ob); - dataPane.updateBean(ob); - } - - /** - * 设置是否关联单元格数据. - * - * @param supportCellData - */ - public void setSupportCellData(boolean supportCellData) { - dataPane.setSupportCellData(supportCellData); - } - - /** - * 是否是指定类型 - * - * @param ob 对象 - * @return 是否是指定类型 - */ - @Override - public boolean accept(Object ob) { - return false; - } - - /** - * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 - * - * @return 绥化狂标题 - */ - @Override - public String title4PopupWindow() { - return null; - } - - /** - * 重置 - */ - @Override - public void reset() { - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java deleted file mode 100644 index 4f5ab5e21d..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java +++ /dev/null @@ -1,117 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data.comp; - -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.gui.frpane.UIComboBoxPane; -import com.fr.design.mainframe.chart.gui.ChartDataPane; - -import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; -import com.fr.plugin.chart.type.MapType; -import com.fr.van.chart.map.designer.data.MapDataPaneHelper; - -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Mitisky on 16/6/20. - * 钻取地图数据配置界面中 和钻取层级平级的数据界面 - */ -public class DrillMapDataPane extends BasicBeanPane { - private UIComboBoxPane dataDefinitionType;//数据定义方式:底层数据汇总/各层级分别指定 - - private SingleLayerDataDefinitionPane bottomDataDefinitionPane;//底层数据汇总方式定义钻取地图数据 - private EachLayerDataDefinitionPane eachLayerDataDefinitionPane;//各层级分别指定 - - private ChartDataPane parent; - - public DrillMapDataPane(final AttributeChangeListener listener,final ChartDataPane parent) { - this.parent = parent; - bottomDataDefinitionPane = new SingleLayerDataDefinitionPane(listener, parent); - eachLayerDataDefinitionPane = new EachLayerDataDefinitionPane(listener, parent); - - dataDefinitionType = new UIComboBoxPane() { - @Override - protected List> initPaneList() { - - List> paneList = new ArrayList>(); - paneList.add(bottomDataDefinitionPane); - paneList.add(eachLayerDataDefinitionPane); - return paneList; - } - - @Override - protected String title4PopupWindow() { - return null; - } - }; - - this.setLayout(new BorderLayout()); - this.add(dataDefinitionType, BorderLayout.CENTER); - } - - public List getCurrentMapTypeList() { - return eachLayerDataDefinitionPane.getCurrentMapTypeList(); - } - - /** - * 设置是否关联单元格数据. - * - * @param supportCellData - */ - public void setSupportCellData(boolean supportCellData) { - bottomDataDefinitionPane.setSupportCellData(supportCellData); - eachLayerDataDefinitionPane.setSupportCellData(supportCellData); - } - - /** - * Populate. - * - * @param ob - */ - @Override - public void populateBean(ChartCollection ob) { - - dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1); - - ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob); - bottomDataDefinitionPane.populateBean(bottomDataChartCollection); - eachLayerDataDefinitionPane.populateBean(ob); - - parent.initAllListeners(); - } - - /** - * Update. - */ - @Override - public ChartCollection updateBean() { - return null; - } - - @Override - public void updateBean(ChartCollection ob) { - DrillMapDefinition drillMapDefinition = MapDataPaneHelper.getDrillMapDefinition(ob); - if(drillMapDefinition == null){ - drillMapDefinition = new DrillMapDefinition(); - ob.getSelectedChart().setFilterDefinition(drillMapDefinition); - } - if(dataDefinitionType.getSelectedIndex() == 0){ - drillMapDefinition.setFromBottomData(true); - ChartCollection temp = new ChartCollection(new Chart()); - bottomDataDefinitionPane.updateBean(temp); - drillMapDefinition.setBottomDataDefinition(temp.getSelectedChart().getFilterDefinition()); - } else { - drillMapDefinition.setFromBottomData(false); - eachLayerDataDefinitionPane.updateBean(ob); - } - } - - @Override - protected String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Use_Data"); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java deleted file mode 100644 index 3a688dcfb7..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data.comp; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.dialog.BasicPane; -import com.fr.design.dialog.MultiTabPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.general.ComparatorUtils; - -import com.fr.plugin.chart.drillmap.DrillMapHelper; -import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; -import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; -import com.fr.plugin.chart.type.MapType; -import com.fr.van.chart.map.designer.data.MapDataPaneHelper; - -import javax.swing.tree.DefaultMutableTreeNode; -import java.awt.*; -import java.util.ArrayList; -import java.util.List; - -/** - * Created by Mitisky on 16/6/20. - * 各层级分别指定的界面 - */ -public class EachLayerDataDefinitionPane extends MultiTabPane { - private AttributeChangeListener listener; - private ChartDataPane parent; - private int depth; - private String oldGeoUrl; - private List oldMapList; - - public EachLayerDataDefinitionPane(AttributeChangeListener listener, ChartDataPane parent) { - this.listener = listener; - this.parent = parent; - cardLayout = new CardLayout(); - } - - private void initComponents(){ - super.relayoutWhenListChange(); - } - - /** - * 当List中的界面变化时, 重新布局 - */ - public void relayoutWhenListChange() { - } - - public List getCurrentMapTypeList() { - return oldMapList; - } - - @Override - protected List initPaneList() { - List paneList = new ArrayList(); - - for(int i = 1; i < depth + 1; i++){ - String tile = String.format("%s%d%s", com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Article"), i, com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Index_Layer")); - - SingleLayerDataDefinitionPane pane = new SingleLayerDataDefinitionPane(tile, this.listener, this.parent); - pane.setSupportCellData(parent.isSupportCellData()); - paneList.add(pane); - } - - return paneList; - } - - @Override - public void populateBean(ChartCollection ob) { - VanChartDrillMapPlot drillMapPlot = DrillMapHelper.getDrillMapPlot(ob); - if(drillMapPlot == null){ - return; - } - if(!ComparatorUtils.equals(oldGeoUrl, drillMapPlot.getGeoUrl())) { - oldGeoUrl = drillMapPlot.getGeoUrl(); - DefaultMutableTreeNode root = CompatibleGeoJSONTreeHelper.getNodeByJSONPath(oldGeoUrl); - if (root == null) { - return; - } - - depth = root.getDepth() + 1;//根节点也算一层 - paneList = initPaneList(); - this.removeAll(); - initComponents(); - } - - oldMapList = drillMapPlot.getLayerMapTypeList(); - populatePaneList(ob); - } - - private void populatePaneList(ChartCollection chartCollection){ - for(int i = 0, len = paneList.size(); i < len; i++){ - BasicPane basicPane = paneList.get(i); - MapType mapType = oldMapList.get(i); - if(basicPane instanceof SingleLayerDataDefinitionPane){ - ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType); - ((SingleLayerDataDefinitionPane) basicPane).populateBean(clone); - } - } - } - - /** - * Update. - */ - @Override - public ChartCollection updateBean() { - return null; - } - - @Override - public void updateBean(ChartCollection ob) { - DrillMapDefinition drillMapDefinition = MapDataPaneHelper.getDrillMapDefinition(ob); - List eachLayerDataDefinitionList = new ArrayList(); - for(BasicPane basicPane : paneList){ - if(basicPane instanceof SingleLayerDataDefinitionPane){ - ChartCollection temp = new ChartCollection(new Chart()); - ((SingleLayerDataDefinitionPane) basicPane).updateBean(temp); - eachLayerDataDefinitionList.add(temp.getSelectedChart().getFilterDefinition()); - } - } - drillMapDefinition.setEachLayerDataDefinitionList(eachLayerDataDefinitionList); - } - - /** - * 是否是指定类型 - * - * @param ob 对象 - * @return 是否是指定类型 - */ - @Override - public boolean accept(Object ob) { - return false; - } - - /** - * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 - * - * @return 绥化狂标题 - */ - @Override - public String title4PopupWindow() { - return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Each_Layer_Data_Special"); - } - - /** - * 重置 - */ - @Override - public void reset() { - - } - - - /** - * 设置是否关联单元格数据. - * - * @param supportCellData - */ - public void setSupportCellData(boolean supportCellData) { - if(paneList == null){ - return; - } - for(BasicPane basicPane : paneList){ - if(basicPane instanceof SingleLayerDataDefinitionPane){ - ((SingleLayerDataDefinitionPane) basicPane).setSupportCellData(supportCellData); - } - } - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java b/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java deleted file mode 100644 index 5ec0e1f4a4..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java +++ /dev/null @@ -1,94 +0,0 @@ -package com.fr.van.chart.drillmap.designer.data.comp; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.beans.FurtherBasicBeanPane; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; - - -import java.awt.BorderLayout; - -/** - * Created by Mitisky on 16/6/21. - * 各层级分别指定中 单层区域地图数据配置 以及 底层数据汇总方式的界面 - */ -public class SingleLayerDataDefinitionPane extends FurtherBasicBeanPane { - private String title; - private NormalChartDataPane normalChartDataPane; - - //底层数据汇总 - public SingleLayerDataDefinitionPane(AttributeChangeListener listener, ChartDataPane parent) { - this(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Bottom_Data_Sum"), listener, parent); - } - - public SingleLayerDataDefinitionPane(String title, AttributeChangeListener listener, ChartDataPane parent) { - this.title = title; - normalChartDataPane = new NormalChartDataPane(listener, parent); - - this.setLayout(new BorderLayout()); - this.add(normalChartDataPane, BorderLayout.CENTER); - } - - /** - * 设置是否关联单元格数据. - * - * @param supportCellData - */ - public void setSupportCellData(boolean supportCellData) { - normalChartDataPane.setSupportCellData(supportCellData); - } - - /** - * 是否是指定类型 - * - * @param ob 对象 - * @return 是否是指定类型 - */ - @Override - public boolean accept(Object ob) { - return false; - } - - /** - * title应该是一个属性,不只是对话框的标题时用到,与其他组件结合时,也会用得到 - * - * @return 绥化狂标题 - */ - @Override - public String title4PopupWindow() { - return title; - } - - /** - * 重置 - */ - @Override - public void reset() { - - } - - /** - * Populate. - * - * @param ob - */ - @Override - public void populateBean(ChartCollection ob) { - normalChartDataPane.populate(ob); - - } - - @Override - public void updateBean(ChartCollection ob) { - normalChartDataPane.update(ob); - } - - /** - * Update. - */ - @Override - public ChartCollection updateBean() { - return null; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java similarity index 78% rename from designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java index 16f9fbc9fa..90926a106b 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java @@ -3,10 +3,15 @@ package com.fr.van.chart.heatmap.designer; import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chartx.AbstractVanSingleDataPane; +import com.fr.design.chartx.fields.diff.PointMapCellDataFieldsPane; +import com.fr.design.chartx.fields.diff.PointMapDataSetFieldsPane; +import com.fr.design.chartx.single.SingleDataPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; +import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; import com.fr.van.chart.designer.other.VanChartInteractivePaneWithMapZoom; @@ -15,13 +20,13 @@ import com.fr.van.chart.designer.style.VanChartStylePane; import com.fr.van.chart.heatmap.designer.other.VanChartHeatMapConditionPane; import com.fr.van.chart.heatmap.designer.style.VanChartHeatMapSeriesPane; import com.fr.van.chart.heatmap.designer.type.VanChartHeatMapTypePane; -import com.fr.van.chart.map.MapIndependentVanChartInterface; +import com.fr.van.chart.map.VanMapChartTypeUI; import com.fr.van.chart.map.designer.style.VanChartMapStylePane; /** * Created by Mitisky on 16/10/20. */ -public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartInterface { +public class VanHeatMapChartTypeUI extends VanMapChartTypeUI { /** * 图标路径 @@ -57,8 +62,13 @@ public class HeatMapIndependentVanChartInterface extends MapIndependentVanChartI } @Override - protected boolean areaPlot(Plot plot) { - return false; + public ChartDataPane getChartDataPane(AttributeChangeListener listener) { + return new AbstractVanSingleDataPane(listener) { + @Override + protected SingleDataPane createSingleDataPane() { + return new SingleDataPane(new PointMapDataSetFieldsPane(), new PointMapCellDataFieldsPane()); + } + }; } public BasicBeanPane getPlotSeriesPane(ChartStylePane parent, Plot plot) { diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java similarity index 59% rename from designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java rename to designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java index 76deff2d3f..2981e6e4ee 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java @@ -2,26 +2,16 @@ package com.fr.van.chart.map; import com.fr.chart.chartattr.Plot; import com.fr.design.beans.BasicBeanPane; +import com.fr.design.chartx.data.map.MapChartDataPane; import com.fr.design.condition.ConditionAttributesPane; import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.i18n.Toolkit; import com.fr.design.mainframe.chart.AbstractChartAttrPane; import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartStylePane; -import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.type.AbstractChartTypePane; -import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.type.MapType; import com.fr.van.chart.designer.other.VanChartOtherPane; import com.fr.van.chart.designer.style.VanChartStylePane; -import com.fr.van.chart.map.designer.data.VanChartMapDataPane; -import com.fr.van.chart.map.designer.data.contentpane.report.VanAreaMapPlotReportDataContentPane; -import com.fr.van.chart.map.designer.data.contentpane.report.VanLineMapPlotReportDataContentPane; -import com.fr.van.chart.map.designer.data.contentpane.report.VanPointMapPlotReportDataContentPane; -import com.fr.van.chart.map.designer.data.contentpane.table.VanAreaMapPlotTableDataContentPane; -import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane; -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.other.VanChartMapOtherPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane; import com.fr.van.chart.map.designer.style.VanChartMapStylePane; @@ -31,7 +21,7 @@ import com.fr.van.chart.vanchart.AbstractIndependentVanChartUI; /** * Created by Mitisky on 16/5/4. */ -public class MapIndependentVanChartInterface extends AbstractIndependentVanChartUI { +public class VanMapChartTypeUI extends AbstractIndependentVanChartUI { @Override public String getName() { @@ -70,28 +60,8 @@ public class MapIndependentVanChartInterface extends AbstractIndependentVanChart return new VanChartMapPlotPane(); } - public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent){ - return areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent) - : linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent) - : new VanPointMapPlotTableDataContentPane(parent); - } - - public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent){ - return areaPlot(plot) ? new VanAreaMapPlotReportDataContentPane(parent) - : linePlot(plot) ? new VanLineMapPlotReportDataContentPane(parent) - : new VanPointMapPlotReportDataContentPane(parent); - } - public ChartDataPane getChartDataPane(AttributeChangeListener listener){ - return new VanChartMapDataPane(listener); - } - - protected boolean areaPlot(Plot plot){ - return plot != null && plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getMapType() == MapType.AREA; - } - - protected boolean linePlot(Plot plot){ - return plot != null && plot instanceof VanChartMapPlot && ((VanChartMapPlot) plot).getMapType() == MapType.LINE; + return new MapChartDataPane(listener); } /** diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java index d086a70314..bc84b001d9 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java @@ -35,6 +35,7 @@ public abstract class VanChartGroupPane extends JPanel{ @Override public void stateChanged(ChangeEvent e) { cardLayout.show(centerPane, nameList[buttonGroup.getSelectedIndex()]); + tabChanged(buttonGroup.getSelectedIndex()); } }); buttonGroup.setBorder(getButtonGroupBorder()); @@ -43,6 +44,9 @@ public abstract class VanChartGroupPane extends JPanel{ this.add(centerPane, BorderLayout.CENTER); } + protected void tabChanged(int index) { + } + protected Border getButtonGroupBorder () { return null; } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java deleted file mode 100644 index 4cfb35d704..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java +++ /dev/null @@ -1,84 +0,0 @@ -package com.fr.van.chart.map.designer.data; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.DataContentsPane; -import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; -import com.fr.van.chart.map.designer.VanMapAreaPointAndLineGroupPane; - -import javax.swing.JPanel; - -/** - * Created by Mitisky on 16/5/17. - */ -public class CustomMapChartDataContentsPane extends DataContentsPane{ - private NormalChartDataPane areaMapChartDataPane; - private NormalChartDataPane pointMapChartDataPane; - private NormalChartDataPane lineMapChartDataPane; - - private AttributeChangeListener listener; - private ChartDataPane parent; - - public CustomMapChartDataContentsPane(AttributeChangeListener listener, ChartDataPane parent) { - this.listener = listener; - this.parent = parent; - initAll(); - } - - @Override - public void setSupportCellData(boolean supportCellData) { - areaMapChartDataPane.setSupportCellData(supportCellData); - pointMapChartDataPane.setSupportCellData(supportCellData); - lineMapChartDataPane.setSupportCellData(supportCellData); - } - - @Override - public void populate(ChartCollection collection) { - populateAreaMap(collection); - populatePointMap(collection); - populateLineMap(collection); - } - - @Override - public void update(ChartCollection collection) { - updatePointMap(collection); - updateAreaMap(collection); - updateLineMap(collection); - } - - public void populatePointMap(ChartCollection collection) { - pointMapChartDataPane.populate(collection); - } - - public void populateLineMap(ChartCollection collection) { - lineMapChartDataPane.populate(collection); - } - - public void updatePointMap(ChartCollection collection) { - pointMapChartDataPane.update(collection); - } - - public void populateAreaMap(ChartCollection collection) { - areaMapChartDataPane.populate(collection); - } - - public void updateAreaMap(ChartCollection collection) { - areaMapChartDataPane.update(collection); - } - - public void updateLineMap(ChartCollection collection) { - lineMapChartDataPane.update(collection); - } - - @Override - protected JPanel createContentPane() { - areaMapChartDataPane = new NormalChartDataPane(listener, parent); - pointMapChartDataPane = new NormalChartDataPane(listener, parent); - lineMapChartDataPane = new NormalChartDataPane(listener, parent); - - return new VanMapAreaPointAndLineGroupPane(areaMapChartDataPane, pointMapChartDataPane, lineMapChartDataPane); - } - - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java deleted file mode 100644 index 158f9dbf1b..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.fr.van.chart.map.designer.data; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.Chart; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartattr.Plot; -import com.fr.log.FineLoggerFactory; -import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; -import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; -import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.map.data.VanMapDefinition; -import com.fr.plugin.chart.type.MapType; - -import java.util.List; - -/** - * Created by shine on 2017/8/8. - */ -public class MapDataPaneHelper { - public static ChartCollection getPointMapChartCollection(ChartCollection chartCollection) { - try{ - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - Chart chart = cloneCollection.getSelectedChart(); - - TopDefinitionProvider definition = chart.getFilterDefinition(); - if(definition != null && definition instanceof VanMapDefinition) { - chart.setFilterDefinition(((VanMapDefinition) definition).getPointDefinition()); - } - - Plot plot = chart.getPlot(); - if(plot != null && plot instanceof VanChartMapPlot){ - ((VanChartMapPlot) plot).setMapType(MapType.POINT); - } - return cloneCollection; - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return chartCollection; - } - } - - public static ChartCollection getLineMapChartCollection(ChartCollection chartCollection) { - try{ - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - Chart chart = cloneCollection.getSelectedChart(); - - TopDefinitionProvider definition = chart.getFilterDefinition(); - if(definition != null && definition instanceof VanMapDefinition) { - chart.setFilterDefinition(((VanMapDefinition) definition).getLineDefinition()); - } - - Plot plot = chart.getPlot(); - if(plot != null && plot instanceof VanChartMapPlot){ - ((VanChartMapPlot) plot).setMapType(MapType.LINE); - } - return cloneCollection; - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return chartCollection; - } - } - - - public static ChartCollection getAreaMapChartCollection(ChartCollection chartCollection) { - try{ - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - Chart chart = cloneCollection.getSelectedChart(); - - TopDefinitionProvider definition = chart.getFilterDefinition(); - if(definition != null && definition instanceof VanMapDefinition) { - chart.setFilterDefinition(((VanMapDefinition) definition).getAreaDefinition()); - } - - Plot plot = chart.getPlot(); - if(plot != null && plot instanceof VanChartMapPlot){ - ((VanChartMapPlot) plot).setMapType(MapType.AREA); - } - return cloneCollection; - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return chartCollection; - } - } - - public static ChartCollection getBottomDataDrillMapChartCollection(ChartCollection chartCollection) { - try{ - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - Chart chart = cloneCollection.getSelectedChart(); - - TopDefinitionProvider definition = chart.getFilterDefinition(); - if(definition != null && definition instanceof DrillMapDefinition) { - chart.setFilterDefinition(((DrillMapDefinition) definition).getBottomDataDefinition()); - } - - Plot plot = chart.getPlot(); - if(plot != null && plot instanceof VanChartDrillMapPlot){ - List list = ((VanChartDrillMapPlot) plot).getLayerMapTypeList(); - MapType mapType = (list != null && list.size() > 0) ? list.get(list.size() - 1) : MapType.AREA; - ((VanChartMapPlot) plot).setMapType(mapType); - } - return cloneCollection; - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return chartCollection; - } - } - - public static ChartCollection getLayerChartCollection(ChartCollection chartCollection, int level, MapType mapType){ - if(mapType == null){ - mapType = MapType.AREA; - } - try{ - ChartCollection cloneCollection = (ChartCollection) chartCollection.clone(); - Chart chart = cloneCollection.getSelectedChart(); - - TopDefinitionProvider definition = chart.getFilterDefinition(); - if(definition != null && definition instanceof DrillMapDefinition) { - List list = ((DrillMapDefinition) definition).getEachLayerDataDefinitionList(); - if(list.size() > level){ - chart.setFilterDefinition(list.get(level)); - } - } - - Plot plot = chart.getPlot(); - if(plot != null && plot instanceof VanChartMapPlot){ - ((VanChartMapPlot) plot).setMapType(mapType); - } - return cloneCollection; - } catch (Exception e){ - FineLoggerFactory.getLogger().error(e.getMessage(), e); - return chartCollection; - } - } - - - public static boolean isFromBottomData(ChartCollection chartCollection) { - DrillMapDefinition drillMapDefinition = getDrillMapDefinition(chartCollection); - return drillMapDefinition == null || drillMapDefinition.isFromBottomData(); - } - - public static DrillMapDefinition getDrillMapDefinition(ChartCollection chartCollection) { - if(chartCollection != null){ - Chart chart = chartCollection.getSelectedChart(); - if(chart != null){ - TopDefinitionProvider definitionProvider = chart.getFilterDefinition(); - if(definitionProvider instanceof DrillMapDefinition){ - return (DrillMapDefinition) definitionProvider; - } - } - } - return null; - } - - public static List getDrillMapLayerMapTypeList(ChartCollection chartCollection) { - if(chartCollection != null){ - Chart chart = chartCollection.getSelectedChart(); - if(chart != null){ - Plot plot = chart.getPlot(); - if(plot instanceof VanChartDrillMapPlot){ - return((VanChartDrillMapPlot) plot).getLayerMapTypeList(); - } - } - } - return null; - } - - public static MapType getPlotMapType(ChartCollection chartCollection){ - Plot plot = chartCollection.getSelectedChart().getPlot(); - return getPlotMapType(plot); - } - - public static MapType getPlotMapType(Plot plot){ - if(plot != null && plot instanceof VanChartMapPlot){ - return ((VanChartMapPlot) plot).getMapType(); - } - return MapType.AREA; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java deleted file mode 100644 index 5ebe14ed0a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java +++ /dev/null @@ -1,121 +0,0 @@ -package com.fr.van.chart.map.designer.data; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.frpane.AttributeChangeListener; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; -import com.fr.plugin.chart.map.data.VanMapDefinition; -import com.fr.plugin.chart.type.MapType; - -import javax.swing.JPanel; -import java.awt.BorderLayout; - -/** - * Created by Mitisky on 16/5/16. - */ -public class VanChartMapDataPane extends ChartDataPane { - MapType mapType = MapType.AREA; - - public VanChartMapDataPane(AttributeChangeListener listener) { - super(listener); - } - - @Override - protected JPanel createContentPane() { - contentsPane = new NormalChartDataPane(listener, VanChartMapDataPane.this); - return contentsPane; - } - - protected void repeatLayout(ChartCollection collection) { - if(contentsPane != null) { - this.remove(contentsPane); - } - this.setLayout(new BorderLayout(0, 0)); - - switch (mapType){ - case CUSTOM: - contentsPane = new CustomMapChartDataContentsPane(listener, VanChartMapDataPane.this); - break; - default: - contentsPane = new NormalChartDataPane(listener, VanChartMapDataPane.this); - break; - } - - contentsPane.setSupportCellData(isSupportCellData()); - - this.add(contentsPane, BorderLayout.CENTER); - } - - /** - * 更新界面 数据内容 - */ - public void populate(ChartCollection collection) { - mapType = MapDataPaneHelper.getPlotMapType(collection); - - repeatLayout(collection); - - switch (mapType){ - case AREA: - ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); - contentsPane.populate(areaClone); - break; - case POINT: - ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); - contentsPane.populate(pointClone); - break; - case LINE: - ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); - contentsPane.populate(lineClone); - break; - case CUSTOM: - ChartCollection areaClone1 = MapDataPaneHelper.getAreaMapChartCollection(collection); - ChartCollection pointClone1 = MapDataPaneHelper.getPointMapChartCollection(collection); - ChartCollection lineClone1 = MapDataPaneHelper.getLineMapChartCollection(collection); - ((CustomMapChartDataContentsPane)contentsPane).populateAreaMap(areaClone1); - ((CustomMapChartDataContentsPane)contentsPane).populatePointMap(pointClone1); - ((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone1); - } - - } - - /** - * 保存 数据界面内容 - */ - public void update(ChartCollection collection) { - if(contentsPane != null) { - VanMapDefinition vanMapDefinition = new VanMapDefinition(); - - ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); - ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); - ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); - - switch (mapType){ - case AREA: - contentsPane.update(areaClone); - pointClone.getSelectedChart().setFilterDefinition(null); - lineClone.getSelectedChart().setFilterDefinition(null); - break; - case POINT: - contentsPane.update(pointClone); - areaClone.getSelectedChart().setFilterDefinition(null); - lineClone.getSelectedChart().setFilterDefinition(null); - break; - case LINE: - contentsPane.update(lineClone); - areaClone.getSelectedChart().setFilterDefinition(null); - pointClone.getSelectedChart().setFilterDefinition(null); - break; - case CUSTOM: - ((CustomMapChartDataContentsPane)contentsPane).updateAreaMap(areaClone); - ((CustomMapChartDataContentsPane)contentsPane).updatePointMap(pointClone); - ((CustomMapChartDataContentsPane) contentsPane).updateLineMap(lineClone); - break; - } - vanMapDefinition.setAreaDefinition(areaClone.getSelectedChart().getFilterDefinition()); - vanMapDefinition.setPointDefinition(pointClone.getSelectedChart().getFilterDefinition()); - vanMapDefinition.setLineDefinition(lineClone.getSelectedChart().getFilterDefinition()); - - collection.getSelectedChart().setFilterDefinition(vanMapDefinition); - } - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java deleted file mode 100644 index ac365cab5e..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java +++ /dev/null @@ -1,34 +0,0 @@ -package com.fr.van.chart.map.designer.data.component; - -/** - * Created by hufan on 2016/12/23. - */ -public class LongitudeLatitudeAndArea { - private Object longitude; - private Object latitude; - private Object area; - - public Object getLongitude() { - return longitude; - } - - public void setLongitude(Object longitude) { - this.longitude = longitude; - } - - public Object getLatitude() { - return latitude; - } - - public void setLatitude(Object latitude) { - this.latitude = latitude; - } - - public Object getArea() { - return area; - } - - public void setArea(Object area) { - this.area = area; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java deleted file mode 100644 index 99df746459..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java +++ /dev/null @@ -1,23 +0,0 @@ -package com.fr.van.chart.map.designer.data.component; - -import com.fr.chart.chartdata.MoreNameCDDefinition; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane; -import com.fr.plugin.chart.map.data.VanMapMoreNameCDDefinition; - -import java.awt.Component; - -/** - * Created by Mitisky on 16/5/17. - */ -public class SeriesNameUseFieldNamePaneWithOutFilter extends SeriesNameUseFieldNamePane { - - @Override - protected Component[][] getUseComponent() { - return getUseComponentWithOutFilter(); - } - - @Override - protected MoreNameCDDefinition createMoreNameCDDefinition() { - return new VanMapMoreNameCDDefinition(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java deleted file mode 100644 index c1e1c97559..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java +++ /dev/null @@ -1,29 +0,0 @@ -package com.fr.van.chart.map.designer.data.component; - -import com.fr.chart.chartdata.OneValueCDDefinition; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane; -import com.fr.plugin.chart.map.data.VanMapOneValueCDDefinition; - -import java.awt.Component; - -/** - * Created by Mitisky on 16/5/16. - */ -public class SeriesNameUseFieldValuePaneWithOutFilter extends SeriesNameUseFieldValuePane { - - @Override - protected Component[][] getUseComponent(UILabel Label1, UILabel Label2, UILabel Label3) { - return getUseComponentWithOutFilter(Label1, Label2, Label3); - } - - @Override - protected Component[][] getUseComponentWithOutSummary(UILabel Label1, UILabel Label2, UILabel Label3) { - return getUseComponentWithOutFilterAndSummary(Label1, Label2, Label3); - } - - @Override - protected OneValueCDDefinition createOneValueCDDefinition() { - return new VanMapOneValueCDDefinition(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java deleted file mode 100644 index db545b9d45..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java +++ /dev/null @@ -1,40 +0,0 @@ -package com.fr.van.chart.map.designer.data.component; - -import com.fr.chart.chartattr.Plot; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldNamePane; -import com.fr.design.mainframe.chart.gui.data.table.SeriesNameUseFieldValuePane; -import com.fr.design.mainframe.chart.gui.data.table.SeriesTypeUseComboxPane; - -import javax.swing.JPanel; -import java.awt.BorderLayout; - -/** - * Created by Mitisky on 16/5/16. - */ -public class SeriesTypeUseComboxPaneWithOutFilter extends SeriesTypeUseComboxPane { - - public SeriesTypeUseComboxPaneWithOutFilter(ChartDataPane parent, Plot initplot) { - super(parent, initplot); - } - - protected void initLayout() { - super.initLayout(); - this.add(new JPanel(), BorderLayout.SOUTH); - } - - protected void initComponents() { - super.initComponents(); - this.setSelectedIndex(1); - } - - @Override - protected SeriesNameUseFieldValuePane createValuePane() { - return new SeriesNameUseFieldValuePaneWithOutFilter(); - } - - @Override - protected SeriesNameUseFieldNamePane createNamePane() { - return new SeriesNameUseFieldNamePaneWithOutFilter(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java deleted file mode 100644 index 2415e99bc8..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -import com.fr.plugin.chart.map.data.VanMapReportDefinition; - -import javax.swing.JPanel; - -/** - * Created by hufan on 2016/12/21. - */ -public abstract class AbstractLongLatAreaPane extends JPanel { - public abstract void populate(VanMapReportDefinition vanMapReportDefinition); - public abstract void update(VanMapReportDefinition vanMapReportDefinition); -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java deleted file mode 100644 index 8517e64fb8..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.formula.TinyFormulaPane; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; - -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; - -/** - * Created by hufan on 2016/12/21. - */ -public class AreaPane extends AbstractReportDataContentPane { - protected TinyFormulaPane areaName; - - public AreaPane() { - JPanel panel = createContentPane(); - this.setLayout(new BorderLayout()); - this.add(panel, BorderLayout.CENTER); - } - - protected JPanel createContentPane() { - areaName = new TinyFormulaPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p}; - Component[][] components = getComponent (); - return TableLayoutHelper.createTableLayoutPane(components,rowSize,columnSize); - } - - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaName} - }; - } - - @Override - protected String[] columnNames() { - return new String[0]; - } - - public void populate(LongitudeLatitudeAndArea longLatArea) { - if (longLatArea.getArea() != null) { - areaName.getUITextField().setText(longLatArea.getArea().toString()); - } - } - - public LongitudeLatitudeAndArea update() { - LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea(); - longLatArea.setArea(canBeFormula(areaName.getUITextField().getText())); - return longLatArea; - } - - @Override - public void populateBean(ChartCollection ob) { - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java deleted file mode 100644 index 79a4a433ca..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -import com.fr.design.gui.ilable.BoldFontTextLabel; - -import com.fr.plugin.chart.map.data.VanMapReportDefinition; -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; - -/** - * Created by hufan on 2016/12/22. - */ -public class LineMapAreaPane extends PointMapAreaPane { - private static final int V_GAP = 10; - protected AreaPane endAreaPane; - - protected JPanel createContentPane() { - initAreaPane(); - initEndAreaPane(); - - JPanel content = new JPanel(new BorderLayout(0, V_GAP)); - content.add(areaPane, BorderLayout.NORTH); - content.add(endAreaPane, BorderLayout.CENTER); - return content; - } - - protected void initEndAreaPane() { - endAreaPane = new AreaPane(){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaName} - }; - } - }; - } - @Override - protected void initAreaPane() { - areaPane =new AreaPane(){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaName} - }; - } - }; - } - - @Override - public void populate(VanMapReportDefinition vanMapReportDefinition) { - super.populate(vanMapReportDefinition); - - LongitudeLatitudeAndArea endLongLatArea = new LongitudeLatitudeAndArea(); - endLongLatArea.setArea(vanMapReportDefinition.getEndAreaName()); - endLongLatArea.setLongitude(vanMapReportDefinition.getEndLongitude()); - endLongLatArea.setLatitude(vanMapReportDefinition.getEndLatitude()); - - endAreaPane.populate(endLongLatArea); - } - - @Override - public void update(VanMapReportDefinition vanMapReportDefinition) { - super.update(vanMapReportDefinition); - - LongitudeLatitudeAndArea endLongLatArea = endAreaPane.update(); - vanMapReportDefinition.setEndAreaName(endLongLatArea.getArea() == null ? null : endLongLatArea.getArea().toString()); - vanMapReportDefinition.setEndLongitude(endLongLatArea.getLongitude() == null ? null : endLongLatArea.getLongitude().toString()); - vanMapReportDefinition.setEndLatitude(endLongLatArea.getLatitude() == null ? null : endLongLatArea.getLatitude().toString()); - - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java deleted file mode 100644 index f8fc771828..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - - -import com.fr.design.gui.ilable.BoldFontTextLabel; - - -import java.awt.Component; - -/** - * Created by hufan on 2016/12/22. - */ -public class LineMapLongLatAreaPane extends LineMapAreaPane { - - protected void initEndAreaPane() { - endAreaPane = new LongLatAreaPane(){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaName} - }; - } - }; - } - - protected void initAreaPane() { - areaPane = new LongLatAreaPane(){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaName} - }; - } - }; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java deleted file mode 100644 index f03cda28ac..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java +++ /dev/null @@ -1,78 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.formula.TinyFormulaPane; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; - -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; - -/** - * Created by hufan on 2016/12/21. - */ -public class LongLatAreaPane extends AreaPane { - protected TinyFormulaPane longitude; - protected TinyFormulaPane latitude; - - public LongLatAreaPane() { - JPanel panel = createContentPane(); - this.setLayout(new BorderLayout()); - this.add(panel, BorderLayout.CENTER); - } - - @Override - protected JPanel createContentPane() { - areaName = new TinyFormulaPane(); - longitude = new TinyFormulaPane(); - latitude = new TinyFormulaPane(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p, p, p}; - Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); - } - - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitude}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaName} - }; - } - - @Override - public void populateBean(ChartCollection ob) { - - } - - @Override - protected String[] columnNames() { - return new String[0]; - } - - @Override - public void populate(LongitudeLatitudeAndArea longLatArea) { - super.populate(longLatArea); - if (longLatArea.getLongitude() != null) { - longitude.getUITextField().setText(longLatArea.getLongitude().toString()); - } - if (longLatArea.getLatitude() != null){ - latitude.getUITextField().setText(longLatArea.getLatitude().toString()); - } - } - - @Override - public LongitudeLatitudeAndArea update() { - LongitudeLatitudeAndArea longLatArea = super.update(); - longLatArea.setLongitude(canBeFormula(longitude.getUITextField().getText())); - longLatArea.setLatitude(canBeFormula(latitude.getUITextField().getText())); - return longLatArea; - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java deleted file mode 100644 index 29cb4930a9..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -import com.fr.plugin.chart.map.data.VanMapReportDefinition; -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; - -import javax.swing.JPanel; -import java.awt.BorderLayout; - -/** - * Created by hufan on 2016/12/23. - */ -public class PointMapAreaPane extends AbstractLongLatAreaPane { - protected AreaPane areaPane; - - public PointMapAreaPane() { - JPanel contentPane = createContentPane(); - this.setLayout(new BorderLayout()); - this.add(contentPane, BorderLayout.CENTER); - } - - protected JPanel createContentPane() { - initAreaPane(); - JPanel content = new JPanel(new BorderLayout()); - content.add(areaPane, BorderLayout.CENTER); - return content; - } - - protected void initAreaPane() { - areaPane = new AreaPane(); - } - @Override - public void populate(VanMapReportDefinition vanMapReportDefinition) { - LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea(); - longLatArea.setArea(vanMapReportDefinition.getCategoryName()); - longLatArea.setLongitude(vanMapReportDefinition.getLongitude()); - longLatArea.setLatitude(vanMapReportDefinition.getLatitude()); - areaPane.populate(longLatArea); - } - - @Override - public void update(VanMapReportDefinition vanMapReportDefinition) { - LongitudeLatitudeAndArea longLatArea = areaPane.update(); - vanMapReportDefinition.setCategoryName(longLatArea.getArea() == null ? null : longLatArea.getArea().toString()); - vanMapReportDefinition.setLongitude(longLatArea.getLongitude() == null ? null : longLatArea.getLongitude().toString()); - vanMapReportDefinition.setLatitude(longLatArea.getLatitude() == null ? null : longLatArea.getLatitude().toString()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java deleted file mode 100644 index a4919d0474..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java +++ /dev/null @@ -1,14 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.report; - -/** - * Created by hufan on 2016/12/23. - */ -public class PointMapLongLatAreaPane extends PointMapAreaPane { - public PointMapLongLatAreaPane() { - super(); - } - - protected void initAreaPane() { - areaPane = new LongLatAreaPane(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java deleted file mode 100644 index 585b42de1c..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; - -import javax.swing.JPanel; -import java.util.List; - -/** - * Created by hufan on 2016/12/21. - */ -public abstract class AbstractLongLatAreaPane extends JPanel{ - - public abstract boolean isSelectedItem(); - - public abstract void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider); - - public abstract void update(VanMapTableDefinitionProvider mapTableDefinitionProvider); - - public abstract void refreshBoxListWithSelectTableData(List list); - - public abstract void checkBoxUse(boolean hasUse); - - public abstract void clearAllBoxList(); - - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java deleted file mode 100644 index d765ed425f..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java +++ /dev/null @@ -1,104 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; - -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.List; - -/** - * Created by hufan on 2016/12/21. - */ -public class AreaPane extends AbstractTableDataContentPane { - protected VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane listener; - protected UIComboBox areaNameCom; - public AreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - this.listener = parentPane; - this.setLayout(new BorderLayout()); - JPanel panel = createAreaNamePane(); - this.add(panel, BorderLayout.CENTER); - } - - @Override - public void updateBean(ChartCollection ob) { - - } - - public void checkBoxUse(boolean hasUse) { - areaNameCom.setEnabled(hasUse); - } - - - protected JPanel createAreaNamePane() { - initAreaNameCom(); - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p}; - Component[][] components = getComponent(); - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); - } - - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaNameCom} - }; - } - - protected void initAreaNameCom() { - - areaNameCom = new UIComboBox(); - - areaNameCom.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - listener.fireCheckSeriesUse(areaNameCom.getSelectedItem() != null); - makeToolTipUse(areaNameCom); - } - }); - } - - protected void makeToolTipUse(UIComboBox comBox) { - if (comBox.getSelectedItem() != null) { - comBox.setToolTipText(comBox.getSelectedItem().toString()); - } else { - comBox.setToolTipText(null); - } - } - - @Override - public void refreshBoxListWithSelectTableData(List list) { - refreshBoxItems(areaNameCom, list); - } - - public boolean isSelectedItem() { - return areaNameCom.getSelectedItem() != null; - } - - public void populate(LongitudeLatitudeAndArea longLatArea) { - if (longLatArea.getArea() != null){ - areaNameCom.setSelectedItem(longLatArea.getArea()); - } - } - - public LongitudeLatitudeAndArea update() { - LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea(); - longLatArea.setArea(areaNameCom.getSelectedItem()); - return longLatArea; - } - - @Override - public void clearAllBoxList() { - clearBoxItems(areaNameCom); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java deleted file mode 100644 index 4d2f2d86ce..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java +++ /dev/null @@ -1,100 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.design.gui.ilable.BoldFontTextLabel; - -import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Component; -import java.util.List; - - -/** - * Created by hufan on 2016/12/21. - */ -public class LineMapAreaPane extends PointMapAreaPane { - private static final int V_GAP = 10; - protected AreaPane endAreaPane; - public LineMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - super(parentPane); - } - - protected JPanel createContentPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - initAreaPane(parentPane); - initEndAreaPane(parentPane); - - JPanel content = new JPanel(new BorderLayout(0, V_GAP)); - content.add(areaPane, BorderLayout.NORTH); - content.add(endAreaPane, BorderLayout.CENTER); - return content; - } - - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new AreaPane(parentPane){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaNameCom} - }; - } - }; - } - - protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - endAreaPane = new AreaPane(parentPane){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaNameCom} - }; - } - }; - } - - @Override - public void refreshBoxListWithSelectTableData(List list) { - super.refreshBoxListWithSelectTableData(list); - endAreaPane.refreshBoxListWithSelectTableData(list); - } - - @Override - public boolean isSelectedItem() { - return super.isSelectedItem() - && endAreaPane.isSelectedItem(); - } - - @Override - public void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - super.populate(mapTableDefinitionProvider); - - LongitudeLatitudeAndArea endLongLatArea = new LongitudeLatitudeAndArea(); - endLongLatArea.setArea(mapTableDefinitionProvider.getEndAreaName()); - endLongLatArea.setLongitude(mapTableDefinitionProvider.getEndLongitude()); - endLongLatArea.setLatitude(mapTableDefinitionProvider.getEndLatitude()); - - endAreaPane.populate(endLongLatArea); - } - - @Override - public void update(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - super.update(mapTableDefinitionProvider); - - LongitudeLatitudeAndArea endLongLatArea = endAreaPane.update(); - mapTableDefinitionProvider.setEndAreaName(endLongLatArea.getArea() == null ? null : endLongLatArea.getArea().toString()); - mapTableDefinitionProvider.setEndLongitude(endLongLatArea.getLongitude() == null ? null : endLongLatArea.getLongitude().toString()); - mapTableDefinitionProvider.setEndLatitude(endLongLatArea.getLatitude() == null ? null : endLongLatArea.getLatitude().toString()); - } - - @Override - public void checkBoxUse(boolean hasUse) { - super.checkBoxUse(hasUse); - endAreaPane.checkBoxUse(hasUse); - } - - @Override - public void clearAllBoxList() { - super.clearAllBoxList(); - endAreaPane.clearAllBoxList(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java deleted file mode 100644 index bb0f7a5bbe..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - - -import com.fr.design.gui.ilable.BoldFontTextLabel; - -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - -import java.awt.Component; - -/** - * Created by hufan on 2016/12/21. - */ -public class LineMapLongLatAreaPane extends LineMapAreaPane { - - public LineMapLongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - super(parentPane); - } - - protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - endAreaPane = new LongLatAreaPane(parentPane){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), areaNameCom} - }; - } - }; - } - - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new LongLatAreaPane(parentPane){ - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), areaNameCom} - }; - } - }; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java deleted file mode 100644 index 68e71f7e3e..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java +++ /dev/null @@ -1,123 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; - -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - -import javax.swing.JPanel; -import java.awt.Component; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.List; - -/** - * Created by hufan on 2016/12/21. - */ -public class LongLatAreaPane extends AreaPane { - protected UIComboBox longitudeCom; - protected UIComboBox latitudeCom; - - public LongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - super(parentPane); - } - - @Override - protected JPanel createAreaNamePane() { - initAreaNameCom(); - initLongitudeCom(); - initLatitudeCom(); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {f, COMPONENT_WIDTH}; - double[] rowSize = {p, p, p}; - Component[][] components = getComponent(); - - return TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); - } - - protected Component[][] getComponent () { - return new Component[][]{ - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Longitude")), longitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Latitude")), latitudeCom}, - new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")), areaNameCom} - }; - } - - public void refreshBoxListWithSelectTableData(List list) { - super.refreshBoxListWithSelectTableData(list); - refreshBoxItems(longitudeCom, list); - refreshBoxItems(latitudeCom, list); - } - - protected void initLatitudeCom() { - - latitudeCom = new UIComboBox(); - - latitudeCom.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - listener.fireCheckSeriesUse(latitudeCom.getSelectedItem() != null); - makeToolTipUse(latitudeCom); - } - }); - } - - @Override - public void populate(LongitudeLatitudeAndArea longLatArea) { - super.populate(longLatArea); - if(longLatArea.getLongitude() != null){ - longitudeCom.setSelectedItem(longLatArea.getLongitude()); - } - if(longLatArea.getLatitude() != null){ - latitudeCom.setSelectedItem(longLatArea.getLatitude()); - } - } - - @Override - public LongitudeLatitudeAndArea update() { - LongitudeLatitudeAndArea longitudeLatitudeAndArea = super.update(); - longitudeLatitudeAndArea.setLatitude(latitudeCom.getSelectedItem()); - longitudeLatitudeAndArea.setLongitude(longitudeCom.getSelectedItem()); - return longitudeLatitudeAndArea; - } - - @Override - public void checkBoxUse(boolean hasUse) { - super.checkBoxUse(hasUse); - longitudeCom.setEnabled(hasUse); - latitudeCom.setEnabled(hasUse); - } - - public void clearAllBoxList() { - super.clearAllBoxList(); - clearBoxItems(longitudeCom); - clearBoxItems(latitudeCom); - } - - protected void initLongitudeCom() { - - longitudeCom = new UIComboBox(); - - longitudeCom.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - listener.fireCheckSeriesUse(longitudeCom.getSelectedItem() != null); - makeToolTipUse(longitudeCom); - } - }); - } - - @Override - protected String title4PopupWindow() { - return null; - } - - public boolean isSelectedItem() { - return super.isSelectedItem() - && longitudeCom.getSelectedItem() != null - && latitudeCom.getSelectedItem() != null; - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java deleted file mode 100644 index a6974be4b1..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java +++ /dev/null @@ -1,69 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; -import com.fr.van.chart.map.designer.data.component.LongitudeLatitudeAndArea; -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.util.List; - -/** - * Created by hufan on 2016/12/23. - */ -public class PointMapAreaPane extends AbstractLongLatAreaPane { - protected AreaPane areaPane; - - public PointMapAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - JPanel contentPane = createContentPane(parentPane); - this.setLayout(new BorderLayout()); - this.add(contentPane, BorderLayout.CENTER); - } - - protected JPanel createContentPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - initAreaPane(parentPane); - JPanel content = new JPanel(new BorderLayout()); - content.add(areaPane, BorderLayout.CENTER); - return content; - } - - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new AreaPane(parentPane); - } - - public void refreshBoxListWithSelectTableData(List list) { - areaPane.refreshBoxListWithSelectTableData(list); - } - - @Override - public void checkBoxUse(boolean hasUse) { - areaPane.checkBoxUse(hasUse); - } - - @Override - public void clearAllBoxList() { - areaPane.clearAllBoxList(); - } - - @Override - public boolean isSelectedItem() { - return areaPane.isSelectedItem(); - } - - @Override - public void populate(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - LongitudeLatitudeAndArea longLatArea = new LongitudeLatitudeAndArea(); - longLatArea.setArea(mapTableDefinitionProvider.getCategoryName()); - longLatArea.setLongitude(mapTableDefinitionProvider.getLongitude()); - longLatArea.setLatitude(mapTableDefinitionProvider.getLatitude()); - areaPane.populate(longLatArea); - } - - @Override - public void update(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - LongitudeLatitudeAndArea longLatArea = areaPane.update(); - mapTableDefinitionProvider.setCategoryName(longLatArea.getArea() == null ? null : longLatArea.getArea().toString()); - mapTableDefinitionProvider.setLongitude(longLatArea.getLongitude() == null ? null : longLatArea.getLongitude().toString()); - mapTableDefinitionProvider.setLatitude(longLatArea.getLatitude() == null ? null : longLatArea.getLatitude().toString()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java deleted file mode 100644 index 93a9e833d2..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.fr.van.chart.map.designer.data.component.table; - -import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; - - -/** - * Created by hufan on 2016/12/23. - */ -public class PointMapLongLatAreaPane extends PointMapAreaPane { - - public PointMapLongLatAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - super(parentPane); - } - - protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) { - areaPane = new LongLatAreaPane(parentPane); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java deleted file mode 100644 index 3de16e047a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java +++ /dev/null @@ -1,111 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.report; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.chart.chartdata.SeriesDefinition; -import com.fr.design.formula.TinyFormulaPane; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.report.AbstractReportDataContentPane; - -import com.fr.plugin.chart.map.data.VanMapReportDefinition; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import java.awt.BorderLayout; -import java.awt.Dimension; -import java.util.List; - -/** - * Created by Mitisky on 16/5/16. - */ -public class VanAreaMapPlotReportDataContentPane extends AbstractReportDataContentPane { - protected TinyFormulaPane areaName; - - public VanAreaMapPlotReportDataContentPane(ChartDataPane parent) { - initEveryPane(); - initAreaName(); - JPanel panel = getContent(); - panel.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); - this.add(panel, "0,0,2,0"); - } - - protected void initAreaName() { - areaName = new TinyFormulaPane() { - @Override - protected void initLayout() { - this.setLayout(new BorderLayout(4, 0)); - - UILabel label = new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")); - label.setPreferredSize(new Dimension(75, 20)); - this.add(label, BorderLayout.WEST); - - formulaTextField.setPreferredSize(new Dimension(100, 20)); - this.add(formulaTextField, BorderLayout.CENTER); - this.add(formulaTextFieldButton, BorderLayout.EAST); - } - }; - } - - protected JPanel getContent() { - return getFormulaPane(); - } - - protected JPanel getFormulaPane() { - return areaName; - } - - @Override - protected String[] columnNames() { - return new String[]{ - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Name"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Series_Value") - }; - } - - public void populateBean(ChartCollection collection) { - TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); - if (topDefinitionProvider instanceof VanMapReportDefinition) { - - VanMapReportDefinition mapReportDefinition = (VanMapReportDefinition) topDefinitionProvider; - - populateDefinition(mapReportDefinition); - } - } - - protected void populateDefinition(VanMapReportDefinition mapReportDefinition) { - if (mapReportDefinition.getCategoryName() != null) { - areaName.getUITextField().setText(mapReportDefinition.getCategoryName().toString()); - } - if (mapReportDefinition.getSeriesSize() > 0) { - seriesPane.populateBean(mapReportDefinition.getEntryList()); - } - } - - public void updateBean(ChartCollection collection) { - collection.getSelectedChart().setFilterDefinition(new VanMapReportDefinition()); - - TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); - if (topDefinitionProvider instanceof VanMapReportDefinition) { - - VanMapReportDefinition mapReportDefinition = (VanMapReportDefinition) topDefinitionProvider; - - updateDefinition(mapReportDefinition); - } - } - - protected void updateDefinition(VanMapReportDefinition mapReportDefinition) { - mapReportDefinition.setCategoryName(canBeFormula(areaName.getUITextField().getText())); - mapReportDefinition.setLatitude(null); - mapReportDefinition.setLongitude(null); - - List list = seriesPane.updateBean(); - for (Object[] o : list) { - SeriesDefinition sd = new SeriesDefinition(); - - sd.setSeriesName(canBeFormula(o[0])); - sd.setValue(canBeFormula(o[1])); - mapReportDefinition.addSeriesValue(sd); - } - } -} \ No newline at end of file diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java deleted file mode 100644 index f28d212365..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java +++ /dev/null @@ -1,24 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.report; - -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane; -import com.fr.van.chart.map.designer.data.component.report.LineMapAreaPane; -import com.fr.van.chart.map.designer.data.component.report.LineMapLongLatAreaPane; - -/** - * Created by hufan on 2016/12/15. - */ -public class VanLineMapPlotReportDataContentPane extends VanPointMapPlotReportDataContentPane { - - public VanLineMapPlotReportDataContentPane(ChartDataPane parent) { - super(parent); - } - - protected AbstractLongLatAreaPane getAreaPane() { - return new LineMapAreaPane(); - } - - protected AbstractLongLatAreaPane getLongLatAreaPane() { - return new LineMapLongLatAreaPane(); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java deleted file mode 100644 index 3f82744eab..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java +++ /dev/null @@ -1,171 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.report; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; - -import com.fr.plugin.chart.map.data.VanMapReportDefinition; -import com.fr.van.chart.map.designer.data.component.report.AbstractLongLatAreaPane; -import com.fr.van.chart.map.designer.data.component.report.PointMapAreaPane; -import com.fr.van.chart.map.designer.data.component.report.PointMapLongLatAreaPane; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.Dimension; - -/** - * Created by Mitisky on 16/5/17. - */ -public class VanPointMapPlotReportDataContentPane extends VanAreaMapPlotReportDataContentPane { - private LongLatReportFormulaPane longLatReportFormulaPane; - - public VanPointMapPlotReportDataContentPane(ChartDataPane parent) { - super(parent); - } - - @Override - protected JPanel getContent() { - longLatReportFormulaPane = new LongLatReportFormulaPane(); - JPanel content = new JPanel(new BorderLayout(0, 4)); - content.setBorder(BorderFactory.createEmptyBorder(0, 5, 5, 0)); - content.add(longLatReportFormulaPane, BorderLayout.CENTER); - return content; - } - - @Override - protected void populateDefinition(VanMapReportDefinition mapReportDefinition) { - super.populateDefinition(mapReportDefinition); - longLatReportFormulaPane.populateBean(mapReportDefinition); - } - - @Override - protected void updateDefinition(VanMapReportDefinition mapReportDefinition) { - super.updateDefinition(mapReportDefinition); - longLatReportFormulaPane.updateBean(mapReportDefinition); - } - - //================================public class=================================== - - public class LongLatReportFormulaPane extends BasicBeanPane { - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - private UIButtonGroup locationType; - - private JPanel centerPane; - private AbstractLongLatAreaPane areaPane; - private AbstractLongLatAreaPane longLatAreaPane; - - public LongLatReportFormulaPane() { - this.setLayout(new BorderLayout(0, 5)); - centerPane = new JPanel(new CardLayout()){ - @Override - public Dimension getPreferredSize() { - if (locationType.getSelectedIndex() == 0){ - return areaPane.getPreferredSize(); - }else { - return longLatAreaPane.getPreferredSize(); - } - } - }; - - locationType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")}); - locationType.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - checkCenterPane(); - } - }); - - longLatAreaPane = getLongLatAreaPane(); - areaPane = getAreaPane(); - - centerPane.add(areaPane, "area"); - centerPane.add(longLatAreaPane, "longLat"); - - locationType.setSelectedIndex(0); - - double[] columnSize = {p, f}; - double[] rowSize = {p}; - - Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")),locationType}, - }; - - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,12,6); - - - this.add(panel, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - - } - - private void checkCenterPane() { - CardLayout cardLayout = (CardLayout) centerPane.getLayout(); - if (locationType.getSelectedIndex() == 0) { - cardLayout.show(centerPane, "area"); - }else { - cardLayout.show(centerPane, "longLat"); - } - } - - public void populateBean(VanMapReportDefinition mapReportDefinition) { - locationType.setSelectedIndex(mapReportDefinition.isUseAreaName() ? 0 : 1); - if (locationType.getSelectedIndex() == 0) { - areaPane.populate(mapReportDefinition); - - }else { - longLatAreaPane.populate(mapReportDefinition); - } - - checkCenterPane(); - - } - - public void updateBean(VanMapReportDefinition mapReportDefinition) { - boolean useAreaName = locationType.getSelectedIndex() == 0; - mapReportDefinition.setUseAreaName(useAreaName); - if (useAreaName) { - areaPane.update(mapReportDefinition); - }else { - longLatAreaPane.update(mapReportDefinition); - } - - checkCenterPane(); - } - - /** - * Update. - */ - @Override - public VanMapReportDefinition updateBean() { - return null; - } - - @Override - protected String title4PopupWindow() { - return null; - } - - - } - - protected AbstractLongLatAreaPane getAreaPane() { - return new PointMapAreaPane(); - } - - protected AbstractLongLatAreaPane getLongLatAreaPane() { - return new PointMapLongLatAreaPane(); - } - -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java deleted file mode 100644 index 331b7a843c..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.table; - -import com.fr.base.chart.chartdata.TopDefinitionProvider; -import com.fr.chart.chartattr.ChartCollection; -import com.fr.design.gui.icombobox.UIComboBox; -import com.fr.design.gui.ilable.BoldFontTextLabel; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; - -import com.fr.plugin.chart.map.VanChartMapPlot; -import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; -import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.JSeparator; -import java.awt.BorderLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.awt.event.ItemEvent; -import java.awt.event.ItemListener; -import java.util.List; - -/** - * Created by Mitisky on 16/5/16. - */ -public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContentPane { - private UIComboBox areaNameCom; - - protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; - - public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { - this.setLayout(new BorderLayout(0, 4)); - - initAreaNameCom(); - - JPanel areaNamePane = createAreaNamePane(); - JSeparator jSeparator = new JSeparator(); - areaNamePane.setBorder(BorderFactory.createEmptyBorder(0,24,0,15)); - jSeparator.setPreferredSize(new Dimension(246,2)); - - this.add(areaNamePane, BorderLayout.NORTH); - this.add(jSeparator, BorderLayout.CENTER); - - seriesTypeUseComboxPane = new SeriesTypeUseComboxPaneWithOutFilter(parent, new VanChartMapPlot()); - this.add(seriesTypeUseComboxPane, BorderLayout.SOUTH); - - } - - protected void initAreaNameCom() { - - areaNameCom = new UIComboBox(); - - areaNameCom.addItemListener(new ItemListener() { - public void itemStateChanged(ItemEvent e) { - checkSeriseUse(areaNameCom.getSelectedItem() != null); - makeToolTipUse(areaNameCom); - } - }); - } - - protected JPanel createAreaNamePane() { - UILabel label = new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Area_Name")); - label.setPreferredSize(new Dimension(80, 20)); - areaNameCom.setPreferredSize(new Dimension(100, 20)); - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - double[] columnSize = {p, f}; - double[] rowSize = {p}; - - Component[][] components = new Component[][]{ - new Component[]{label, areaNameCom}, - }; - - return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); - - } - - protected void makeToolTipUse(UIComboBox comBox) { - if (comBox.getSelectedItem() != null) { - comBox.setToolTipText(comBox.getSelectedItem().toString()); - } else { - comBox.setToolTipText(null); - } - } - - /** - * 检查 某些Box是否可用 - * - * @param hasUse 是否使用. - */ - public void checkBoxUse(boolean hasUse) { - checkAreaName(hasUse); - checkSeriseUse(hasUse); - } - - protected void checkAreaName(boolean hasUse) { - areaNameCom.setEnabled(hasUse); - } - - protected void checkSeriseUse(boolean hasUse) { - if (seriesTypeUseComboxPane != null) { - seriesTypeUseComboxPane.checkUseBox(hasUse && isAreaSelectedItem()); - } - } - - protected boolean isAreaSelectedItem(){ - return areaNameCom.getSelectedItem() != null; - } - - protected void refreshBoxListWithSelectTableData(java.util.List list) { - refreshAreaName(list); - seriesTypeUseComboxPane.refreshBoxListWithSelectTableData(list); - } - - protected void refreshAreaName(List list) { - refreshBoxItems(areaNameCom, list); - } - - /** - * 清空所有的box设置 - */ - public void clearAllBoxList() { - clearAreaName(); - seriesTypeUseComboxPane.clearAllBoxList(); - } - - protected void clearAreaName() { - clearBoxItems(areaNameCom); - } - - /** - * 保存界面内容到ChartCollection - */ - public void updateBean(ChartCollection collection) { - seriesTypeUseComboxPane.updateBean(collection); - TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); - if(topDefinitionProvider instanceof VanMapTableDefinitionProvider){ - VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider)topDefinitionProvider; - updateDefinition(mapTableDefinitionProvider); - } - } - - protected void updateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider){ - Object o = areaNameCom.getSelectedItem(); - mapTableDefinitionProvider.setCategoryName(o == null ? null : o.toString()); - } - - /** - * 根据ChartCollection 更新界面 - */ - public void populateBean(ChartCollection collection) { - seriesTypeUseComboxPane.populateBean(collection, this.isNeedSummaryCaculateMethod()); - TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); - if(topDefinitionProvider instanceof VanMapTableDefinitionProvider){ - VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider)topDefinitionProvider; - populateDefinition(mapTableDefinitionProvider); - } - } - - protected void populateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider){ - if (mapTableDefinitionProvider.getCategoryName() != null) { - areaNameCom.setSelectedItem(mapTableDefinitionProvider.getCategoryName()); - } - } - - /** - * 重新布局整个面板 - */ - public void redoLayoutPane() { - seriesTypeUseComboxPane.relayoutPane(this.isNeedSummaryCaculateMethod()); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java deleted file mode 100644 index de2b9ded6a..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java +++ /dev/null @@ -1,25 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.table; - - -import com.fr.design.mainframe.chart.gui.ChartDataPane; -import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane; -import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane; -import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane; - - -/** - * Created by hufan on 2016/12/15. - */ -public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableDataContentPane{ - public VanLineMapPlotTableDataContentPane(ChartDataPane parent) { - super(parent); - } - - protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new LineMapAreaPane(longLatAreaTableComboPane); - } - - protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new LineMapLongLatAreaPane(longLatAreaTableComboPane); - } -} diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java deleted file mode 100644 index 40ea3fe3a3..0000000000 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.fr.van.chart.map.designer.data.contentpane.table; - -import com.fr.design.beans.BasicBeanPane; -import com.fr.design.gui.ibutton.UIButtonGroup; -import com.fr.design.gui.ilable.UILabel; -import com.fr.design.layout.TableLayout; -import com.fr.design.layout.TableLayoutHelper; -import com.fr.design.mainframe.chart.gui.ChartDataPane; - -import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; -import com.fr.van.chart.map.designer.data.component.table.AbstractLongLatAreaPane; -import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane; -import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane; - -import javax.swing.BorderFactory; -import javax.swing.JPanel; -import javax.swing.event.ChangeEvent; -import javax.swing.event.ChangeListener; -import java.awt.BorderLayout; -import java.awt.CardLayout; -import java.awt.Component; -import java.awt.Dimension; -import java.util.List; - -/** - * Created by Mitisky on 16/5/17. - */ -public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableDataContentPane { - private static final int LEFT_GAP = 19; - private static final int V_GAP = 15; - //改控件相当于面积图的区域名控件 - private LongLatAreaTableComboPane longLatTableComboPane; - - public VanPointMapPlotTableDataContentPane(ChartDataPane parent) { - super(parent); - } - - protected void initAreaNameCom() { - longLatTableComboPane = new LongLatAreaTableComboPane(); - } - - protected JPanel createAreaNamePane() { - JPanel panel = new JPanel(new BorderLayout()); - panel.setBorder(BorderFactory.createEmptyBorder(0,LEFT_GAP,V_GAP,0)); - panel.add(longLatTableComboPane, BorderLayout.CENTER); - return panel; - } - - @Override - protected void refreshAreaName(List list) { - longLatTableComboPane.refreshBoxListWithSelectTableData(list); - } - - @Override - protected void checkAreaName(boolean hasUse) { - longLatTableComboPane.checkBoxUse(hasUse); - } - - protected boolean isAreaSelectedItem(){ - return longLatTableComboPane.isSelectedItem(); - } - - @Override - protected void clearAreaName() { - longLatTableComboPane.clearAllBoxList(); - } - - @Override - protected void updateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - longLatTableComboPane.updateBean(mapTableDefinitionProvider); - } - - @Override - protected void populateDefinition(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - longLatTableComboPane.populateBean(mapTableDefinitionProvider); - } - - - public class LongLatAreaTableComboPane extends BasicBeanPane { - private UIButtonGroup locationType; - - private JPanel centerPane; - - private AbstractLongLatAreaPane longLatAreaPane; - - private AbstractLongLatAreaPane areaNamePane; - - - public LongLatAreaTableComboPane() { - - double p = TableLayout.PREFERRED; - double f = TableLayout.FILL; - - this.setLayout(new BorderLayout(0, 5)); - centerPane = new JPanel(new CardLayout()){ - @Override - public Dimension getPreferredSize() { - if (locationType.getSelectedIndex() == 0){ - return new Dimension(180, (int) areaNamePane.getPreferredSize().getHeight()); - }else { - return new Dimension(180, (int) longLatAreaPane.getPreferredSize().getHeight()); - } - } - }; - - locationType = new UIButtonGroup(new String[]{com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_Area_Name"), - com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Location_With_LongAndLat")}); - - locationType.addChangeListener(new ChangeListener() { - @Override - public void stateChanged(ChangeEvent e) { - checkCenterPane(); - } - }); - - longLatAreaPane = createLongLatAreaPane(this); - areaNamePane = createAreaPane(this); - - centerPane.add(areaNamePane, "area"); - centerPane.add(longLatAreaPane, "longLat"); - - locationType.setSelectedIndex(0); - - double[] columnSize = {p, f}; - double[] rowSize = {p}; - Component[][] components = new Component[][]{ - new Component[]{new UILabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Geographic")),locationType}, - }; - - JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components,rowSize,columnSize,30,6); - - this.add(panel, BorderLayout.NORTH); - this.add(centerPane, BorderLayout.CENTER); - - } - - public void fireCheckSeriesUse(boolean hasUse){ - checkSeriseUse(hasUse); - } - - private void checkCenterPane() { - CardLayout cardLayout = (CardLayout) centerPane.getLayout(); - if (locationType.getSelectedIndex() == 0) { - cardLayout.show(centerPane, "area"); - }else { - cardLayout.show(centerPane, "longLat"); - } - fireCheckSeriesUse(true); - } - - protected void refreshBoxListWithSelectTableData(List list) { - areaNamePane.refreshBoxListWithSelectTableData(list); - longLatAreaPane.refreshBoxListWithSelectTableData(list); - } - - /** - * 检查 某些Box是否可用 - * - * @param hasUse 是否使用. - */ - public void checkBoxUse(boolean hasUse) { - areaNamePane.checkBoxUse(hasUse); - longLatAreaPane.checkBoxUse(hasUse); - } - - /** - * 清空所有的box设置 - */ - public void clearAllBoxList() { - areaNamePane.clearAllBoxList(); - longLatAreaPane.clearAllBoxList(); - } - - @Override - public void populateBean(VanMapTableDefinitionProvider mapTableDefinitionProvider) { - locationType.setSelectedIndex(mapTableDefinitionProvider.isUseAreaName() ? 0 : 1); - - if (locationType.getSelectedIndex() == 0) { - areaNamePane.populate(mapTableDefinitionProvider); - }else { - longLatAreaPane.populate(mapTableDefinitionProvider); - } - checkCenterPane(); - } - - public void updateBean(VanMapTableDefinitionProvider mapTableDefinitionProvider){ - boolean useAreaName = locationType.getSelectedIndex() == 0; - mapTableDefinitionProvider.setUseAreaName(useAreaName); - if (useAreaName) { - areaNamePane.update(mapTableDefinitionProvider); - }else { - longLatAreaPane.update(mapTableDefinitionProvider); - } - - checkCenterPane(); - } - - @Override - public VanMapTableDefinitionProvider updateBean() { - return null; - } - - @Override - protected String title4PopupWindow() { - return "longAndLat"; - } - - public boolean isSelectedItem() { - if (locationType.getSelectedIndex() == 0){ - return areaNamePane.isSelectedItem(); - }else { - return longLatAreaPane.isSelectedItem(); - } - } - } - - protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new PointMapAreaPane(longLatAreaTableComboPane); - } - - protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { - return new PointMapLongLatAreaPane(longLatAreaTableComboPane); - } - -}