Browse Source

CHART-10227 地图 钻取地图 热力地图 数据配置界面

research/11.0
shine 5 years ago
parent
commit
1b5847da3d
  1. 12
      designer-chart/src/main/java/com/fr/design/ChartTypeInterfaceManager.java
  2. 12
      designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java
  3. 52
      designer-chart/src/main/java/com/fr/design/chartx/GanttChartDataPane.java
  4. 76
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapChartDataPane.java
  5. 120
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapDataPane.java
  6. 136
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/DrillMapLayerPane.java
  7. 128
      designer-chart/src/main/java/com/fr/design/chartx/data/drillMap/EachLayerDataDefinitionPane.java
  8. 111
      designer-chart/src/main/java/com/fr/design/chartx/data/map/AbstractAreaLngLatPane.java
  9. 106
      designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithComboBox.java
  10. 113
      designer-chart/src/main/java/com/fr/design/chartx/data/map/LineMapAreaLngLatPaneWithTinyFormula.java
  11. 93
      designer-chart/src/main/java/com/fr/design/chartx/data/map/MapChartDataPane.java
  12. 71
      designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithComboBox.java
  13. 84
      designer-chart/src/main/java/com/fr/design/chartx/data/map/PointMapAreaLngLatPaneWithTinyFormula.java
  14. 6
      designer-chart/src/main/java/com/fr/design/chartx/fields/AbstractDataSetFieldsPane.java
  15. 49
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapCellDataFieldsPane.java
  16. 50
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapDataSetFieldsPane.java
  17. 64
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapCellDataFieldsPane.java
  18. 61
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/LineMapDataSetFieldsPane.java
  19. 48
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapCellDataFieldsPane.java
  20. 51
      designer-chart/src/main/java/com/fr/design/chartx/fields/diff/PointMapDataSetFieldsPane.java
  21. 8
      designer-chart/src/main/java/com/fr/van/chart/drillmap/VanDrillMapChartTypeUI.java
  22. 52
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java
  23. 39
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java
  24. 130
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java
  25. 117
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapDataPane.java
  26. 171
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/EachLayerDataDefinitionPane.java
  27. 94
      designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/SingleLayerDataDefinitionPane.java
  28. 18
      designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/VanHeatMapChartTypeUI.java
  29. 36
      designer-chart/src/main/java/com/fr/van/chart/map/VanMapChartTypeUI.java
  30. 4
      designer-chart/src/main/java/com/fr/van/chart/map/designer/VanChartGroupPane.java
  31. 84
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java
  32. 177
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java
  33. 121
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/VanChartMapDataPane.java
  34. 34
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java
  35. 23
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java
  36. 29
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java
  37. 40
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java
  38. 13
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java
  39. 65
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java
  40. 71
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java
  41. 37
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java
  42. 78
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java
  43. 47
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java
  44. 14
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java
  45. 26
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java
  46. 104
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java
  47. 100
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java
  48. 42
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java
  49. 123
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java
  50. 69
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java
  51. 18
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java
  52. 111
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java
  53. 24
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java
  54. 171
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java
  55. 177
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanAreaMapPlotTableDataContentPane.java
  56. 25
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanLineMapPlotTableDataContentPane.java
  57. 225
      designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/table/VanPointMapPlotTableDataContentPane.java

12
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());

12
designer-chart/src/main/java/com/fr/design/chartx/AbstractChartDataPane.java

@ -13,6 +13,12 @@ import java.awt.BorderLayout;
*/
public abstract class AbstractChartDataPane<T extends ChartDataDefinitionProvider> extends ChartDataPane {
private VanChart vanChart;
protected VanChart getVanChart() {
return vanChart;
}
public AbstractChartDataPane(AttributeChangeListener listener) {
super(listener);
}
@ -26,15 +32,15 @@ public abstract class AbstractChartDataPane<T extends ChartDataDefinitionProvide
if (collection == null) {
return;
}
VanChart chart = collection.getSelectedChartProvider(VanChart.class);
if (chart == null) {
vanChart = collection.getSelectedChartProvider(VanChart.class);
if (vanChart == null) {
return;
}
this.removeAll();
this.add(createContentPane(), BorderLayout.CENTER);
ChartDataDefinitionProvider dataSetCollection = chart.getChartDataDefinition();
ChartDataDefinitionProvider dataSetCollection = vanChart.getChartDataDefinition();
populate((T) dataSetCollection);

52
designer-chart/src/main/java/com/fr/design/chartx/GanttChartDataPane.java

@ -1,52 +0,0 @@
package com.fr.design.chartx;
import com.fr.chartx.data.GanttChartDataDefinition;
import com.fr.design.chartx.fields.diff.MultiCategoryCellDataFieldsPane;
import com.fr.design.chartx.fields.diff.MultiCategoryDataSetFieldsPane;
import com.fr.design.chartx.single.SingleDataPane;
import com.fr.design.gui.frpane.AttributeChangeListener;
import com.fr.van.chart.map.designer.VanChartGroupPane;
import javax.swing.JPanel;
/**
* Created by shine on 2019/5/22.
*/
public class GanttChartDataPane extends AbstractChartDataPane<GanttChartDataDefinition> {
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;
}
}

76
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<DrillMapChartDataDefinition> {
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;
}
}

120
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<DrillMapChartDataDefinition> {
private UIComboBoxPane<DrillMapChartDataDefinition> 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<DrillMapChartDataDefinition>() {
@Override
protected List<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>> initPaneList() {
List<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>> paneList = new ArrayList<FurtherBasicBeanPane<? extends DrillMapChartDataDefinition>>();
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<DrillMapChartDataDefinition> {
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");
}
}
}

136
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/comp/DrillMapLayerPane.java → 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<ChartCollection> {
public class DrillMapLayerPane extends BasicBeanPane<VanChartDrillMapPlot> {
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<ChartCollection> {
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<ZoomLevel> levelList = drillMapPlot.getLayerLevelList();
java.util.List<MapType> 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<DefaultMutableTreeNode, Integer> 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<ChartCollection> {
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<ChartCollection> {
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<ChartCollection> {
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<ZoomLevel> levelList = drillMapPlot.getLayerLevelList();
java.util.List<MapType> 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<ChartCollection> {
* 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<ZoomLevel> levelList = new ArrayList<ZoomLevel>();
java.util.List<MapType> mapTypeList = new ArrayList<MapType>();
@ -198,6 +208,6 @@ public class DrillMapLayerPane extends BasicScrollPane<ChartCollection> {
@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");
}
}

128
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<DrillMapChartDataDefinition> {
private List<MapType> 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<BasicPane> initPaneList(VanChartDrillMapPlot drillMapPlot) {
List<BasicPane> paneList = new ArrayList<BasicPane>();
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<BasicPane> initPaneList() {
return new ArrayList<BasicPane>();
}
@Override
public void populateBean(DrillMapChartDataDefinition drillMapChartDataDefinition) {
List<AbstractDataDefinition> 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<AbstractDataDefinition> eachLayerDataDefinitionList = new ArrayList<AbstractDataDefinition>();
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() {
}
}

111
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<Integer> 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<Integer>(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);
}
}

106
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
};
}
}

113
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);
}
}
}

93
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<MapChartDataDefinition> {
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;
}
}

71
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
};
}
}

84
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);
}
}
}

6
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<T extends AbstractColumnFieldCol
protected void initComponents() {
this.setLayout(new BorderLayout(0, 6));
this.setBorder(BorderFactory.createEmptyBorder(2, 24, 0, 15));
this.setBorder(BorderFactory.createEmptyBorder(6, 24, 0, 15));
JPanel north = createNorthPane(),
center = createCenterPane(),

49
designer-chart/src/main/java/com/fr/design/chartx/fields/diff/AreaMapCellDataFieldsPane.java

@ -0,0 +1,49 @@
package com.fr.design.chartx.fields.diff;
import com.fr.chartx.data.field.diff.AreaMapColumnFieldCollection;
import com.fr.design.formula.TinyFormulaPane;
import com.fr.design.i18n.Toolkit;
/**
* @author shine
* @version 10.0
* Created by shine on 2019/11/7
*/
public class AreaMapCellDataFieldsPane extends AbstractCellDataFieldsWithSeriesValuePane<AreaMapColumnFieldCollection> {
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;
}
}

50
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<AreaMapColumnFieldCollection> {
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;
}
}

64
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<LineMapColumnFieldCollection> {
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;
}
}

61
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<LineMapColumnFieldCollection> {
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;
}
}

48
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<PointMapColumnFieldCollection> {
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;
}
}

51
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<PointMapColumnFieldCollection> {
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;
}
}

8
designer-chart/src/main/java/com/fr/van/chart/drillmap/DrillMapIndependentVanChartInterface.java → 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);
}
/**

52
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapContentsPane.java

@ -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;
}
}

39
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartDrillMapDataPane.java

@ -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);
}
}

130
designer-chart/src/main/java/com/fr/van/chart/drillmap/designer/data/VanChartMapLayerAndDataTabPane.java

@ -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<ChartCollection> {
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<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
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() {
}
}

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

@ -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<ChartCollection> {
private UIComboBoxPane<ChartCollection> 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<ChartCollection>() {
@Override
protected List<FurtherBasicBeanPane<? extends ChartCollection>> initPaneList() {
List<FurtherBasicBeanPane<? extends ChartCollection>> paneList = new ArrayList<FurtherBasicBeanPane<? extends ChartCollection>>();
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<MapType> 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");
}
}

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

@ -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<ChartCollection> {
private AttributeChangeListener listener;
private ChartDataPane parent;
private int depth;
private String oldGeoUrl;
private List<MapType> 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<MapType> getCurrentMapTypeList() {
return oldMapList;
}
@Override
protected List<BasicPane> initPaneList() {
List<BasicPane> paneList = new ArrayList<BasicPane>();
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<TopDefinitionProvider> eachLayerDataDefinitionList = new ArrayList<TopDefinitionProvider>();
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);
}
}
}
}

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

@ -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<ChartCollection> {
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;
}
}

18
designer-chart/src/main/java/com/fr/van/chart/heatmap/designer/HeatMapIndependentVanChartInterface.java → 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<Plot> getPlotSeriesPane(ChartStylePane parent, Plot plot) {

36
designer-chart/src/main/java/com/fr/van/chart/map/MapIndependentVanChartInterface.java → 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);
}
/**

4
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;
}

84
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/CustomMapChartDataContentsPane.java

@ -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);
}
}

177
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/MapDataPaneHelper.java

@ -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<MapType> 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<TopDefinitionProvider> 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<MapType> 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;
}
}

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

@ -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);
}
}
}

34
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/LongitudeLatitudeAndArea.java

@ -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;
}
}

23
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldNamePaneWithOutFilter.java

@ -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();
}
}

29
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesNameUseFieldValuePaneWithOutFilter.java

@ -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();
}
}

40
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/SeriesTypeUseComboxPaneWithOutFilter.java

@ -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();
}
}

13
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AbstractLongLatAreaPane.java

@ -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);
}

65
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/AreaPane.java

@ -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) {
}
}

71
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapAreaPane.java

@ -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());
}
}

37
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LineMapLongLatAreaPane.java

@ -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}
};
}
};
}
}

78
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/LongLatAreaPane.java

@ -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;
}
}

47
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapAreaPane.java

@ -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());
}
}

14
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/report/PointMapLongLatAreaPane.java

@ -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();
}
}

26
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AbstractLongLatAreaPane.java

@ -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();
}

104
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/AreaPane.java

@ -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);
}
}

100
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapAreaPane.java

@ -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();
}
}

42
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LineMapLongLatAreaPane.java

@ -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}
};
}
};
}
}

123
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/LongLatAreaPane.java

@ -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;
}
}

69
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapAreaPane.java

@ -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());
}
}

18
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/component/table/PointMapLongLatAreaPane.java

@ -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);
}
}

111
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanAreaMapPlotReportDataContentPane.java

@ -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<Object[]> list = seriesPane.updateBean();
for (Object[] o : list) {
SeriesDefinition sd = new SeriesDefinition();
sd.setSeriesName(canBeFormula(o[0]));
sd.setValue(canBeFormula(o[1]));
mapReportDefinition.addSeriesValue(sd);
}
}
}

24
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanLineMapPlotReportDataContentPane.java

@ -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();
}
}

171
designer-chart/src/main/java/com/fr/van/chart/map/designer/data/contentpane/report/VanPointMapPlotReportDataContentPane.java

@ -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<VanMapReportDefinition> {
double p = TableLayout.PREFERRED;
double f = TableLayout.FILL;
private UIButtonGroup<Integer> 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<Integer>(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();
}
}

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

@ -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());
}
}

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

@ -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);
}
}

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

@ -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<VanMapTableDefinitionProvider> {
private UIButtonGroup<Integer> 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<Integer>(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);
}
}
Loading…
Cancel
Save