de.fhpotsdam.unfolding.marker
Class SimplePointMarker

java.lang.Object
  extended by de.fhpotsdam.unfolding.marker.AbstractMarker
      extended by de.fhpotsdam.unfolding.marker.SimplePointMarker
All Implemented Interfaces:
Marker

public class SimplePointMarker
extends AbstractMarker

Marker representing a single location. Use directly to display as simple circle, or extend it for custom styles.


Field Summary
protected  float radius
           
 
Fields inherited from class de.fhpotsdam.unfolding.marker.AbstractMarker
color, hidden, highlightColor, highlightStrokeColor, id, location, properties, selected, strokeColor, strokeWeight
 
Constructor Summary
SimplePointMarker()
          Creates an empty point marker.
SimplePointMarker(Location location)
          Creates a point marker for the given location.
SimplePointMarker(Location location, java.util.HashMap<java.lang.String,java.lang.Object> properties)
          Creates a point marker for the given location and properties.
 
Method Summary
 void draw(processing.core.PGraphics pg, float x, float y)
          Draws this point marker as circle in the defined style.
 boolean isInside(float checkX, float checkY, float x, float y)
          Checks whether given position is inside the marker.
 void setRadius(float radius)
          Sets the radius of this marker.
 
Methods inherited from class de.fhpotsdam.unfolding.marker.AbstractMarker
draw, draw, getDistanceTo, getId, getLocation, getProperties, getProperty, getScreenPosition, getStringProperty, isHidden, isInside, isSelected, setColor, setHidden, setHighlightColor, setHighlightStrokeColor, setId, setLocation, 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

radius

protected float radius
Constructor Detail

SimplePointMarker

public SimplePointMarker()
Creates an empty point marker. Used internally by the MarkerFactory.


SimplePointMarker

public SimplePointMarker(Location location)
Creates a point marker for the given location.

Parameters:
location - The location of this Marker.

SimplePointMarker

public SimplePointMarker(Location location,
                         java.util.HashMap<java.lang.String,java.lang.Object> properties)
Creates a point marker for the given location and properties.

Parameters:
location - The location of this Marker.
properties - Some data properties for this marker.
Method Detail

draw

public void draw(processing.core.PGraphics pg,
                 float x,
                 float y)
Draws this point marker as circle in the defined style. If no style has been set, Unfolding's default one is used.

Specified by:
draw in class AbstractMarker
Parameters:
pg - The PGraphics to draw on
x - The x position in outer object coordinates.
y - The y position in outer object coordinates.

isInside

public boolean isInside(float checkX,
                        float checkY,
                        float x,
                        float y)
Description copied from class: AbstractMarker
Checks whether given position is inside the marker. TODO Keep isInside(cx, cy, x, y) also for AbstractShapeMarker?

Specified by:
isInside in class AbstractMarker
Parameters:
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.
Returns:
true if inside, false otherwise.

setRadius

public void setRadius(float radius)
Sets the radius of this marker. Used for the displayed ellipse.

Parameters:
radius -