From 3520a202a8a8791b55a7c4716efd8d8772eac813 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=99=BD=E5=B2=B3?= <445798420@qq.com> Date: Mon, 28 Dec 2020 15:15:21 +0800 Subject: [PATCH] CHART-17573 && CHART-17567 && CHART-17434 bugfix --- .../com/fr/design/chart/ChartSwingUtils.java | 2 +- .../van/chart/map/VanChartMapSeriesPane.java | 18 ++++++++++---- .../style/label/VanChartMapLabelPane.java | 24 ++++++++----------- 3 files changed, 25 insertions(+), 19 deletions(-) diff --git a/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java b/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java index b5b0576913..41e1753f7b 100644 --- a/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java +++ b/designer-chart/src/main/java/com/fr/design/chart/ChartSwingUtils.java @@ -31,7 +31,7 @@ public class ChartSwingUtils { }); textField.addKeyListener(new KeyAdapter() { public void keyTyped(KeyEvent e) { - if(box.isSelected()) { + if(box.isSelected() && !e.isControlDown()) { e.consume(); showFormulaPane(textField, null); } diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java index 29111b4b58..8f5a3d1783 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/VanChartMapSeriesPane.java @@ -17,6 +17,7 @@ import com.fr.design.utils.gui.GUICoreUtils; import com.fr.design.utils.gui.UIComponentUtils; import com.fr.design.widget.FRWidgetFactory; import com.fr.general.ComparatorUtils; +import com.fr.general.GeneralUtils; import com.fr.plugin.chart.VanChartAttrHelper; import com.fr.plugin.chart.base.AttrBorderWithAlpha; import com.fr.plugin.chart.base.AttrEffect; @@ -30,6 +31,7 @@ import com.fr.plugin.chart.map.line.condition.AttrCurve; import com.fr.plugin.chart.map.line.condition.AttrLineEffect; import com.fr.plugin.chart.type.MapMarkerType; import com.fr.plugin.chart.type.MapType; +import com.fr.stable.StringUtils; import com.fr.van.chart.bubble.component.VanChartBubblePane; import com.fr.van.chart.designer.TableLayout4VanChartHelper; import com.fr.van.chart.designer.component.border.VanChartBorderWithAlphaPane; @@ -173,22 +175,29 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { } private void checkPointCompsEnabledWithLarge(Plot plot) { - boolean largeModel = largeModel(plot); - if (pointEffectPane != null) { - GUICoreUtils.setEnabled(pointEffectPane, !largeModel); - } + checkPointEffectPane(plot); if (markerTypeCom == null) { return; } VanChartMapPlot mapPlot = (VanChartMapPlot) plot; + boolean largeModel = largeModel(plot); refreshMarkerComboboxModel(mapPlot); if (largeModel) { checkLargeModelPlotSelectedItem(mapPlot); } } + private void checkPointEffectPane(Plot plot) { + if (pointEffectPane != null) { + boolean largeModel = largeModel(plot); + boolean imageMark = markerTypeCom == null ? false : + StringUtils.equals(MapMarkerType.IMAGE.toLocalString(), GeneralUtils.objectToString(markerTypeCom.getSelectedItem())); + GUICoreUtils.setEnabled(pointEffectPane, !largeModel && !imageMark); + } + } + private void checkLineCompsEnabledWithLarge(Plot plot) { if (lineMapEffectPane != null) { //大数据模式 恢复用注释。下面1行删除。 @@ -483,6 +492,7 @@ public class VanChartMapSeriesPane extends VanChartColorValueSeriesPane { @Override public void itemStateChanged(ItemEvent e) { markerTypeLayout.show(markerContentPane, (String) markerTypeCom.getSelectedItem()); + checkPointEffectPane(plot); } }); diff --git a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java index 6d22d97001..80dc9ef0b1 100644 --- a/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java +++ b/designer-chart/src/main/java/com/fr/van/chart/map/designer/style/label/VanChartMapLabelPane.java @@ -39,18 +39,14 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { if (mapPlot == null) { return contentPane; } - switch (mapPlot.getAllLayersMapType()){ + switch (mapPlot.getAllLayersMapType()) { case POINT: pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); contentPane.add(pointLabelPane, BorderLayout.NORTH); break; case CUSTOM: - areaLabelPane = createAreaMapPlotLabelPane(); - pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); - contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); - break; case DRILL_CUSTOM: - areaLabelPane = new VanChartPlotLabelPane(mapPlot, parent); + areaLabelPane = createAreaMapPlotLabelPane(); pointLabelPane = new VanChartPlotLabelPane(mapPlot, parent); contentPane.add(new VanMapAreaAndPointGroupPane(areaLabelPane, pointLabelPane), BorderLayout.NORTH); break; @@ -64,7 +60,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { } private VanChartPlotLabelPane createAreaMapPlotLabelPane() { - return new VanChartPlotLabelPane(mapPlot, parent){ + return new VanChartPlotLabelPane(mapPlot, parent) { @Override protected boolean checkEnabled4Large() { return false; @@ -75,7 +71,7 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { @Override public void populateBean(Chart chart) { Plot plot = chart.getPlot(); - if(plot instanceof VanChartMapPlot){ + if (plot instanceof VanChartMapPlot) { mapPlot = (VanChartMapPlot) plot; } @@ -85,11 +81,11 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { parent.initAllListeners(); } - AttrMapLabel attrMapLabel = (AttrMapLabel)plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); - if(attrMapLabel == null){ + AttrMapLabel attrMapLabel = (AttrMapLabel) plot.getConditionCollection().getDefaultAttr().getExisted(AttrMapLabel.class); + if (attrMapLabel == null) { attrMapLabel = new AttrMapLabel(); } - if(pointLabelPane != null){ + if (pointLabelPane != null) { pointLabelPane.populate(attrMapLabel.getPointLabel()); } if (areaLabelPane != null) { @@ -103,17 +99,17 @@ public class VanChartMapLabelPane extends AbstractVanChartScrollPane { return; } ConditionAttr defaultAttr = chart.getPlot().getConditionCollection().getDefaultAttr(); - AttrMapLabel attrMapLabel = (AttrMapLabel)defaultAttr.getExisted(AttrMapLabel.class); + AttrMapLabel attrMapLabel = (AttrMapLabel) defaultAttr.getExisted(AttrMapLabel.class); if (attrMapLabel != null) { defaultAttr.remove(attrMapLabel); } else { attrMapLabel = new AttrMapLabel(); } - if(areaLabelPane != null){ + if (areaLabelPane != null) { attrMapLabel.setAreaLabel(areaLabelPane.update()); } - if(pointLabelPane != null){ + if (pointLabelPane != null) { attrMapLabel.setPointLabel(pointLabelPane.update()); }