public static void pollGamepads() { JsArray<Gamepad> currentGamepads = nativePollGamepads(); if (currentGamepads != null) { gamepadsTemp.clear(); gamepadsTemp.putAll(gamepads); for (int i = 0, j = currentGamepads.length(); i < j; i++) { Gamepad gamepad = currentGamepads.get(i); if (gamepad != null) { if (!gamepadsTemp.containsKey(gamepad.getIndex())) { onGamepadConnect(gamepad); } gamepadsTemp.remove(gamepad.getIndex()); } } for (Gamepad gamepad : gamepadsTemp.values()) { onGamepadDisconnect(gamepad); } } }
JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId; JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real);
JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId; JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real); JsArray<Touch> touches = e.getChangedTouches(); for (int i = 0, j = touches.length(); i < j; i++) { Touch touch = touches.get(i); int real = touch.getIdentifier(); int touchId = touchMap.get(real);
float newButton = (float)buttons.get(i).getValue(); if (controller.isStandardMapping() && i >= STANDARD_CONTROLLER_DPAD_UP && i <= STANDARD_CONTROLLER_DPAD_RIGHT) { int direction = controller.pov;
/** * @deprecated Call and override {@link #getRow(Element, int)} instead. */ @Deprecated protected com.google.gwt.user.client.Element getRow( com.google.gwt.user.client.Element tbody, int row) { return DOM.asOld(impl.getRows(tbody).get(row)); }
/** * Get touch from event. * * @param event the event * @return the touch object */ protected Touch getTouchFromEvent(TouchEvent<?> event) { JsArray<Touch> touches = event.getTouches(); return (touches.length() > 0) ? touches.get(0) : null; }
/** * @deprecated Call and override {@link #getDOMCellCount(Element, int)} instead. */ @Deprecated protected int getDOMCellCount(com.google.gwt.user.client.Element tableBody, int row) { Element rowElement = impl.getRows(tableBody).get(row); return impl.getCells(rowElement).length(); }
@Override public StackTraceElement[] getStackTrace(Object t) { JsArray<JsArrayString> stack = getFnStack(t).cast(); StackTraceElement[] stackTrace = new StackTraceElement[stack.length()]; for (int i = 0; i < stackTrace.length; i++) { JsArrayString frame = stack.get(i); String name = frame.get(0); String location = frame.get(1); String fileName = null; int lineNumber = LINE_NUMBER_UNKNOWN; if (location != null) { int idx = location.indexOf(':'); if (idx != -1) { fileName = location.substring(0, idx); lineNumber = parseInt(location.substring(idx + 1)); } else { lineNumber = parseInt(location); } } stackTrace[i] = new StackTraceElement(UNKNOWN, name, fileName, lineNumber); } return stackTrace; } }
void addCells(Element tbody, int row, int num) { com.google.gwt.dom.client.Element rowElem = impl.getRows(tbody).get(row); for (int i = 0; i < num; i++) { TableCellElement tdElement = Document.get().createTDElement(); rowElem.appendChild(tdElement); } }
assert tasks.length() == j : "Working array length changed " + tasks.length() + " != " + j; Task t = tasks.get(i);
public List<Patch> getPatches() { LinkedList<Patch> pali = new LinkedList<Patch>(); for (int i=0; i<patches.length(); ++i) { pali.add(patches.get(i)); } return pali; }
public final List<JSNodeMarker> getAllChildMarkers() { final List<JSNodeMarker> markers = new ArrayList<>(); final JsArray<JSObject> markerObjects = getMarkerObjects(); if (markerObjects == null) return markers; for (int i = 0; i < markerObjects.length(); i++) { final JSObject markerObject = markerObjects.get(i); final JSNodeMarker marker = new JSNodeMarker(markerObject); markers.add(marker); } return markers; }
@Override public void call(GWTVertex vertex, int index) { SVGElement elem = elemArray.get(index).cast(); boolean selected = inSelection(elem); vertex.setSelected(selected); } });
private int findIndex(GWTVertex vertex) { for(int i = 0; i < getVertices().length(); i++) { GWTVertex v = getVertices().get(i); if(v.getId().equals(vertex.getId())) { return i; } } return -1; }
@Override public void onTouchMove(TouchMoveEvent event) { setValueContrained(event.getTouches().get(0).getClientX()); event.stopPropagation(); event.preventDefault(); }
private BoundingRect createBoundingRect(JsArray<GWTVertex> vertices, boolean fitToView) { final BoundingRect rect = new BoundingRect(); for(int i = 0; i < vertices.length(); i++) { GWTVertex vertex = vertices.get(i); if(fitToView || vertex.isSelected()) { double vertexX = vertex.getX(); double vertexY = vertex.getY(); rect.addPoint(new Point(vertexX, vertexY)); } } return rect; }