ch.claudio.pen
Class InkDot

java.lang.Object
  extended by ch.claudio.pen.InkDot
All Implemented Interfaces:
java.io.Serializable

public class InkDot
extends java.lang.Object
implements java.io.Serializable

Stores the data for a single Ink point

Note: This class measures time with millisecond precision. This is enough with the Sahara digitizer which delivers point information as 5 byte blocks at a speed of 9600 bit/s and is thus limited to 240 points per second.

Version:
$Id: InkDot.java 289 2008-08-13 13:03:59Z claudio $
Author:
Claudio Nieder

Copyright (C) 2005-2008 Claudio Nieder <private@claudio.ch>, CH-8610 Uster

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; version 2 of the License.

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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA

See Also:
Serialized Form

Constructor Summary
InkDot(int xArg, int yArg, PenState stateArg, InkDot previousArg, long timeArg)
          Create a new ink dot with all information.
 
Method Summary
 void clearPrevious()
          Break the chain.
 boolean equals(java.lang.Object obj)
           
 double getAcceleration()
          As the velocity is measured as scalar, acceleration due to direction change is lost.
 double getAngle()
          As the velocity is measured as scalar, acceleration due to direction change is lost.
 double getDistance()
           
 InkDot getPrevious()
           
 PenState getState()
           
 long getTime()
          Time in microseconds
 double getVelocity()
          As the velocity is measured as scalar, acceleration due to direction change is lost.
 int getX()
           
 int getY()
           
 int hashCode()
           
 boolean isDragged()
          Inquire the state of the pen
 boolean isPressed()
          Inquire the state of the pen
 boolean isReleased()
          Inquire the state of the pen
static void main(java.lang.String[] args)
          Print license.
 void setTime(long timeArg)
          Time in microseconds
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InkDot

public InkDot(int xArg,
              int yArg,
              PenState stateArg,
              InkDot previousArg,
              long timeArg)
Create a new ink dot with all information.

Parameters:
xArg -
yArg -
stateArg -
previousArg -
timeArg -
Method Detail

getState

public PenState getState()
Returns:
Returns the state.

isPressed

public boolean isPressed()
Inquire the state of the pen

Returns:
true if pressed

isDragged

public boolean isDragged()
Inquire the state of the pen

Returns:
treue if dreagged

isReleased

public boolean isReleased()
Inquire the state of the pen

Returns:
true if released

getPrevious

public InkDot getPrevious()
Returns:
the previous

clearPrevious

public void clearPrevious()
Break the chain.


getDistance

public double getDistance()
Returns:
the distance

getVelocity

public double getVelocity()
As the velocity is measured as scalar, acceleration due to direction change is lost.

Returns:
the acceleration

getAngle

public double getAngle()
As the velocity is measured as scalar, acceleration due to direction change is lost.

Returns:
the acceleration

getAcceleration

public double getAcceleration()
As the velocity is measured as scalar, acceleration due to direction change is lost.

Returns:
the acceleration

getTime

public long getTime()
Time in microseconds

Returns:
Returns the time.

setTime

public void setTime(long timeArg)
Time in microseconds

Parameters:
timeArg - The time to set.

getX

public int getX()
Returns:
Returns the x.

getY

public int getY()
Returns:
Returns the y.

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object
See Also:
Object.hashCode()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()

main

public static void main(java.lang.String[] args)
Print license.

Parameters:
args - ignored