Browse Source

CHART-11090 地图模糊匹配

feature/big-screen
白岳 5 years ago
parent
commit
e35e8f5e6d
  1. 2
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  2. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  3. 9
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  4. 12
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java
  5. 10
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  6. 13
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  7. 7
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  8. 5
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java
  9. 23
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  10. 6
      designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java
  11. 32
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java
  12. 7
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  13. 60
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java
  14. 90
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java
  15. 31
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java
  16. 16
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

2
designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java

@ -196,7 +196,7 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
//先取保存的数据集名称和区域名,若不存在,就取数据集面板配置的数据集名称和区域名 //先取保存的数据集名称和区域名,若不存在,就取数据集面板配置的数据集名称和区域名
matchResultTable.populateBean(matchResult); matchResultTable.populateBean(matchResult);
if (matchResult != null && matchResult.getTableName() != null) { if (matchResult != null && StringUtils.isNotEmpty(matchResult.getTableName())) {
tableName = matchResult.getTableName(); tableName = matchResult.getTableName();
areaName = matchResult.getColumnName(); areaName = matchResult.getColumnName();
} }

13
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java

@ -8,16 +8,15 @@ import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.van.chart.designer.AbstractVanChartScrollPane; import com.fr.van.chart.designer.AbstractVanChartScrollPane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import java.util.ArrayList;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.ArrayList;
import java.util.List;
/** /**
* 一般数据界面 * 一般数据界面
@ -133,6 +132,14 @@ public class NormalChartDataPane extends DataContentsPane {
tableDataPane.checkBoxUse(); tableDataPane.checkBoxUse();
} }
/**
* 钻取地图需要同时更新层级
*/
public void populate(ChartCollection collection, int level) {
populate(collection);
tableDataPane.refreshLevel(level);
}
/** /**
* 保存 数据界面内容 * 保存 数据界面内容
*/ */

9
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java

@ -15,6 +15,7 @@ import com.fr.design.i18n.Toolkit;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane; import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.utils.gui.UIComponentUtils;
import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import java.awt.BorderLayout; import java.awt.BorderLayout;
@ -75,6 +76,7 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
} }
if(dataContentPane != null) { if(dataContentPane != null) {
dataContentPane.onSelectTableData(dataWrap); dataContentPane.onSelectTableData(dataWrap);
dataContentPane.setTableName(dataWrap.getTableDataName());
} }
} }
@ -124,6 +126,13 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
add(dataContentPane, BorderLayout.CENTER); add(dataContentPane, BorderLayout.CENTER);
} }
} }
public void refreshLevel(int level){
if(dataContentPane instanceof VanMapTableDataContentPane) {
((VanMapTableDataContentPane) dataContentPane).setLevel(level);
}
}
/** /**
* 更新界面属性 * 更新界面属性
*/ */

12
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java

@ -6,10 +6,10 @@ import com.fr.design.data.tabledata.wrapper.TableDataWrapper;
import com.fr.design.gui.icombobox.UIComboBox; import com.fr.design.gui.icombobox.UIComboBox;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.util.List;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.List;
public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCollection>{ public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCollection>{
@ -17,6 +17,16 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCo
private boolean isNeedSummaryCaculateMethod = true; private boolean isNeedSummaryCaculateMethod = true;
public String tableName;
public String getTableName() {
return tableName;
}
public void setTableName(String tableName) {
this.tableName = tableName;
}
public abstract void updateBean(ChartCollection ob); public abstract void updateBean(ChartCollection ob);
/** /**

10
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java

@ -8,12 +8,15 @@ import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.gui.frpane.UIComboBoxPane; import com.fr.design.gui.frpane.UIComboBoxPane;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper; import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import java.awt.BorderLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.BorderLayout;
/** /**
* Created by Mitisky on 16/6/20. * Created by Mitisky on 16/6/20.
@ -76,8 +79,11 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1); dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1);
MapMatchResult matchResult = ((VanChartMapPlot) ob.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult();
ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob); ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection); ((VanChartMapPlot)bottomDataChartCollection.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection, ChartGEOJSONHelper.BOTTOM_LEVEL);
eachLayerDataDefinitionPane.populateBean(ob); eachLayerDataDefinitionPane.populateBean(ob);
parent.initAllListeners(); parent.initAllListeners();

13
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java

@ -7,9 +7,9 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.general.ComparatorUtils; import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.type.ZoomLevel;
@ -19,10 +19,11 @@ import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.BorderLayout;
import java.awt.Component;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.awt.BorderLayout;
import java.awt.Component;
/** /**
* Created by Mitisky on 16/6/20. * Created by Mitisky on 16/6/20.
@ -125,6 +126,7 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
if (drillMapPlot != null) { if (drillMapPlot != null) {
java.util.List<ZoomLevel> levelList = drillMapPlot.getLayerLevelList(); java.util.List<ZoomLevel> levelList = drillMapPlot.getLayerLevelList();
java.util.List<MapType> mapTypeList = drillMapPlot.getLayerMapTypeList(); java.util.List<MapType> mapTypeList = drillMapPlot.getLayerMapTypeList();
List<MapMatchResult> matchResultList = drillMapPlot.getMatchResultList();
if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) { if (detailComps == null || drillMapPlot.getMapType() != oldMapType || !ComparatorUtils.equals(drillMapPlot.getGeoUrl(), oldGeoUrl)) {
oldMapType = drillMapPlot.getMapType(); oldMapType = drillMapPlot.getMapType();
@ -151,6 +153,11 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
mapTypeList.add(mapType); mapTypeList.add(mapType);
} }
int matchSize = matchResultList.size();
for (int k = matchSize; k < depth; k++) {
matchResultList.add(new MapMatchResult());
}
for (int i = 0; i < depth; i++) { for (int i = 0; i < depth; i++) {
Component[] components = detailComps[i + 1]; Component[] components = detailComps[i + 1];
if (components != null) { if (components != null) {

7
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java

@ -11,14 +11,15 @@ import com.fr.general.ComparatorUtils;
import com.fr.plugin.chart.drillmap.DrillMapHelper; import com.fr.plugin.chart.drillmap.DrillMapHelper;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper; import com.fr.plugin.chart.map.server.CompatibleGeoJSONTreeHelper;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.van.chart.map.designer.data.MapDataPaneHelper; import com.fr.van.chart.map.designer.data.MapDataPaneHelper;
import javax.swing.tree.DefaultMutableTreeNode; import javax.swing.tree.DefaultMutableTreeNode;
import java.awt.CardLayout;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.awt.CardLayout;
/** /**
* Created by Mitisky on 16/6/20. * Created by Mitisky on 16/6/20.
@ -90,12 +91,14 @@ public class EachLayerDataDefinitionPane extends MultiTabPane<ChartCollection> {
} }
private void populatePaneList(ChartCollection chartCollection) { private void populatePaneList(ChartCollection chartCollection) {
List<MapMatchResult> matchResultList = ((VanChartDrillMapPlot) chartCollection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResultList();
for (int i = 0, len = paneList.size(); i < len; i++) { for (int i = 0, len = paneList.size(); i < len; i++) {
BasicPane basicPane = paneList.get(i); BasicPane basicPane = paneList.get(i);
MapType mapType = oldMapList.get(i); MapType mapType = oldMapList.get(i);
if (basicPane instanceof SingleLayerDataDefinitionPane) { if (basicPane instanceof SingleLayerDataDefinitionPane) {
ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType); ChartCollection clone = MapDataPaneHelper.getLayerChartCollection(chartCollection, i, mapType);
((SingleLayerDataDefinitionPane) basicPane).populateBean(clone); ((VanChartDrillMapPlot)clone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResultList(matchResultList);
((SingleLayerDataDefinitionPane) basicPane).populateBean(clone, i);
} }
} }
} }

5
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java

@ -78,6 +78,11 @@ public class SingleLayerDataDefinitionPane extends FurtherBasicBeanPane<ChartCol
} }
public void populateBean(ChartCollection ob, int level) {
normalChartDataPane.populate(ob, level);
}
@Override @Override
public void updateBean(ChartCollection ob) { public void updateBean(ChartCollection ob) {
normalChartDataPane.update(ob); normalChartDataPane.update(ob);

23
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java

@ -3,17 +3,20 @@ package com.fr.van.chart.drillmap.designer.type;
import com.fr.chart.chartattr.Chart; import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.Plot; import com.fr.chart.chartattr.Plot;
import com.fr.chartx.data.ChartDataDefinitionProvider; import com.fr.chartx.data.ChartDataDefinitionProvider;
import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart; import com.fr.plugin.chart.drillmap.DrillMapIndependentVanChart;
import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot; import com.fr.plugin.chart.drillmap.VanChartDrillMapPlot;
import com.fr.plugin.chart.drillmap.data.DrillMapDefinition; import com.fr.plugin.chart.drillmap.data.DrillMapDefinition;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
import com.fr.plugin.chart.type.ZoomLevel; import com.fr.plugin.chart.type.ZoomLevel;
import com.fr.van.chart.map.designer.type.VanChartMapPlotPane; import com.fr.van.chart.map.designer.type.VanChartMapPlotPane;
import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane; import com.fr.van.chart.map.designer.type.VanChartMapSourceChoosePane;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List;
/** /**
* Created by Mitisky on 16/6/20. * Created by Mitisky on 16/6/20.
@ -49,6 +52,26 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
return tools; return tools;
} }
/**
* 同一个钻取地图 类型之间切换
*/
@Override
protected void cloneOldPlot2New(Plot oldPlot, Plot newPlot) {
super.cloneOldPlot2New(oldPlot, newPlot);
try {
List<MapMatchResult> newMatchResultList = new ArrayList<>();
List<MapMatchResult> matchResultList = ((VanChartDrillMapPlot) oldPlot).getMatchResultList();
if (matchResultList != null) {
for (MapMatchResult matchResult : matchResultList) {
newMatchResultList.add((MapMatchResult) matchResult.clone());
}
}
((VanChartDrillMapPlot) newPlot).setMatchResultList(newMatchResultList);
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error in change plot");
}
}
protected Chart[] getDefaultCharts() { protected Chart[] getDefaultCharts() {
return DrillMapIndependentVanChart.DrillMapVanCharts; return DrillMapIndependentVanChart.DrillMapVanCharts;

6
designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java

@ -21,6 +21,7 @@ import com.fr.van.chart.map.designer.data.contentpane.report.VanLineMapPlotRepor
import com.fr.van.chart.map.designer.data.contentpane.report.VanPointMapPlotReportDataContentPane; 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.VanAreaMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane; import com.fr.van.chart.map.designer.data.contentpane.table.VanLineMapPlotTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanMapTableDataContentPane;
import com.fr.van.chart.map.designer.data.contentpane.table.VanPointMapPlotTableDataContentPane; 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.VanChartMapOtherPane;
import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane; import com.fr.van.chart.map.designer.other.condition.pane.VanChartMapConditionPane;
@ -77,9 +78,12 @@ public class VanMapChartTypeUI extends AbstractIndependentVanChartUI {
//图表数据结构 恢复用注释。删除下面5个方法 getTableDataSourcePane getReportDataSourcePane getChartDataPane areaPlot linePlot。 //图表数据结构 恢复用注释。删除下面5个方法 getTableDataSourcePane getReportDataSourcePane getChartDataPane areaPlot linePlot。
public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractTableDataContentPane getTableDataSourcePane(Plot plot, ChartDataPane parent) {
return areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent) VanMapTableDataContentPane vanMapTableDataContentPane = areaPlot(plot) ? new VanAreaMapPlotTableDataContentPane(parent)
: linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent) : linePlot(plot) ? new VanLineMapPlotTableDataContentPane(parent)
: new VanPointMapPlotTableDataContentPane(parent); : new VanPointMapPlotTableDataContentPane(parent);
vanMapTableDataContentPane.setPlot((VanChartMapPlot)plot);
return vanMapTableDataContentPane;
} }
public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) { public AbstractReportDataContentPane getReportDataSourcePane(Plot plot, ChartDataPane parent) {

32
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java

@ -1,9 +1,12 @@
package com.fr.van.chart.map.designer.data; package com.fr.van.chart.map.designer.data;
import com.fr.chart.chartattr.Chart;
import com.fr.chart.chartattr.ChartCollection; import com.fr.chart.chartattr.ChartCollection;
import com.fr.design.gui.frpane.AttributeChangeListener; import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane; import com.fr.design.mainframe.chart.gui.data.NormalChartDataPane;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.type.MapType; import com.fr.plugin.chart.type.MapType;
@ -54,26 +57,37 @@ public class VanChartMapDataPane extends ChartDataPane {
repeatLayout(collection); repeatLayout(collection);
MapMatchResult matchResult = ((VanChartMapPlot) collection.getSelectedChartProvider(Chart.class).getPlot()).getMatchResult();
ChartCollection areaClone;
ChartCollection pointClone;
ChartCollection lineClone;
switch (mapType) { switch (mapType) {
case AREA: case AREA:
ChartCollection areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection); areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection);
((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
contentsPane.populate(areaClone); contentsPane.populate(areaClone);
break; break;
case POINT: case POINT:
ChartCollection pointClone = MapDataPaneHelper.getPointMapChartCollection(collection); pointClone = MapDataPaneHelper.getPointMapChartCollection(collection);
((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
contentsPane.populate(pointClone); contentsPane.populate(pointClone);
break; break;
case LINE: case LINE:
ChartCollection lineClone = MapDataPaneHelper.getLineMapChartCollection(collection); lineClone = MapDataPaneHelper.getLineMapChartCollection(collection);
((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
contentsPane.populate(lineClone); contentsPane.populate(lineClone);
break; break;
case CUSTOM: case CUSTOM:
ChartCollection areaClone1 = MapDataPaneHelper.getAreaMapChartCollection(collection); areaClone = MapDataPaneHelper.getAreaMapChartCollection(collection);
ChartCollection pointClone1 = MapDataPaneHelper.getPointMapChartCollection(collection); pointClone = MapDataPaneHelper.getPointMapChartCollection(collection);
ChartCollection lineClone1 = MapDataPaneHelper.getLineMapChartCollection(collection); lineClone = MapDataPaneHelper.getLineMapChartCollection(collection);
((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone1); ((VanChartMapPlot)areaClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone1); ((VanChartMapPlot)pointClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone1); ((VanChartMapPlot)lineClone.getSelectedChartProvider(Chart.class).getPlot()).setMatchResult(matchResult);
((CustomMapChartDataContentsPane) contentsPane).populateAreaMap(areaClone);
((CustomMapChartDataContentsPane) contentsPane).populatePointMap(pointClone);
((CustomMapChartDataContentsPane) contentsPane).populateLineMap(lineClone);
} }
} }

7
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java

@ -8,7 +8,6 @@ import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider;
import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter; import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithOutFilter;
@ -16,17 +15,17 @@ import com.fr.van.chart.map.designer.data.component.SeriesTypeUseComboxPaneWithO
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.JSeparator; import javax.swing.JSeparator;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.awt.event.ItemEvent; import java.awt.event.ItemEvent;
import java.awt.event.ItemListener; import java.awt.event.ItemListener;
import java.util.List;
/** /**
* Created by Mitisky on 16/5/16. * Created by Mitisky on 16/5/16.
*/ */
public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContentPane { public class VanAreaMapPlotTableDataContentPane extends VanMapTableDataContentPane {
private UIComboBox areaNameCom; private UIComboBox areaNameCom;
protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane; protected SeriesTypeUseComboxPaneWithOutFilter seriesTypeUseComboxPane;
@ -72,7 +71,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
double[] rowSize = {p}; double[] rowSize = {p};
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
new Component[]{label, areaNameCom}, new Component[]{label, createAreaPanel(areaNameCom)},
}; };
return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize); return TableLayoutHelper.createTableLayoutPane(components, rowSize, columnSize);

60
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java

@ -1,10 +1,15 @@
package com.fr.van.chart.map.designer.data.contentpane.table; package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.mainframe.chart.gui.ChartDataPane; 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.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.AreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.LineMapLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane;
import java.awt.Component;
/** /**
@ -16,10 +21,61 @@ public class VanLineMapPlotTableDataContentPane extends VanPointMapPlotTableData
} }
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new LineMapAreaPane(longLatAreaTableComboPane); return new LineMapAreaPane(longLatAreaTableComboPane) {
@Override
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new AreaPane(parentPane) {
@Override
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Start_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
@Override
protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
endAreaPane = new AreaPane(parentPane) {
@Override
protected Component[][] getComponent () {
return new Component[][]{
new Component[]{new BoldFontTextLabel(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_End_Area_Name")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
} }
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new LineMapLongLatAreaPane(longLatAreaTableComboPane); return new LineMapLongLatAreaPane(longLatAreaTableComboPane){
@Override
protected void initAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
areaPane = new LongLatAreaPane(parentPane) {
@Override
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")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
@Override
protected void initEndAreaPane(VanPointMapPlotTableDataContentPane.LongLatAreaTableComboPane parentPane) {
endAreaPane = new LongLatAreaPane(parentPane){
@Override
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")), VanLineMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
} }
} }

90
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java

@ -0,0 +1,90 @@
package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.base.BaseUtils;
import com.fr.base.Utils;
import com.fr.chartx.TwoTuple;
import com.fr.design.chartx.component.MapAreaMatchPane;
import com.fr.design.dialog.BasicDialog;
import com.fr.design.dialog.DialogActionListener;
import com.fr.design.gui.ibutton.UIButton;
import com.fr.design.gui.icombobox.UIComboBox;
import com.fr.design.mainframe.chart.gui.data.table.AbstractTableDataContentPane;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.server.ChartGEOJSONHelper;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.tree.DefaultMutableTreeNode;
import java.util.Set;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
/**
* @author Bjorn
* @version 10.0
* Created by Bjorn on 2019-12-25
*/
public abstract class VanMapTableDataContentPane extends AbstractTableDataContentPane {
private VanChartMapPlot plot;
//钻取地图有层级,默认-1代表无层级关系
private int level = ChartGEOJSONHelper.DEFAULT_LEVEL;
public int getLevel() {
return level;
}
public void setLevel(int level) {
this.level = level;
}
public VanChartMapPlot getPlot() {
return plot;
}
public void setPlot(VanChartMapPlot plot) {
this.plot = plot;
}
public JPanel createAreaPanel(final UIComboBox areaBox) {
JPanel areaPanel = new JPanel(new BorderLayout(4, 0));
areaBox.setPreferredSize(new Dimension(70, 20));
areaPanel.add(areaBox, BorderLayout.CENTER);
UIButton uiButton = new UIButton(BaseUtils.readIcon("/com/fr/design/images/buttonicon/config.png"));
uiButton.addActionListener(new ActionListener() {
private TwoTuple<DefaultMutableTreeNode, Set<String>> treeNodeAndItems;
@Override
public void actionPerformed(ActionEvent e) {
if (treeNodeAndItems == null) {
treeNodeAndItems = ChartGEOJSONHelper.getTreeNodeAndItems(plot.getGeoUrl(), level);
}
final MapAreaMatchPane pane = new MapAreaMatchPane(treeNodeAndItems);
String nameTable = getTableName();
final MapMatchResult matchResult = plot.getMatchResult(level);
pane.populateBean(matchResult, nameTable, Utils.objectToString(areaBox.getSelectedItem()));
BasicDialog dialog = pane.showWindow(new JFrame());
dialog.addDialogActionListener(new DialogActionListener() {
@Override
public void doOk() {
pane.updateBean(matchResult);
}
@Override
public void doCancel() {
}
});
dialog.setVisible(true);
}
});
areaPanel.add(uiButton, BorderLayout.EAST);
return areaPanel;
}
}

31
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java

@ -2,12 +2,15 @@ package com.fr.van.chart.map.designer.data.contentpane.table;
import com.fr.design.beans.BasicBeanPane; import com.fr.design.beans.BasicBeanPane;
import com.fr.design.gui.ibutton.UIButtonGroup; import com.fr.design.gui.ibutton.UIButtonGroup;
import com.fr.design.gui.ilable.BoldFontTextLabel;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import com.fr.design.layout.TableLayout; import com.fr.design.layout.TableLayout;
import com.fr.design.layout.TableLayoutHelper; import com.fr.design.layout.TableLayoutHelper;
import com.fr.design.mainframe.chart.gui.ChartDataPane; import com.fr.design.mainframe.chart.gui.ChartDataPane;
import com.fr.plugin.chart.map.data.VanMapTableDefinitionProvider; 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.AbstractLongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.AreaPane;
import com.fr.van.chart.map.designer.data.component.table.LongLatAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapAreaPane;
import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane; import com.fr.van.chart.map.designer.data.component.table.PointMapLongLatAreaPane;
@ -15,11 +18,11 @@ import javax.swing.BorderFactory;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import java.util.List;
import java.awt.BorderLayout; import java.awt.BorderLayout;
import java.awt.CardLayout; import java.awt.CardLayout;
import java.awt.Component; import java.awt.Component;
import java.awt.Dimension; import java.awt.Dimension;
import java.util.List;
/** /**
* Created by Mitisky on 16/5/17. * Created by Mitisky on 16/5/17.
@ -214,11 +217,33 @@ public class VanPointMapPlotTableDataContentPane extends VanAreaMapPlotTableData
} }
protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { protected AbstractLongLatAreaPane createAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new PointMapAreaPane(longLatAreaTableComboPane); return new PointMapAreaPane(longLatAreaTableComboPane) {
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")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
} }
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {
return new PointMapLongLatAreaPane(longLatAreaTableComboPane); return new PointMapLongLatAreaPane(longLatAreaTableComboPane) {
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_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")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
} }
} }

16
designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

@ -10,6 +10,7 @@ import com.fr.log.FineLoggerFactory;
import com.fr.plugin.chart.attr.plot.VanChartPlot; import com.fr.plugin.chart.attr.plot.VanChartPlot;
import com.fr.plugin.chart.base.VanChartTools; import com.fr.plugin.chart.base.VanChartTools;
import com.fr.plugin.chart.map.MapIndependentVanChart; import com.fr.plugin.chart.map.MapIndependentVanChart;
import com.fr.plugin.chart.map.MapMatchResult;
import com.fr.plugin.chart.map.VanChartMapPlot; import com.fr.plugin.chart.map.VanChartMapPlot;
import com.fr.plugin.chart.map.data.VanMapDefinition; import com.fr.plugin.chart.map.data.VanMapDefinition;
import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper; import com.fr.plugin.chart.map.server.CompatibleGEOJSONHelper;
@ -90,6 +91,21 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
} }
} }
/**
* 同一个地图 类型之间切换
*/
@Override
protected void cloneOldPlot2New(Plot oldPlot, Plot newPlot) {
super.cloneOldPlot2New(oldPlot, newPlot);
try {
if (((VanChartMapPlot) oldPlot).getMatchResult() != null) {
((VanChartMapPlot) newPlot).setMatchResult((MapMatchResult) ((VanChartMapPlot) oldPlot).getMatchResult().clone());
}
} catch (CloneNotSupportedException e) {
FineLoggerFactory.getLogger().error("Error in change plot");
}
}
/** /**
* 不同地图类型的超链不需要复制 * 不同地图类型的超链不需要复制
* *

Loading…
Cancel
Save