|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fhpotsdam.unfolding.data.MarkerFactory
public class MarkerFactory
A factory to create markers from features. The factory creates appropriate markers the each feature type, e.g. a polygon marker for a polygon feature, and handle multi-marker from multi-feature, as well.
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 Summary | |
---|---|
MarkerFactory()
Creates a new MarkerFactory. |
Method Summary | |
---|---|
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 |
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 |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MarkerFactory()
Method Detail |
---|
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.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |