public class Fling
extends java.lang.Object
Constructor and Description |
---|
Fling(float x1,
float y1,
float x2,
float y2,
float vx,
float vy)
Creates a fling event given the coordinates of the touch and release points
and the fling velocity.
|
Modifier and Type | Method and Description |
---|---|
float |
getDx()
Returns the x-component of the fling direction.
|
float |
getDy()
Returns the y-component of the fling direction.
|
Point |
getEnd()
Returns the point where the fling ended.
|
double |
getEndX()
Returns the x-coordinate where the fling ended.
|
double |
getEndY()
Returns the y-coordinate where the fling ended.
|
Shape |
getShape()
Returns the shape over which this fling event occurred.
|
Point |
getStart()
Returns the point where the fling started.
|
double |
getStartX()
Returns the x-coordinate where the fling started.
|
double |
getStartY()
Returns the y-coordinate where the fling started.
|
float |
getVx()
Returns the x-component of the fling velocity.
|
float |
getVy()
Returns the y-component of the fling velocity.
|
void |
setShape(Shape s)
Sets the shape over which this fling event occurred.
|
public Fling(float x1, float y1, float x2, float y2, float vx, float vy)
x1
- the x-coordinate of the touch pointy1
- the y-coordinate of the touch pointx2
- the x-coordinate of the touch pointy2
- the y-coordinate of the touch pointvx
- the x-component of the velocityvy
- the y-component of the velocitypublic float getDx()
public float getDy()
public Point getEnd()
public double getEndX()
public double getEndY()
public Shape getShape()
null
if no shape was touchedpublic Point getStart()
public double getStartX()
public double getStartY()
public float getVx()
public float getVy()
public void setShape(Shape s)