|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.fhpotsdam.unfolding.marker.AbstractMarker de.fhpotsdam.unfolding.marker.AbstractShapeMarker
public abstract class AbstractShapeMarker
Abstract marker representing multiple locations and can be implemented as lines, polygons, or other shapes. Handles multiple locations, and implements the main marker methods for handling those properly.
Field Summary | |
---|---|
protected java.util.List<Location> |
locations
All locations defining this shape. |
Fields inherited from class de.fhpotsdam.unfolding.marker.AbstractMarker |
---|
color, hidden, highlightColor, highlightStrokeColor, id, location, properties, selected, strokeColor, strokeWeight |
Constructor Summary | |
---|---|
AbstractShapeMarker()
Creates an empty shape marker with no locations. |
|
AbstractShapeMarker(java.util.List<Location> locations)
Creates a shape marker for the given locations. |
|
AbstractShapeMarker(java.util.List<Location> locations,
java.util.HashMap<java.lang.String,java.lang.Object> properties)
Creates a shape marker for the given locations. |
Method Summary | |
---|---|
void |
addLocation(float lat,
float lon)
Adds a Location to the list of locations. |
void |
addLocations(java.util.List<Location> locations)
Adds all locations to the list of locations. |
void |
addLocations(Location... locations)
Adds all locations to the list of locations. |
void |
draw(processing.core.PGraphics pg,
float x,
float y)
Draws a visual representation of this marker. |
abstract void |
draw(processing.core.PGraphics pg,
java.util.List<MapPosition> objectPositions)
Draws these markers in outer object coordinate system. |
protected void |
draw(processing.core.PGraphics pg,
java.util.List<MapPosition> mapPositions,
java.util.HashMap<java.lang.String,java.lang.Object> properties,
UnfoldingMap map)
|
void |
draw(UnfoldingMap map)
Draws this marker onto the map. |
Location |
getCentroid()
Returns the geometric center of this shape. |
Location |
getLocation()
Gets the geometric center location of this marker. |
Location |
getLocation(int index)
Gets the location at the specified index. |
java.util.List<Location> |
getLocations()
Gets all locations. |
protected boolean |
isInside(float checkX,
float checkY,
float x,
float y)
Checks whether given position is inside the marker. |
protected boolean |
isInside(float checkX,
float checkY,
java.util.List<? extends processing.core.PVector> vectors)
Checks whether the position is within the border of the vectors. |
boolean |
isInside(UnfoldingMap map,
float checkX,
float checkY)
Checks whether given position is inside this marker, according to the maps coordinate system. |
boolean |
isInsideByLocation(float latitude,
float longitude)
Checks whether given position is inside this marker, according to the shape defined by the marker's locations. |
boolean |
isInsideByLocation(Location location)
|
void |
removeLocation(int index)
Deletes a Location from the list of locations. |
void |
removeLocation(Location location)
Deletes a Location from the list of locations. |
void |
setLocation(Location location)
Adds the given location to the list of locations. |
void |
setLocations(java.util.List<Location> locations)
Sets the list of locations. |
Methods inherited from class de.fhpotsdam.unfolding.marker.AbstractMarker |
---|
draw, getDistanceTo, getId, getProperties, getProperty, getScreenPosition, getStringProperty, isHidden, isSelected, setColor, setHidden, setHighlightColor, setHighlightStrokeColor, setId, setLocation, setProperties, setSelected, setStrokeColor, setStrokeWeight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<Location> locations
Constructor Detail |
---|
public AbstractShapeMarker()
public AbstractShapeMarker(java.util.List<Location> locations)
locations
- The list of locations.public AbstractShapeMarker(java.util.List<Location> locations, java.util.HashMap<java.lang.String,java.lang.Object> properties)
locations
- The list of locations.properties
- Some data properties for this marker.Method Detail |
---|
public void setLocations(java.util.List<Location> locations)
locations
- A list of Locations.public java.util.List<Location> getLocations()
public void addLocations(Location... locations)
locations
- One or multiple Location.public void addLocations(java.util.List<Location> locations)
locations
- A list of Locations.public void addLocation(float lat, float lon)
lat
- The latitude value.lon
- The longitude value.public Location getLocation(int index)
index
- The index of the location.
public void removeLocation(Location location)
location
- The Location to remove.public void removeLocation(int index)
index
- The index of the Location to remove.public void setLocation(Location location)
setLocation
in interface Marker
setLocation
in class AbstractMarker
location
- The location to add.public Location getLocation()
getLocation
in interface Marker
getLocation
in class AbstractMarker
public Location getCentroid()
public void draw(UnfoldingMap map)
AbstractMarker
AbstractMarker.draw(PGraphics, float, float, UnfoldingMap)
.
draw
in interface Marker
draw
in class AbstractMarker
map
- The map to draw on.protected void draw(processing.core.PGraphics pg, java.util.List<MapPosition> mapPositions, java.util.HashMap<java.lang.String,java.lang.Object> properties, UnfoldingMap map)
public abstract void draw(processing.core.PGraphics pg, java.util.List<MapPosition> objectPositions)
pg
- The PGraphics to draw onobjectPositions
- The positions in outer object coordinates.public void draw(processing.core.PGraphics pg, float x, float y)
AbstractMarker
draw
in class AbstractMarker
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)
AbstractMarker
AbstractMarker.isInside(float, float, float, float)
of the sub class.
isInside
in interface Marker
isInside
in class AbstractMarker
map
- The map to draw on.checkX
- The x position to check in screen coordinates.checkY
- The y position to check in screen coordinates.
protected boolean isInside(float checkX, float checkY, java.util.List<? extends processing.core.PVector> vectors)
checkX
- The x position to check if inside.checkY
- The y position to check if inside.vectors
- The vectors of the polygon
public boolean isInsideByLocation(float latitude, float longitude)
longitude
- The longitude.latitude
- The latitude.
public boolean isInsideByLocation(Location location)
protected boolean isInside(float checkX, float checkY, float x, float y)
AbstractMarker
isInside
in class AbstractMarker
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.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |