org.formaria.svg
Class MapArea

java.lang.Object
  extended by org.formaria.svg.MapArea

public class MapArea
extends java.lang.Object

Copyright (c) Formaria Ltd., 2008, This software is licensed under the GNU Public License (GPL), please see license.txt for more details. If you make commercial use of this software you must purchase a commercial license from Formaria.

$Revision: 1.2 $


Field Summary
protected  java.util.ArrayList points
           
 
Constructor Summary
MapArea()
          Creates a new instance of MapArea.
 
Method Summary
 void addPoint(double x, double y)
          Add a point to the map area.
 void addPoint(java.awt.geom.Point2D point)
          Add a point to the map area.
 boolean contains(double x, double y)
          Checks whether a specified point is contained within the area.
 boolean contains(java.awt.geom.Point2D point)
          Checks whether a specified point is contained within the area.
 java.util.ArrayList getPoints()
          Return all the points associated with the area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

points

protected java.util.ArrayList points
Constructor Detail

MapArea

public MapArea()
Creates a new instance of MapArea. The areas bounds are defined by a set of points.

Method Detail

addPoint

public void addPoint(double x,
                     double y)
Add a point to the map area.

Parameters:
x - a double specifying the x-coordinate of the point.
y - a double specifying the y-coordinate of the point.

addPoint

public void addPoint(java.awt.geom.Point2D point)
Add a point to the map area.

Parameters:
point - a Point2D object specifying the coordinates of the point.

getPoints

public java.util.ArrayList getPoints()
Return all the points associated with the area.

Returns:
the ArrayList containing the points.

contains

public boolean contains(double x,
                        double y)
Checks whether a specified point is contained within the area.

Parameters:
x - a double specifying the x-coordinate of the point.
y - a double specifying the y-coordinate of the point.
Returns:
boolean specifying whether the point is contained within the area or not.

contains

public boolean contains(java.awt.geom.Point2D point)
Checks whether a specified point is contained within the area.

Parameters:
point - the Point2D being checked.
Returns:
boolean specifying whether the point is contained within the area or not.