diff options
| author | Tadashi G. Takaoka <takaoka@google.com> | 2011-06-22 11:53:02 +0900 |
|---|---|---|
| committer | Tadashi G. Takaoka <takaoka@google.com> | 2011-06-22 11:54:00 +0900 |
| commit | 72934bd5967d0127f71fd4d66158b18b4e6ceefe (patch) | |
| tree | 2e4d6eb1dd04633a42954ebd198d9260a48d77db /java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java | |
| parent | 0150be2a9b5e4a8af3ecab485299507c3d0772c7 (diff) | |
Move keyboard related internal class to separate package
Change-Id: Ic1459066b865cde5104b3734193f76c997959c68
Diffstat (limited to 'java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java')
| -rw-r--r-- | java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java | 98 |
1 files changed, 0 insertions, 98 deletions
diff --git a/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java b/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java deleted file mode 100644 index eecbb26f3..000000000 --- a/java/src/com/android/inputmethod/keyboard/PointerTrackerKeyState.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (C) 2010 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not - * use this file except in compliance with the License. You may obtain a copy of - * the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT - * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the - * License for the specific language governing permissions and limitations under - * the License. - */ - -package com.android.inputmethod.keyboard; - -/** - * This class keeps track of a key index and a position where {@link PointerTracker} is. - */ -/* package */ class PointerTrackerKeyState { - private final KeyDetector mKeyDetector; - - // The position and time at which first down event occurred. - private long mDownTime; - private long mUpTime; - - // The current key index where this pointer is. - private int mKeyIndex = KeyDetector.NOT_A_KEY; - // The position where mKeyIndex was recognized for the first time. - private int mKeyX; - private int mKeyY; - - // Last pointer position. - private int mLastX; - private int mLastY; - - public PointerTrackerKeyState(KeyDetector keyDetecor) { - mKeyDetector = keyDetecor; - } - - public int getKeyIndex() { - return mKeyIndex; - } - - public int getKeyX() { - return mKeyX; - } - - public int getKeyY() { - return mKeyY; - } - - public long getDownTime() { - return mDownTime; - } - - public long getUpTime() { - return mUpTime; - } - - public int getLastX() { - return mLastX; - } - - public int getLastY() { - return mLastY; - } - - public int onDownKey(int x, int y, long eventTime) { - mDownTime = eventTime; - return onMoveToNewKey(onMoveKeyInternal(x, y), x, y); - } - - private int onMoveKeyInternal(int x, int y) { - mLastX = x; - mLastY = y; - return mKeyDetector.getKeyIndexAndNearbyCodes(x, y, null); - } - - public int onMoveKey(int x, int y) { - return onMoveKeyInternal(x, y); - } - - public int onMoveToNewKey(int keyIndex, int x, int y) { - mKeyIndex = keyIndex; - mKeyX = x; - mKeyY = y; - return keyIndex; - } - - public int onUpKey(int x, int y, long eventTime) { - mUpTime = eventTime; - mKeyIndex = KeyDetector.NOT_A_KEY; - return onMoveKeyInternal(x, y); - } -} |
