|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.fhpotsdam.unfolding.marker.AbstractMarker
public abstract class AbstractMarker
Abstract marker handling conversion of location to appropriate coordinate system, and handles basic marker functionality. All default marker of Unfolding implement this. Your own class can extend this AbstractMarker or implement the Marker interface, directly.
| Field Summary | |
|---|---|
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 Summary | |
|---|---|
AbstractMarker()
|
|
AbstractMarker(Location location)
|
|
AbstractMarker(Location location,
java.util.HashMap<java.lang.String,java.lang.Object> props)
|
|
| Method Summary | |
|---|---|
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. |
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)
|
void |
setHighlightStrokeColor(int highlightStrokeColor)
|
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. |
void |
setSelected(boolean selected)
Changes the select status of this marker. |
void |
setStrokeColor(int color)
Sets the color of the border. |
void |
setStrokeWeight(int strokeWeight)
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 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
| Constructor Detail |
|---|
public AbstractMarker()
public AbstractMarker(Location location)
public AbstractMarker(Location location,
java.util.HashMap<java.lang.String,java.lang.Object> props)
| Method Detail |
|---|
public java.lang.String getId()
Marker
getId in interface Markerpublic void setId(java.lang.String id)
Marker
setId in interface Markerid - The ID.public void setProperties(java.util.HashMap<java.lang.String,java.lang.Object> props)
Marker
setProperties in interface Markerprops - 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 Markerpublic java.lang.Object getProperty(java.lang.String key)
Marker
getProperty in interface Markerkey - The key of the property.
public java.lang.String getStringProperty(java.lang.String key)
Marker
getStringProperty in interface Markerkey - The key of the property.
public void draw(UnfoldingMap map)
draw(PGraphics, float, float, UnfoldingMap).
draw in interface Markermap - The map to draw on.
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.
isInside in interface Markermap - The map to draw on.checkX - The x position to check in screen coordinates.checkY - The y position to check in screen coordinates.
public ScreenPosition getScreenPosition(UnfoldingMap map)
public Location getLocation()
Marker
getLocation in interface Markerpublic void setLocation(Location location)
Marker
setLocation in interface Markerlocation - Location with lat, lng
public void setLocation(float lat,
float lon)
Marker
setLocation in interface Markerlat - latitudelon - longitudepublic double getDistanceTo(Location location)
Marker
getDistanceTo 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)
Marker
setSelected in interface Markerselected - Whether this marker is selected or not.public boolean isSelected()
Marker
isSelected in interface Markerpublic void setHidden(boolean hidden)
Marker
setHidden in interface Markerhidden - The new statuspublic boolean isHidden()
Marker
isHidden in interface Markerpublic void setColor(int color)
Marker
setColor in interface Markercolor - The color (in Processing's color type)public void setStrokeWeight(int strokeWeight)
Marker
setStrokeWeight in interface MarkerstrokeWeight - Thickness in pixel.public void setHighlightColor(int highlightColor)
public void setHighlightStrokeColor(int highlightStrokeColor)
public void setStrokeColor(int color)
Marker
setStrokeColor in interface Markercolor - The color (in Processing's color type)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||