/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { for (int i = 0; i < touches.length; i++) { string += "\n " + touches[i].toString(); } string += "\n"; } string += "}"; return string; } }
int deviceX = (int) (normalizedX * deviceSize.width); int deviceY = (int) (normalizedY * deviceSize.height); Touch newTS = new Touch(identity, source, state, primary, deviceX, deviceY); return newTS;
void sendTouchEvent (TOUCHINPUT touchInput []) { Event event = new Event (); POINT pt = new POINT (); OS.GetCursorPos (pt); OS.ScreenToClient (handle, pt); event.setLocationInPixels(pt.x, pt.y); Touch [] touches = new Touch [touchInput.length]; Monitor monitor = getMonitor (); for (int i = 0; i < touchInput.length; i++) { TOUCHINPUT ti = touchInput [i]; TouchSource inputSource = display.findTouchSource (ti.hSource, monitor); int state = 0; if ((ti.dwFlags & OS.TOUCHEVENTF_DOWN) != 0) state = SWT.TOUCHSTATE_DOWN; if ((ti.dwFlags & OS.TOUCHEVENTF_UP) != 0) state = SWT.TOUCHSTATE_UP; if ((ti.dwFlags & OS.TOUCHEVENTF_MOVE) != 0) state = SWT.TOUCHSTATE_MOVE; boolean primary = (ti.dwFlags & OS.TOUCHEVENTF_PRIMARY) != 0; int x = (int)OS.TOUCH_COORD_TO_PIXEL (ti.x); int y = (int)OS.TOUCH_COORD_TO_PIXEL (ti.y); touches [i] = new Touch (ti.dwID, inputSource, state, primary, x, y); } event.touches = touches; setInputState (event, SWT.Touch); postEvent (SWT.Touch, event); }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ @Override public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { for (int i = 0; i < touches.length; i++) { string += "\n " + touches[i].toString(); } string += "\n"; } string += "}"; return string; } }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ public String toString() { String string = super.toString(); string = string.substring( 0, string.length() - 1 ); // remove trailing '}' string += " stateMask=" + stateMask + " x=" + x + " y=" + y; if( touches != null ) { for( int i = 0; i < touches.length; i++ ) { string += "\n " + touches[ i ].toString(); } string += "\n"; } string += "}"; return string; } }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ @Override public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { for (int i = 0; i < touches.length; i++) { string += "\n " + touches[i].toString(); } string += "\n"; } string += "}"; return string; } }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ @Override public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { for (int i = 0; i < touches.length; i++) { string += "\n " + touches[i].toString(); } string += "\n"; } string += "}"; return string; } }
/** * Returns a string containing a concise, human-readable * description of the receiver. * * @return a string representation of the event */ @Override public String toString() { String string = super.toString(); string = string.substring (0, string.length() - 1); // remove trailing '}' string += " stateMask=0x" + Integer.toHexString(stateMask) + " x=" + x + " y=" + y; if (touches != null) { for (int i = 0; i < touches.length; i++) { string += "\n " + touches[i].toString(); } string += "\n"; } string += "}"; return string; } }