public abstract class AbstractMarker extends java.lang.Object implements Marker
| Modifier and Type | Field and Description |
|---|---|
protected int |
color |
protected boolean |
hidden
Indicates whether this marker is hidden.
|
protected int |
highlightColor |
protected int |
highlightStrokeColor |
protected java.lang.String |
id
The ID of this marker.
|
protected Location |
location
The location of this marker.
|
protected java.util.HashMap<java.lang.String,java.lang.Object> |
properties
Optional data properties.
|
protected boolean |
selected
Indicates whether this marker is selected.
|
protected int |
strokeColor |
protected int |
strokeWeight |
| Constructor and Description |
|---|
AbstractMarker() |
AbstractMarker(Location location) |
AbstractMarker(Location location,
java.util.HashMap<java.lang.String,java.lang.Object> props) |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
draw(processing.core.PGraphics pg,
float x,
float y)
Draws a visual representation of this marker.
|
protected void |
draw(processing.core.PGraphics pg,
float x,
float y,
UnfoldingMap map)
Draws a visual representation of this marker.
|
void |
draw(UnfoldingMap map)
Draws this marker onto the map.
|
double |
getDistanceTo(Location location)
Calculate distance between this marker and the given location.
|
java.lang.String |
getId()
Gets the marker ID.
|
java.lang.Integer |
getIntegerProperty(java.lang.String key)
Gets the property as Integer for given key.
|
Location |
getLocation()
Gets the location of this marker.
|
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.
|
ScreenPosition |
getScreenPosition(UnfoldingMap map) |
java.lang.String |
getStringProperty(java.lang.String key)
Gets the property as String for given key.
|
boolean |
isHidden()
Indicates whether this marker is hidden.
|
protected abstract boolean |
isInside(float checkX,
float checkY,
float x,
float y)
Checks whether given position is inside the marker.
|
boolean |
isInside(UnfoldingMap map,
float checkX,
float checkY)
Checks whether given position is inside this marker, according to the maps coordinate system.
|
boolean |
isSelected()
Indicates whether this 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 |
setHighlightColor(int highlightColor)
Sets the highlight color of this marker.
|
void |
setHighlightStrokeColor(int highlightStrokeColor)
Sets the highlight color of this marker's border.
|
void |
setId(java.lang.String id)
Sets the marker ID.
|
void |
setLocation(float lat,
float lon)
Set the location for this marker.
|
void |
setLocation(Location location)
Set the location for this marker.
|
void |
setProperties(java.util.HashMap<java.lang.String,java.lang.Object> props)
Sets the optional properties of this marker.
|
java.lang.Object |
setProperty(java.lang.String key,
java.lang.Object value)
Sets the property for given key.
|
void |
setSelected(boolean selected)
Changes the select status of this marker.
|
void |
setStrokeColor(int color)
Sets the color of this marker's border.
|
void |
setStrokeWeight(int strokeWeight)
Sets the thickness of the border of this marker.
|
protected int color
protected int strokeColor
protected int strokeWeight
protected int highlightColor
protected int highlightStrokeColor
protected Location location
protected java.util.HashMap<java.lang.String,java.lang.Object> properties
protected boolean selected
protected boolean hidden
protected java.lang.String id
public AbstractMarker()
public AbstractMarker(Location location)
public AbstractMarker(Location location, java.util.HashMap<java.lang.String,java.lang.Object> props)
public java.lang.String getId()
Markerpublic void setId(java.lang.String id)
Markerpublic void setProperties(java.util.HashMap<java.lang.String,java.lang.Object> props)
MarkersetProperties in interface Markerprops - The properties to set. The map consist of key,value pairs for each property.public java.lang.Object setProperty(java.lang.String key,
java.lang.Object value)
MarkersetProperty in interface Markerkey - The key of the property.value - The value of the property.public java.util.HashMap<java.lang.String,java.lang.Object> getProperties()
MarkergetProperties in interface Markerpublic java.lang.Object getProperty(java.lang.String key)
MarkergetProperty in interface Markerkey - The key of the property.public java.lang.String getStringProperty(java.lang.String key)
MarkergetStringProperty in interface Markerkey - The key of the property.public java.lang.Integer getIntegerProperty(java.lang.String key)
MarkergetIntegerProperty in interface Markerkey - The key of the property.public void draw(UnfoldingMap map)
draw(PGraphics, float, float, UnfoldingMap).protected void draw(processing.core.PGraphics pg,
float x,
float y,
UnfoldingMap map)
pg - The PGraphics to draw on.x - The x position in object coordinates.y - The y position in object coordinates.map - The map to draw on. Can be used to draw a marker which depends on other properties of the map.public abstract void draw(processing.core.PGraphics pg,
float x,
float y)
pg - The PGraphics to draw onx - The x position in outer object coordinates.y - The y position in outer object coordinates.public boolean isInside(UnfoldingMap map, float checkX, float checkY)
isInside(float, float, float, float) of the sub class.public ScreenPosition getScreenPosition(UnfoldingMap map)
public Location getLocation()
MarkergetLocation in interface Markerpublic void setLocation(Location location)
MarkersetLocation in interface Markerlocation - Location with lat, lngpublic void setLocation(float lat,
float lon)
MarkersetLocation in interface Markerlat - latitudelon - longitudepublic double getDistanceTo(Location location)
MarkergetDistanceTo in interface Markerlocation - The location to calculate the distance to.protected abstract boolean isInside(float checkX,
float checkY,
float x,
float y)
checkX - The x position to check in screen coordinates.checkY - The y position to check in screen coordinates.x - The x position of this marker in screen coordinates.y - The y position of this marker in screen coordinates.public void setSelected(boolean selected)
MarkersetSelected in interface Markerselected - Whether this marker is selected or not.public boolean isSelected()
MarkerisSelected in interface Markerpublic void setHidden(boolean hidden)
Markerpublic boolean isHidden()
Markerpublic void setColor(int color)
Markerpublic void setStrokeWeight(int strokeWeight)
MarkersetStrokeWeight in interface MarkerstrokeWeight - Thickness in pixel.public void setHighlightColor(int highlightColor)
MarkersetHighlightColor in interface MarkerhighlightColor - The color (in Processing's color type)public void setHighlightStrokeColor(int highlightStrokeColor)
MarkersetHighlightStrokeColor in interface Markerpublic void setStrokeColor(int color)
MarkersetStrokeColor in interface Markercolor - The color (in Processing's color type)