App

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
mhr.appandroid.views.CurvesView.GestureListener Class Reference
Inheritance diagram for mhr.appandroid.views.CurvesView.GestureListener:

## Public Member Functions
boolean | onDown (MotionEvent e)
boolean | onScroll (MotionEvent e1, MotionEvent e2, float distanceX, float distanceY)
boolean | onDoubleTapEvent (MotionEvent e)

## Detailed Description

Definition at line 26 of file CurvesView.java.

## Member Function Documentation

boolean mhr.appandroid.views.CurvesView.GestureListener.onDoubleTapEvent | ( | MotionEvent | e | ) |
| inline

Definition at line 88 of file CurvesView.java.

{
int X = (int) e.getX();
int Y = (int) e.getY();
for (int i = 0; i < x.length; i++) {
cRect.offsetTo(xToGlob(x[i]) - cXCenter, yToGlob(y[i]) - cYCenter);
if (cRect.contains(X, Y)) {
selIndex = i;
if (removeSelPoint()) {
prepareCurve();
invalidate();
if (listener != null) {
listener.onCurvesChange(CurvesView.this);
listener.onCurvesChangeStop(CurvesView.this);
}
}
return true;
}
}
return true;
}

boolean mhr.appandroid.views.CurvesView.GestureListener.onDown | ( | MotionEvent | e | ) |
| inline

Definition at line 28 of file CurvesView.java.

{
int X = (int) e.getX();
int Y = (int) e.getY();
for (int i = 0; i < x.length; i++) {
cRect.offsetTo(xToGlob(x[i]) - cXCenter, yToGlob(y[i]) - cYCenter);
if (cRect.contains(X, Y)) {
selIndex = i;
invalidate();
if (listener != null) {
listener.onCurvesChangeStart(CurvesView.this);
}
return true;
}
}
int pos = addPoint(xToNorm(X), yToNorm(Y));
if (pos >= 0) {
selIndex = pos;
prepareCurve();
invalidate();
if (listener != null) {
listener.onCurvesChangeStart(CurvesView.this);
listener.onCurvesChange(CurvesView.this);
}
return true;
}
return true;
}

boolean mhr.appandroid.views.CurvesView.GestureListener.onScroll | ( | MotionEvent | e1,
|  | MotionEvent | e2,
|  | float | distanceX,
|  | float | distanceY
| ) |  |
| inline

Definition at line 60 of file CurvesView.java.

{
if (selIndex < 0) {
return true;
} else {
float tmpx = x[selIndex] - (distanceX / xLength);
float tmpy = y[selIndex] - (distanceY / yLength);
if (selIndex == 0) {
x[selIndex] = 0;
y[selIndex] = (tmpy < 0) ? 0 : (tmpy > 1) ? 1 : tmpy;
} else if (selIndex == x.length - 1) {
x[selIndex] = 1;
y[selIndex] = (tmpy < 0) ? 0 : (tmpy > 1) ? 1 : tmpy;
} else {
tmpx = (tmpx < 0) ? 0 : (tmpx > 1) ? 1 : tmpx;
x[selIndex] = (tmpx - x[selIndex - 1]) < minDelta ? x[selIndex - 1] + minDelta : (x[selIndex + 1] - tmpx) < minDelta ? x[selIndex + 1] - minDelta : tmpx;
y[selIndex] = (tmpy < 0) ? 0 : (tmpy > 1) ? 1 : tmpy;
}
prepareCurve();
invalidate();
if (listener != null) {
listener.onCurvesChange(CurvesView.this);
}
}
return true;
}

The documentation for this class was generated from the following file:

- /home/xxx/eclipse_workspaces/app/appandroid/src/mhr/appandroid/views/CurvesView.java