Browse Source

Merge pull request #1470 in DESIGN/design from ~BJORN/design:release/10.0 to release/10.0

* commit '072977d0e5288cd5a67f124cbda8b77b1108ca6b':
  CHART-11090 代码质量
  CHART-11090
  CHART-11090 模糊匹配代码质量
  CHART-11090 地图模糊匹配
feature/big-screen
eason 5 years ago
parent
commit
7b923988c9
  1. 4
      designer-chart/src/main/java/com/fr/design/chartx/component/MapAreaMatchPane.java
  2. 3
      designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java
  3. 1
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java
  4. 13
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/NormalChartDataPane.java
  5. 6
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/TableDataPane.java
  6. 16
      designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/data/table/AbstractTableDataContentPane.java
  7. 6
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  8. 13
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java
  9. 4
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  10. 5
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java
  11. 1
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/type/VanChartDrillMapPlotPane.java
  12. 6
      designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java
  13. 10
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  14. 29
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java
  15. 105
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanMapTableDataContentPane.java
  16. 16
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java
  17. 1
      designer-chart/src/main/java/com/fr/van/chart/map/designer/type/VanChartMapPlotPane.java

4
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();
} }
@ -261,7 +261,7 @@ public class MapAreaMatchPane extends BasicBeanPane<MapMatchResult> {
private void populateMatchData(Object[] columnData) { private void populateMatchData(Object[] columnData) {
Set<String> geoAreas = matchAreaTable.getItems(); Set<String> geoAreas = matchAreaTable.getItems();
Map<String, String> resultMap = ChartGEOJSONHelper.matchArea(columnData, geoAreas, matchResultTable.getCustomResult()); Map<String, String> resultMap = ChartGEOJSONHelper.matchAreaList(columnData, geoAreas, matchResultTable.getCustomResult());
Object[][] data = new Object[resultMap.size()][2]; Object[][] data = new Object[resultMap.size()][2];

3
designer-chart/src/main/java/com/fr/design/chartx/component/MatchAreaTable.java

@ -80,8 +80,7 @@ public class MatchAreaTable extends JTable {
return; return;
} }
int index = areaNameIndex.get(areaName); int index = areaNameIndex.get(areaName);
Map<String, String> resultMap = ChartGEOJSONHelper.matchArea(new Object[]{areaName}, items); String result = ChartGEOJSONHelper.matchArea(GeneralUtils.objectToString(areaName), items);
String result = resultMap.get(areaName);
getColumnModel().getColumn(1).getCellEditor().stopCellEditing(); getColumnModel().getColumn(1).getCellEditor().stopCellEditing();
this.setValueAt(result, index, 1); this.setValueAt(result, index, 1);
} }

1
designer-chart/src/main/java/com/fr/design/mainframe/chart/gui/ChartDataPane.java

@ -27,6 +27,7 @@ public class ChartDataPane extends AbstractChartAttrPane {
public ChartDataPane(AttributeChangeListener listener) { public ChartDataPane(AttributeChangeListener listener) {
super(); super();
this.listener = listener; this.listener = listener;
this.addAttributeChangeListener(listener);
} }
@Override @Override

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);
}
/** /**
* 保存 数据界面内容 * 保存 数据界面内容
*/ */

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

@ -75,6 +75,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 +125,11 @@ public class TableDataPane extends FurtherBasicBeanPane<ChartCollection>{
add(dataContentPane, BorderLayout.CENTER); add(dataContentPane, BorderLayout.CENTER);
} }
} }
public void refreshLevel(int level){
dataContentPane.refreshLevel(level);
}
/** /**
* 更新界面属性 * 更新界面属性
*/ */

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

@ -6,16 +6,26 @@ 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>{
protected static final double COMPONENT_WIDTH = 124; protected static final double COMPONENT_WIDTH = 124;
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);
@ -129,4 +139,8 @@ public abstract class AbstractTableDataContentPane extends BasicBeanPane<ChartCo
jSeparator.setPreferredSize(new Dimension(246, 2)); jSeparator.setPreferredSize(new Dimension(246, 2));
return jSeparator; return jSeparator;
} }
public void refreshLevel(int level) {
}
} }

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

@ -8,12 +8,13 @@ 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.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.
@ -77,7 +78,8 @@ public class DrillMapDataPane extends BasicBeanPane<ChartCollection> {
dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1); dataDefinitionType.setSelectedIndex(MapDataPaneHelper.isFromBottomData(ob) ? 0 : 1);
ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob); ChartCollection bottomDataChartCollection = MapDataPaneHelper.getBottomDataDrillMapChartCollection(ob);
bottomDataDefinitionPane.populateBean(bottomDataChartCollection);
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) {

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

@ -16,9 +16,9 @@ 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.
@ -95,7 +95,7 @@ public class EachLayerDataDefinitionPane extends MultiTabPane<ChartCollection> {
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); ((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);

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

@ -49,7 +49,6 @@ public class VanChartDrillMapPlotPane extends VanChartMapPlotPane {
return tools; return tools;
} }
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) {

10
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,22 +15,23 @@ 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;
public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) { public VanAreaMapPlotTableDataContentPane(ChartDataPane parent) {
super(parent);
this.setLayout(new BorderLayout(0, 4)); this.setLayout(new BorderLayout(0, 4));
initAreaNameCom(); initAreaNameCom();
@ -72,7 +72,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);
@ -140,6 +140,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
mapTableDefinitionProvider.setMatchResult(this.getMatchResult());
updateDefinition(mapTableDefinitionProvider); updateDefinition(mapTableDefinitionProvider);
} }
} }
@ -157,6 +158,7 @@ public class VanAreaMapPlotTableDataContentPane extends AbstractTableDataContent
TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition(); TopDefinitionProvider topDefinitionProvider = collection.getSelectedChart().getFilterDefinition();
if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) { if (topDefinitionProvider instanceof VanMapTableDefinitionProvider) {
VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider; VanMapTableDefinitionProvider mapTableDefinitionProvider = (VanMapTableDefinitionProvider) topDefinitionProvider;
this.setMatchResult(mapTableDefinitionProvider.getMatchResult());
populateDefinition(mapTableDefinitionProvider); populateDefinition(mapTableDefinitionProvider);
} }
} }

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

@ -1,11 +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 java.awt.Component;
/** /**
* Created by hufan on 2016/12/15. * Created by hufan on 2016/12/15.
@ -16,7 +20,30 @@ 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) {

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

@ -0,0 +1,105 @@
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.ChartDataPane;
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 ChartDataPane parent;
private VanChartMapPlot plot;
//钻取地图有层级,默认-1代表无层级关系
private int level = ChartGEOJSONHelper.DEFAULT_LEVEL;
private MapMatchResult matchResult = new MapMatchResult();
public VanMapTableDataContentPane(ChartDataPane parent){
this.parent = parent;
}
public void setLevel(int level) {
this.level = level;
}
public void setPlot(VanChartMapPlot plot) {
this.plot = plot;
}
public MapMatchResult getMatchResult() {
return matchResult;
}
public void setMatchResult(MapMatchResult matchResult) {
this.matchResult = matchResult;
}
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();
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);
parent.attributeChanged();
}
@Override
public void doCancel() {
}
});
dialog.setVisible(true);
}
});
areaPanel.add(uiButton, BorderLayout.EAST);
return areaPanel;
}
@Override
public void refreshLevel(int level) {
this.setLevel(level);
}
}

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

@ -2,12 +2,14 @@ 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.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 +17,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,7 +216,17 @@ 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_Area_Name")), VanPointMapPlotTableDataContentPane.this.createAreaPanel(areaNameCom)}
};
}
};
}
};
} }
protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) { protected AbstractLongLatAreaPane createLongLatAreaPane(LongLatAreaTableComboPane longLatAreaTableComboPane) {

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

@ -89,7 +89,6 @@ public class VanChartMapPlotPane extends AbstractVanChartTypePane {
} }
} }
} }
/** /**
* 不同地图类型的超链不需要复制 * 不同地图类型的超链不需要复制
* *

Loading…
Cancel
Save