PenProfile 2.x

com.livescribe.geom
Class Point

java.lang.Object
  extended by com.livescribe.geom.Shape
      extended by com.livescribe.geom.Point

public class Point
extends Shape

This class describes a point in cartesian space.


Field Summary
 
Fields inherited from class com.livescribe.geom.Shape
COORD_MAX, COORD_MIN, INTERSECT_CLIP, INTERSECT_EXTERNAL, INTERSECT_INTERNAL1, INTERSECT_INTERNAL2, SHAPE_COMPOSITE, SHAPE_ELLIPSE, SHAPE_LINESEGMENT, SHAPE_POINT, SHAPE_POLYGON, SHAPE_POLYLINE, SHAPE_RECTANGLE, SHAPE_STROKE, type, vertex
 
Constructor Summary
  Point()
          Creates a new point having its location at (0,0).
protected Point(int[] v)
          Creates a new rectangle having the specified points.
  Point(int x, int y)
          Creates a new point with the specified coordinates.
 
Method Summary
 int getDistance(int x, int y)
          Get the distance between this and the specified point.
 int getX()
          Returns the X-coordinate.
 int getY()
          Returns the Y-coordinate.
 void setX(int x)
          Sets the X-coordinate.
 void setY(int y)
          Sets the Y-coordinate.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class com.livescribe.geom.Shape
contains, getBoundingBox, getNumberofVertices, getNumberOfVertices, getSize, getType, getUnion, getX, getXY, getY, intersectsWith, setVertexArray, setX, setXY, setXY, setY
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Point

public Point()
Creates a new point having its location at (0,0).


Point

public Point(int x,
             int y)
Creates a new point with the specified coordinates.

Parameters:
x - the X-coordinate
y - the Y-coordinate

Point

protected Point(int[] v)
Creates a new rectangle having the specified points. The array should contain two elements, one (X,Y) pair.

Parameters:
v - the vertex array
Method Detail

getX

public int getX()
Returns the X-coordinate.

Returns:
the X-coordinate.

getY

public int getY()
Returns the Y-coordinate.

Returns:
the Y-coordinate.

setX

public void setX(int x)
Sets the X-coordinate.

Parameters:
x - the new X-coordinate.

setY

public void setY(int y)
Sets the Y-coordinate.

Parameters:
y - the new Y-coordinate.

getDistance

public int getDistance(int x,
                       int y)
Get the distance between this and the specified point.

Parameters:
x - the X-coordinate
y - the Y-coordinate
Returns:
the distance between the two points, always a positive value.

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Shape
Returns:
a string representation of this object.

PenProfile 2.x

Copyright © 2010 Livescribe Inc. All Rights Reserved.
Confidential and subject to NDA.