public class MarkerFactory
extends java.lang.Object
See the following example on how to use this factory to create your own custom markers. For this, set the marker
class for each feature type with the setPointClass(Class)
etc methods.
MarkerFactory markerFactory = new MarkerFactory(); markerFactory.setPolygonClass(MyPolygonMarker.class); List<Marker> markers = markerFactory.createMarkers(features);
By default, this factory creates the simple markers provided by Unfolding, such as SimplePointMarker
.
Constructor and Description |
---|
MarkerFactory()
Creates a new MarkerFactory.
|
Modifier and Type | Method and Description |
---|---|
protected Marker |
createLinesMarker(ShapeFeature feature) |
Marker |
createMarker(Feature feature)
Creates a marker for the feature.
|
java.util.List<Marker> |
createMarkers(java.util.List<Feature> features)
Creates markers for each feature.
|
protected Marker |
createMultiMarker(MultiFeature multiFeature) |
protected Marker |
createPointMarker(PointFeature feature) |
protected Marker |
createPolygonMarker(ShapeFeature feature) |
void |
setLineClass(java.lang.Class lineMarkerClass)
Sets the marker class for markers to be created for lines features.
|
void |
setMultiClass(java.lang.Class multiMarkerClass)
Sets the marker class for markers to be created for multi-features.
|
void |
setPointClass(java.lang.Class pointMarkerClass)
Sets the marker class for markers to be created for point features.
|
void |
setPolygonClass(java.lang.Class polygonMarkerClass)
Sets the marker class for markers to be created for polygon features.
|
public java.util.List<Marker> createMarkers(java.util.List<Feature> features)
features
- The list of features.public Marker createMarker(Feature feature) throws java.lang.Exception
feature
- The feature.java.lang.Exception
public void setPointClass(java.lang.Class pointMarkerClass)
pointMarkerClass
- A marker class.public void setLineClass(java.lang.Class lineMarkerClass)
lineMarkerClass
- A marker class.public void setPolygonClass(java.lang.Class polygonMarkerClass)
polygonMarkerClass
- A marker class.public void setMultiClass(java.lang.Class multiMarkerClass)
multiMarkerClass
- A multi marker class.protected Marker createPointMarker(PointFeature feature) throws java.lang.Exception
java.lang.Exception
protected Marker createLinesMarker(ShapeFeature feature) throws java.lang.Exception
java.lang.Exception
protected Marker createPolygonMarker(ShapeFeature feature) throws java.lang.Exception
java.lang.Exception
protected Marker createMultiMarker(MultiFeature multiFeature) throws java.lang.Exception
java.lang.Exception