public class

MotionPoint

extends Object
java.lang.Object
   ↳ com.htc.painting.engine.MotionPoint

Class Overview

Motion data used by HtcPaintingView. Each MotionPoint represents a point in Stroke It contains information specifically used by HtcPaintingView

Summary

Fields
protected float mActionAreaSize
protected float mActionPressure
protected float mDistance
protected long mTimeOffset
protected int mX
protected int mY
Public Constructors
MotionPoint(int x, int y, float pressure, float touchSize, float distance, long timeOffset)
Public Methods
float getActionAreaSize()
get touch area size of point
float getActionPressure()
get touch pressure of point
float getDistance()
accumulated distance from the head of stroke to this motion point
long getTimeOffset()
get time offset related to the first point of stroke
int getX()
get X
int getY()
get Y
void transform(Matrix m)
Transform the x, y coordinate of this motion point by input m
[Expand]
Inherited Methods
From class java.lang.Object

Fields

protected float mActionAreaSize

Since: API Level 2.0

protected float mActionPressure

Since: API Level 2.0

protected float mDistance

Since: API Level 2.0

protected long mTimeOffset

Since: API Level 2.0

protected int mX

Since: API Level 2.0

protected int mY

Since: API Level 2.0

Public Constructors

public MotionPoint (int x, int y, float pressure, float touchSize, float distance, long timeOffset)

Since: API Level 2.0

Parameters
pressure Normalized value from 0.0f to 1.0f
touchSize Normalized value from 0.0f to 1.0f
distance distance to the beginning of path
timeOffset time offset related to creation time of stroke

Public Methods

public float getActionAreaSize ()

Since: API Level 2.0

get touch area size of point

Returns
  • touch size of the motion point

public float getActionPressure ()

Since: API Level 2.0

get touch pressure of point

Returns
  • touch pressure of the motion point

public float getDistance ()

Since: API Level 2.0

accumulated distance from the head of stroke to this motion point

Returns
  • accumulated distance from the head of stroke to this motion point

public long getTimeOffset ()

Since: API Level 2.0

get time offset related to the first point of stroke

Returns
  • time offset related to the first point of stroke

public int getX ()

Since: API Level 2.0

get X

Returns
  • X coordinate of the motion point

public int getY ()

Since: API Level 2.0

get Y

Returns
  • Y coordinate of the motion point

public void transform (Matrix m)

Since: API Level 4.0

Transform the x, y coordinate of this motion point by input m

Parameters
m the matrix to be applied