Lines Matching refs:ps

173         PointerState ps = new PointerState();
174 mPointers.add(ps);
232 final PointerState ps = mPointers.get(mActivePointerId);
240 final int N = ps.mTraceCount;
241 if ((mCurDown && ps.mCurDown) || N == 0) {
244 .append("X: ").append(ps.mCoords.x, 1)
248 .append("Y: ").append(ps.mCoords.y, 1)
251 float dx = ps.mTraceX[N - 1] - ps.mTraceX[0];
252 float dy = ps.mTraceY[N - 1] - ps.mTraceY[0];
269 .append("Xv: ").append(ps.mXVelocity, 3)
274 .append("Yv: ").append(ps.mYVelocity, 3)
278 canvas.drawRect(itemW * 5, 0, (itemW * 5) + (ps.mCoords.pressure * itemW) - 1,
281 .append("Prs: ").append(ps.mCoords.pressure, 2)
285 canvas.drawRect(itemW * 6, 0, (itemW * 6) + (ps.mCoords.size * itemW) - 1,
288 .append("Size: ").append(ps.mCoords.size, 2)
294 final PointerState ps = mPointers.get(p);
297 final int N = ps.mTraceCount;
303 float x = ps.mTraceX[i];
304 float y = ps.mTraceY[i];
311 final Paint paint = ps.mTraceCurrent[i] ? mCurrentPointPaint : mPaint;
323 float lx = ps.mEstimator.estimateX(-ESTIMATE_PAST_POINTS * ESTIMATE_INTERVAL);
324 float ly = ps.mEstimator.estimateY(-ESTIMATE_PAST_POINTS * ESTIMATE_INTERVAL);
326 float x = ps.mEstimator.estimateX(i * ESTIMATE_INTERVAL);
327 float y = ps.mEstimator.estimateY(i * ESTIMATE_INTERVAL);
335 float xVel = ps.mXVelocity * (1000 / 60);
336 float yVel = ps.mYVelocity * (1000 / 60);
342 lx = ps.mAltEstimator.estimateX(-ESTIMATE_PAST_POINTS * ESTIMATE_INTERVAL);
343 ly = ps.mAltEstimator.estimateY(-ESTIMATE_PAST_POINTS * ESTIMATE_INTERVAL);
345 float x = ps.mAltEstimator.estimateX(i * ESTIMATE_INTERVAL);
346 float y = ps.mAltEstimator.estimateY(i * ESTIMATE_INTERVAL);
353 xVel = ps.mAltXVelocity * (1000 / 60);
354 yVel = ps.mAltYVelocity * (1000 / 60);
359 if (mCurDown && ps.mCurDown) {
361 canvas.drawLine(0, ps.mCoords.y, getWidth(), ps.mCoords.y, mTargetPaint);
362 canvas.drawLine(ps.mCoords.x, 0, ps.mCoords.x, getHeight(), mTargetPaint);
365 int pressureLevel = (int)(ps.mCoords.pressure * 255);
367 canvas.drawPoint(ps.mCoords.x, ps.mCoords.y, mPaint);
371 drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.touchMajor,
372 ps.mCoords.touchMinor, ps.mCoords.orientation, mPaint);
376 drawOval(canvas, ps.mCoords.x, ps.mCoords.y, ps.mCoords.toolMajor,
377 ps.mCoords.toolMinor, ps.mCoords.orientation, mPaint);
380 float arrowSize = ps.mCoords.toolMajor * 0.7f;
385 float orientationVectorX = (float) (Math.sin(ps.mCoords.orientation)
387 float orientationVectorY = (float) (-Math.cos(ps.mCoords.orientation)
389 if (ps.mToolType == MotionEvent.TOOL_TYPE_STYLUS
390 || ps.mToolType == MotionEvent.TOOL_TYPE_ERASER) {
392 canvas.drawLine(ps.mCoords.x, ps.mCoords.y,
393 ps.mCoords.x + orientationVectorX,
394 ps.mCoords.y + orientationVectorY,
399 ps.mCoords.x - orientationVectorX,
400 ps.mCoords.y - orientationVectorY,
401 ps.mCoords.x + orientationVectorX,
402 ps.mCoords.y + orientationVectorY,
408 ps.mCoords.getAxisValue(MotionEvent.AXIS_TILT));
410 ps.mCoords.x + orientationVectorX * tiltScale,
411 ps.mCoords.y + orientationVectorY * tiltScale,
415 if (ps.mHasBoundingBox) {
416 canvas.drawRect(ps.mBoundingLeft, ps.mBoundingTop,
417 ps.mBoundingRight, ps.mBoundingBottom, mPaint);
536 final PointerState ps = mPointers.get(p);
537 ps.clearTrace();
538 ps.mCurDown = false;
556 PointerState ps = new PointerState();
557 mPointers.add(ps);
566 final PointerState ps = mPointers.get(id);
567 ps.mCurDown = true;
569 ps.mHasBoundingBox = device != null &&
586 final PointerState ps = mCurDown ? mPointers.get(id) : null;
587 final PointerCoords coords = ps != null ? ps.mCoords : mTempCoords;
592 if (ps != null) {
593 ps.addTrace(coords.x, coords.y, false);
599 final PointerState ps = mCurDown ? mPointers.get(id) : null;
600 final PointerCoords coords = ps != null ? ps.mCoords : mTempCoords;
605 if (ps != null) {
606 ps.addTrace(coords.x, coords.y, true);
607 ps.mXVelocity = mVelocity.getXVelocity(id);
608 ps.mYVelocity = mVelocity.getYVelocity(id);
609 mVelocity.getEstimator(id, ps.mEstimator);
611 ps.mAltXVelocity = mAltVelocity.getXVelocity(id);
612 ps.mAltYVelocity = mAltVelocity.getYVelocity(id);
613 mAltVelocity.getEstimator(id, ps.mAltEstimator);
615 ps.mToolType = event.getToolType(i);
617 if (ps.mHasBoundingBox) {
618 ps.mBoundingLeft = event.getAxisValue(MotionEvent.AXIS_GENERIC_1, i);
619 ps.mBoundingTop = event.getAxisValue(MotionEvent.AXIS_GENERIC_2, i);
620 ps.mBoundingRight = event.getAxisValue(MotionEvent.AXIS_GENERIC_3, i);
621 ps.mBoundingBottom = event.getAxisValue(MotionEvent.AXIS_GENERIC_4, i);
633 final PointerState ps = mPointers.get(id);
634 ps.mCurDown = false;
645 ps.addTrace(Float.NaN, Float.NaN, false);