Browse Source

CHART-13833 散点图标记点删除无,增加自动,调整标记点界面交互

feature/big-screen
Qinghui.Liu 5 years ago
parent
commit
6604b77e81
  1. 77
      designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java
  2. 2
      designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java
  3. 2
      designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java
  4. 21
      designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

77
designer-chart/src/main/java/com/fr/van/chart/designer/component/marker/VanChartCommonMarkerPane.java

@ -31,7 +31,6 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
private JPanel markerConfigPane;
private static final MarkerType[] NORMAL_TYPES = {
MarkerType.MARKER_NULL,
MarkerType.MARKER_CIRCLE,
MarkerType.MARKER_SQUARE,
MarkerType.MARKER_DIAMOND,
@ -42,53 +41,57 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
MarkerType.MARKER_TRIANGLE_HOLLOW
};
private static Marker[] normalMarkers = null;
protected static Marker[] getNormalMarkers() {
if(normalMarkers == null){
normalMarkers = new Marker[NORMAL_TYPES.length];
private static Marker[] normalMarkersWithNull = null;
private static Marker[] normalMarkersWithAuto = null;
private static Marker[] normalMarkersWithAutoAndNull = null;
private static Marker[] getNormalMarkersWithCustom(MarkerType[] types) {
MarkerType[] customTypes = types == null ? new MarkerType[0] : types;
Marker[] result = new Marker[customTypes.length + NORMAL_TYPES.length];
int i = 0;
for(MarkerType markerType : NORMAL_TYPES){
normalMarkers[i++] = Marker.createMarker(markerType);
for (MarkerType markerType : customTypes) {
result[i++] = Marker.createMarker(markerType);
}
for (MarkerType markerType : NORMAL_TYPES) {
result[i++] = Marker.createMarker(markerType);
}
return normalMarkers;
return result;
}
private static Marker[] normalMarkersWithAuto = null;
protected static Marker[] getNormalMarkersWithAuto() {
if (normalMarkersWithAuto == null) {
normalMarkersWithAuto = new Marker[NORMAL_TYPES.length + 1];
normalMarkersWithAuto[0] = Marker.createMarker(MarkerType.MARKER_AUTO);
protected static Marker[] getNormalMarkers() {
if (normalMarkers == null) {
normalMarkers = getNormalMarkersWithCustom(new MarkerType[0]);
}
int i = 1;
return normalMarkers;
}
for (MarkerType markerType : NORMAL_TYPES) {
normalMarkersWithAuto[i++] = Marker.createMarker(markerType);
protected static Marker[] getNormalMarkersWithNull() {
if (normalMarkersWithNull == null) {
normalMarkersWithNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_NULL});
}
return normalMarkersWithNull;
}
return normalMarkersWithAuto;
protected static Marker[] getNormalMarkersWithAuto() {
if (normalMarkersWithAuto == null) {
normalMarkersWithAuto = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO});
}
//没有无这个选项
private static final MarkerType[] MAP_TYPES = {
MarkerType.MARKER_CIRCLE,
MarkerType.MARKER_SQUARE,
MarkerType.MARKER_DIAMOND,
MarkerType.MARKER_TRIANGLE,
MarkerType.MARKER_CIRCLE_HOLLOW,
MarkerType.MARKER_SQUARE_HOLLOW,
MarkerType.MARKER_DIAMOND_HOLLOW,
MarkerType.MARKER_TRIANGLE_HOLLOW
};
private static Marker[] mapMarkers = null;
protected static Marker[] getMapScatterMarkers() {
if(mapMarkers == null){
mapMarkers = new Marker[MAP_TYPES.length];
int i = 0;
for(MarkerType markerType : MAP_TYPES){
mapMarkers[i++] = Marker.createMarker(markerType);
return normalMarkersWithAuto;
}
protected static Marker[] getNormalMarkersWithAutoAndNull() {
if (normalMarkersWithAutoAndNull == null) {
normalMarkersWithAutoAndNull = getNormalMarkersWithCustom(new MarkerType[]{MarkerType.MARKER_AUTO, MarkerType.MARKER_NULL});
}
return mapMarkers;
return normalMarkersWithAutoAndNull;
}
//甘特图的菱形是实心的,之前写的空心。
@ -167,7 +170,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
if (markerConfigPane != null && markerTypeComboBox != null) {
MarkerType type = MarkerType.parse(markerTypeComboBox.getSelectedMarkder().getMarkerType());
markerConfigPane.setVisible(!(type == MarkerType.MARKER_AUTO || type == MarkerType.MARKER_NULL));
markerConfigPane.setVisible(type != MarkerType.MARKER_NULL);
}
}
@ -178,7 +181,7 @@ public class VanChartCommonMarkerPane extends BasicBeanPane<VanChartAttrMarker>
}
protected Marker[] getMarkers() {
return getNormalMarkers();
return getNormalMarkersWithNull();
}
/**

2
designer-chart/src/main/java/com/fr/van/chart/line/VanChartLineSeriesPane.java

@ -55,7 +55,7 @@ public class VanChartLineSeriesPane extends VanChartAbstractPlotSeriesPane {
return new VanChartCommonMarkerPane() {
protected Marker[] getMarkers() {
return getNormalMarkersWithAuto();
return getNormalMarkersWithAutoAndNull();
}
};
}

2
designer-chart/src/main/java/com/fr/van/chart/map/designer/style/series/VanChartMapScatterMarkerPane.java

@ -23,7 +23,7 @@ public class VanChartMapScatterMarkerPane extends VanChartCommonMarkerPane {
@Override
protected Marker[] getMarkers() {
return getMapScatterMarkers();
return getNormalMarkers();
}
@Override

21
designer-chart/src/main/java/com/fr/van/chart/scatter/VanChartScatterSeriesPane.java

@ -1,13 +1,17 @@
package com.fr.van.chart.scatter;
import com.fr.chart.chartattr.Plot;
import com.fr.chart.chartglyph.Marker;
import com.fr.design.beans.BasicBeanPane;
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.ChartStylePane;
import com.fr.van.chart.custom.component.VanChartCustomAxisConditionPane;
import com.fr.van.chart.designer.TableLayout4VanChartHelper;
import com.fr.van.chart.designer.component.VanChartLineTypePane;
import com.fr.van.chart.designer.component.VanChartMarkerPane;
import com.fr.van.chart.designer.component.marker.VanChartCommonMarkerPane;
import com.fr.van.chart.designer.style.series.VanChartAbstractPlotSeriesPane;
import com.fr.van.chart.designer.style.series.VanChartStackedAndAxisListControlPane;
import com.fr.van.chart.scatter.component.VanChartScatterLineTypePane;
@ -63,7 +67,7 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
@Override
public String getPaneTitle() {
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
return Toolkit.i18nText("Fine-Design_Chart_Custom_Axis");
}
};
stackAndAxisEditExpandablePane = TableLayout4VanChartHelper.createExpandablePaneWithTitle(stackAndAxisEditPane.getPaneTitle(), stackAndAxisEditPane);
@ -81,4 +85,19 @@ public class VanChartScatterSeriesPane extends VanChartAbstractPlotSeriesPane {
checkLinePane();
}
protected JPanel createMarkerPane() {
markerPane = new VanChartMarkerPane() {
protected VanChartCommonMarkerPane createCommonMarkerPane() {
return new VanChartCommonMarkerPane() {
protected Marker[] getMarkers() {
return getNormalMarkersWithAuto();
}
};
}
};
return TableLayout4VanChartHelper.createExpandablePaneWithTitle(Toolkit.i18nText("Fine-Design_Chart_Marker"), markerPane);
}
}

Loading…
Cancel
Save