edu.mit.sketch.clocksketch.model
Class Point

java.lang.Object
  extended by edu.mit.sketch.clocksketch.model.Point
All Implemented Interfaces:
java.lang.Comparable
Direct Known Subclasses:
PenPoint

public abstract class Point
extends java.lang.Object
implements java.lang.Comparable

Abstract class for a point- a single point created by the pen. Outlines methods a point should have to set/read: X coordinate Y coordinate Pressure (the amount of pressure applied for that point) Time stamp Label

Author:
David Pitman Apr 30, 2005

Constructor Summary
Point()
           
 
Method Summary
abstract  boolean comesAfter(Point point2)
          Returns true iff this Point comes after point2 in time Returns false if the two points' times are equal
abstract  boolean comesBefore(Point point2)
          Returns true iff this Point comes before point2 in time.
abstract  boolean equals(java.lang.Object o)
          Returns true iff the Point equals another Point.
abstract  double getDistance(Point secondPoint)
          Finds the Euclidian distance between this Point and another
abstract  double getDistance(java.awt.geom.Point2D secondPoint)
           
abstract  java.lang.String getLabel()
          Returns a point's label
abstract  double[] getPolarCoordinate(Point centerPoint)
           
abstract  double[] getPolarCoordinate(java.awt.geom.Point2D centerPoint)
          Finds the polar coordinate of a point with respect to the centerPoint
abstract  int getPressure()
          Returns the pressure of the point
abstract  long getUNIXTimeStamp()
          Returns a UNIX time stamp;
abstract  double getX()
          Returns the X coordinate
abstract  double getY()
          Returns the Y coordinate
abstract  boolean isExtrapolated()
          Returns true if the point was generated and actually obtained from real data
abstract  boolean isHooklet()
          Returns true if the point is considered a hooklet
abstract  void setHooklet(boolean status)
          Set's the Point's hooklet status
abstract  void setLabel(java.lang.String label)
          Assigns a label to the point
abstract  void setPressure(int pressure)
          Sets the pressure of the point
abstract  void setUNIXTimeStamp(long timeStamp)
          Sets the time stamp of the point
abstract  void setX(double x)
          Sets the X coordinate of the point.
abstract  void setY(double y)
          Sets the Y coordinate of the point
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

Point

public Point()
Method Detail

getX

public abstract double getX()
Returns the X coordinate


setX

public abstract void setX(double x)
Sets the X coordinate of the point.

Parameters:
x -

getY

public abstract double getY()
Returns the Y coordinate


setY

public abstract void setY(double y)
Sets the Y coordinate of the point

Parameters:
y -

getPressure

public abstract int getPressure()
Returns the pressure of the point


setPressure

public abstract void setPressure(int pressure)
Sets the pressure of the point

Parameters:
pressure -

getUNIXTimeStamp

public abstract long getUNIXTimeStamp()
Returns a UNIX time stamp;


setUNIXTimeStamp

public abstract void setUNIXTimeStamp(long timeStamp)
Sets the time stamp of the point

Parameters:
timeStamp -

comesBefore

public abstract boolean comesBefore(Point point2)
Returns true iff this Point comes before point2 in time. Returns false if the two points' times are equal

Parameters:
point2 -

comesAfter

public abstract boolean comesAfter(Point point2)
Returns true iff this Point comes after point2 in time Returns false if the two points' times are equal

Parameters:
point2 -

isExtrapolated

public abstract boolean isExtrapolated()
Returns true if the point was generated and actually obtained from real data


isHooklet

public abstract boolean isHooklet()
Returns true if the point is considered a hooklet


setHooklet

public abstract void setHooklet(boolean status)
Set's the Point's hooklet status

Parameters:
status -

setLabel

public abstract void setLabel(java.lang.String label)
Assigns a label to the point

Parameters:
label -

getLabel

public abstract java.lang.String getLabel()
Returns a point's label


getDistance

public abstract double getDistance(Point secondPoint)
Finds the Euclidian distance between this Point and another

Parameters:
secondPoint -
Returns:
if either point is null, returns NaN

getPolarCoordinate

public abstract double[] getPolarCoordinate(java.awt.geom.Point2D centerPoint)
Finds the polar coordinate of a point with respect to the centerPoint

Parameters:
centerPoint -
Returns:
{ angle, radius }

getPolarCoordinate

public abstract double[] getPolarCoordinate(Point centerPoint)

equals

public abstract boolean equals(java.lang.Object o)
Returns true iff the Point equals another Point.

Overrides:
equals in class java.lang.Object

getDistance

public abstract double getDistance(java.awt.geom.Point2D secondPoint)