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