|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhpotsdam.unfolding.marker.MultiMarker
public class MultiMarker
A MultiMarker enables handling of multiple, logically grouped markers. Properties and display states are the same for all its markers. A MultiMarker can consist of various sub-markers, even of different types. For instance, a MultiMarker could have three polygon marker and one point marker.
Field Summary | |
---|---|
protected boolean |
hidden
|
protected java.lang.String |
id
|
protected java.util.List<Marker> |
markers
|
java.util.HashMap<java.lang.String,java.lang.Object> |
properties
|
protected boolean |
selected
|
Constructor Summary | |
---|---|
MultiMarker()
|
Method Summary | |
---|---|
void |
addMarkers(Marker... markers)
|
void |
draw(UnfoldingMap map)
Draws this marker. |
double |
getDistanceTo(Location location)
return distance between location and the (to the location) closest marker |
java.lang.String |
getId()
Gets the marker ID. |
Location |
getLocation()
Return center of all markers. |
java.util.List<Marker> |
getMarkers()
|
java.util.HashMap<java.lang.String,java.lang.Object> |
getProperties()
Gets the optional properties of this marker. |
java.lang.Object |
getProperty(java.lang.String key)
Gets the property for given key. |
java.lang.String |
getStringProperty(java.lang.String key)
Gets the property as String for given key. |
boolean |
isHidden()
Indicates whether this marker is hidden. |
boolean |
isInside(UnfoldingMap map,
float checkX,
float checkY)
Returns true if at least one marker is hit. |
boolean |
isSelected()
Indicates whether this multi marker is selected. |
void |
setColor(int color)
Sets the main color of this marker. |
void |
setHidden(boolean hidden)
Sets the visibility status of this marker. |
void |
setId(java.lang.String id)
Sets the marker ID. |
void |
setLocation(float lat,
float lng)
Set the location for this marker. |
void |
setLocation(Location location)
Set the location for this marker. |
void |
setMarkers(java.util.List<Marker> markers)
|
void |
setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties)
Sets the optional properties of this marker. |
void |
setSelected(boolean selected)
Sets the selected status of all its markers. |
void |
setStrokeColor(int color)
Sets the color of the border. |
void |
setStrokeWeight(int weight)
Sets the thickness of the border of this marker. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Marker> markers
public java.util.HashMap<java.lang.String,java.lang.Object> properties
protected boolean selected
protected boolean hidden
protected java.lang.String id
Constructor Detail |
---|
public MultiMarker()
Method Detail |
---|
public java.lang.String getId()
Marker
getId
in interface Marker
public void setId(java.lang.String id)
Marker
setId
in interface Marker
id
- The ID.public void setMarkers(java.util.List<Marker> markers)
public java.util.List<Marker> getMarkers()
public void addMarkers(Marker... markers)
public Location getLocation()
GeoUtils.getCentroid(List)
instead.
getLocation
in interface Marker
public void setLocation(float lat, float lng)
Marker
setLocation
in interface Marker
lat
- latitudelng
- longitudepublic void setLocation(Location location)
Marker
setLocation
in interface Marker
location
- Location with lat, lngpublic double getDistanceTo(Location location)
getDistanceTo
in interface Marker
location
- The location to calculate the distance to.
public void setProperties(java.util.HashMap<java.lang.String,java.lang.Object> properties)
Marker
setProperties
in interface Marker
properties
- The properties to set. The map consist of key,value pairs for each property.public java.util.HashMap<java.lang.String,java.lang.Object> getProperties()
Marker
getProperties
in interface Marker
public java.lang.Object getProperty(java.lang.String key)
Marker
getProperty
in interface Marker
key
- The key of the property.
public java.lang.String getStringProperty(java.lang.String key)
Marker
getStringProperty
in interface Marker
key
- The key of the property.
public boolean isInside(UnfoldingMap map, float checkX, float checkY)
isInside
in interface Marker
map
- The map to draw on.checkX
- The x position to check in screen coordinates.checkY
- The y position to check in screen coordinates.
public void draw(UnfoldingMap map)
Marker
draw
in interface Marker
map
- The map to draw on.public void setSelected(boolean selected)
setSelected
in interface Marker
selected
- Whether this marker is selected or not.public boolean isSelected()
isSelected
in interface Marker
public void setHidden(boolean hidden)
Marker
setHidden
in interface Marker
hidden
- The new statuspublic boolean isHidden()
Marker
isHidden
in interface Marker
public void setColor(int color)
Marker
setColor
in interface Marker
color
- The color (in Processing's color type)public void setStrokeColor(int color)
Marker
setStrokeColor
in interface Marker
color
- The color (in Processing's color type)public void setStrokeWeight(int weight)
Marker
setStrokeWeight
in interface Marker
weight
- Thickness in pixel.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |