Browse Source

梳理大数据模式中的标记点

feature/big-screen
Qinghui.Liu 4 years ago
parent
commit
7d16b35c96
  1. 70
      designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

70
designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java

@ -178,10 +178,10 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
GUICoreUtils.setEnabled(pointEffectPane, !largeModel); GUICoreUtils.setEnabled(pointEffectPane, !largeModel);
} }
checkMarkerComboboxModel((VanChartMapPlot) plot); VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
refreshMarkerComboboxModel(mapPlot);
if (largeModel) { if (largeModel) {
checkLargeModelPlotSelectedItem(); checkLargeModelPlotSelectedItem(mapPlot);
} }
} }
@ -194,33 +194,21 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
} }
private void checkMarkerComboboxModel(VanChartMapPlot plot) { private void checkLargeModelPlotSelectedItem(VanChartMapPlot plot) {
if (markerTypeCom == null) { String selected = plot.getMapMarkerType().toLocalString();
return;
}
if (shouldRefreshComboboxModel(plot)) {
refreshMarkerTypeComboboxModel(plot);
markerTypeCom.setSelectedItem(plot.getMapMarkerType().toLocalString());
if (markerTypeLayout != null && markerContentPane != null) {
markerTypeLayout.show(markerContentPane, plot.getMapMarkerType().toLocalString());
}
}
}
private void checkLargeModelPlotSelectedItem() {
MapMarkerType selectedType = (MapMarkerType) markerTypeCom.getSelectedItem();
if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selectedType)) { if (ComparatorUtils.equals(MapMarkerType.IMAGE.toLocalString(), selected)) {
markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString()); markerTypeCom.setSelectedItem(MapMarkerType.COMMON.toLocalString());
} else { } else {
markerTypeCom.setSelectedItem(selectedType); markerTypeCom.setSelectedItem(selected);
} }
} }
private boolean shouldRefreshComboboxModel(VanChartMapPlot plot) { private boolean shouldRefreshComboboxModel(VanChartMapPlot plot) {
if (markerTypeCom == null) {
return false;
}
MapMarkerType selectedType = plot.getMapMarkerType(); MapMarkerType selectedType = plot.getMapMarkerType();
DefaultComboBoxModel model = (DefaultComboBoxModel) markerTypeCom.getModel(); DefaultComboBoxModel model = (DefaultComboBoxModel) markerTypeCom.getModel();
@ -231,7 +219,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) > -1; return model.getIndexOf(MapMarkerType.DEFAULT.toLocalString()) > -1;
} }
private void refreshMarkerTypeComboboxModel(VanChartMapPlot plot) { private void refreshMarkerComboboxModel(VanChartMapPlot plot) {
if (largeModel(plot)) { if (largeModel(plot)) {
if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) { if (plot.getMapMarkerType() == MapMarkerType.DEFAULT) {
@ -247,6 +235,13 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
markerTypeCom.setModel(new DefaultComboBoxModel<>(MARKER_TYPES)); markerTypeCom.setModel(new DefaultComboBoxModel<>(MARKER_TYPES));
} }
} }
String selected = plot.getMapMarkerType().toLocalString();
markerTypeCom.setSelectedItem(selected);
if (markerTypeLayout != null && markerContentPane != null) {
markerTypeLayout.show(markerContentPane, selected);
}
} }
@Override @Override
@ -572,9 +567,15 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
public void populateBean(Plot plot) { public void populateBean(Plot plot) {
if (plot instanceof VanChartMapPlot) { if (plot instanceof VanChartMapPlot) {
VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
if (markerTypeCom != null) { if (markerTypeCom != null) {
checkMarkerComboboxModel(((VanChartMapPlot) plot));
markerTypeCom.setSelectedItem(((VanChartMapPlot) plot).getMapMarkerType().toLocalString()); if (shouldRefreshComboboxModel(mapPlot)) {
refreshMarkerComboboxModel(mapPlot);
}
markerTypeCom.setSelectedItem(mapPlot.getMapMarkerType().toLocalString());
} }
if (nullValueColorBox != null) { if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动 //TODO Bjorn 地图空值背景自动
@ -585,11 +586,11 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
} }
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor());
checkNullValueButton();*/ checkNullValueButton();*/
nullValueColorBox.setSelectObject(((VanChartMapPlot) plot).getNullValueColor()); nullValueColorBox.setSelectObject(mapPlot.getNullValueColor());
} }
//大数据模式 恢复用注释。下面3行删除。 //大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) { if (lineMapLargeDataModelGroup != null) {
lineMapLargeDataModelGroup.setSelectedItem(((VanChartMapPlot) plot).getLineMapDataProcessor()); lineMapLargeDataModelGroup.setSelectedItem(mapPlot.getLineMapDataProcessor());
} }
} }
super.populateBean(plot); super.populateBean(plot);
@ -597,18 +598,23 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane {
public void updateBean(Plot plot) { public void updateBean(Plot plot) {
if (plot instanceof VanChartMapPlot) { if (plot instanceof VanChartMapPlot) {
VanChartMapPlot mapPlot = (VanChartMapPlot) plot;
if (markerTypeCom != null) { if (markerTypeCom != null) {
((VanChartMapPlot) plot).setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem())); mapPlot.setMapMarkerType(MapMarkerType.parse((String) markerTypeCom.getSelectedItem()));
checkMarkerComboboxModel((VanChartMapPlot) plot);
if (shouldRefreshComboboxModel(mapPlot)) {
refreshMarkerComboboxModel(mapPlot);
}
} }
if (nullValueColorBox != null) { if (nullValueColorBox != null) {
//TODO Bjorn 地图空值背景自动 //TODO Bjorn 地图空值背景自动
//((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0); //((VanChartMapPlot) plot).setAutoNullValue(nullValueAuto.getSelectedIndex() == 0);
((VanChartMapPlot) plot).setNullValueColor(nullValueColorBox.getSelectObject()); mapPlot.setNullValueColor(nullValueColorBox.getSelectObject());
} }
//大数据模式 恢复用注释。下面3行删除。 //大数据模式 恢复用注释。下面3行删除。
if (lineMapLargeDataModelGroup != null) { if (lineMapLargeDataModelGroup != null) {
((VanChartMapPlot) plot).setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem()); mapPlot.setLineMapDataProcessor(lineMapLargeDataModelGroup.getSelectedItem());
} }
} }
super.updateBean(plot); super.updateBean(plot);

Loading…
Cancel
Save