xinca.data
Class Points

java.lang.Object
  |
  +--java.util.AbstractCollection
        |
        +--java.util.AbstractList
              |
              +--java.util.Vector
                    |
                    +--xinca.data.Points
All Implemented Interfaces:
java.lang.Cloneable, java.util.Collection, java.util.List, java.util.RandomAccess, java.io.Serializable

public class Points
extends java.util.Vector
implements java.io.Serializable

A vector of Points.

Copyright (c) 2002 ICMC-USP.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.

Since:
JDK1.4
Author:
Renan Gonçalves Cattelan
See Also:
Serialized Form

Constructor Summary
Points()
          Constructor
 
Method Summary
 void addElement(java.lang.Object object)
          Adds an point
 java.awt.Rectangle getBounds()
          Gets the bounds of the stroke
 boolean isNear(int x, int y)
          Checks if a point is near the set of points
 boolean isNear(java.awt.Point p)
          Checks if a Point is near the set of Points
 
Methods inherited from class java.util.Vector
add, add, addAll, addAll, capacity, clear, clone, contains, containsAll, copyInto, elementAt, elements, ensureCapacity, equals, firstElement, get, hashCode, indexOf, indexOf, insertElementAt, isEmpty, lastElement, lastIndexOf, lastIndexOf, remove, remove, removeAll, removeAllElements, removeElement, removeElementAt, retainAll, set, setElementAt, setSize, size, subList, toArray, toArray, toString, trimToSize
 
Methods inherited from class java.util.AbstractList
iterator, listIterator, listIterator
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.List
iterator, listIterator, listIterator
 

Constructor Detail

Points

public Points()
Constructor

Method Detail

addElement

public void addElement(java.lang.Object object)
Adds an point

Overrides:
addElement in class java.util.Vector
Parameters:
object - is the Point to add

isNear

public boolean isNear(java.awt.Point p)
Checks if a Point is near the set of Points

Parameters:
p - is the point to check
Returns:
true if the point is near the the set of Points (Stroke), and false otherwise

isNear

public boolean isNear(int x,
                      int y)
Checks if a point is near the set of points

Parameters:
x - is the x coordinate to check
y - is the y coordinate to check
Returns:
true if the point is near the stroke, and false otherwise

getBounds

public java.awt.Rectangle getBounds()
Gets the bounds of the stroke

Returns:
the rectangle bounding box of the set of points