public GwtController(int index, String name) { this.index = index; this.name = name; Gamepad gamepad = Gamepad.getGamepad(index); axes = new float[gamepad.getAxes().length()]; standardMapping = gamepad.getMapping().equals("standard"); }
JsArray<GamepadButton> buttons = gamepad.getButtons(); synchronized (eventQueue) { for (int i = 0, j = axes.length(); i < j; i++) { float oldAxis = controller.getAxis(i); float newAxis = (float)axes.get(i);
/** * Sets the property PanRange, confines the panning to stay within a range, receives as a parameter an array or a * null value */ public final T setPanRange( JsArrayNumber range ) { assert range.length() == 2 : "Array length must be 2"; put( PAN_RANGE_KEY, range ); return (T) this; }
/** * Sets the property of ZoomRange, the interval in which zooming can happen, receives as a parameter an array or a * null value */ public final T setZoomRange( JsArrayNumber range ) { assert range.length() == 2 : "Array length must be 2"; put( ZOOM_RANGE_KEY, range ); return (T) this; }
public static double[] toArray(JsArrayNumber values) { if (GWT.isScript()) { return reinterpretCast(values); } else { int length = values.length(); double[] ret = new double[length]; for (int i = 0, l = length; i < l; i++) { ret[i] = values.get(i); } return ret; } }
float[] getVertices() { int len = list.length(); assert len % 2 == 0; float[] vertices = new float[len]; for (int v = 0; v < len;) { int cmd = (int) list.get(v); if (v == vertices.length -2) { assert cmd == CMD_CLOSE; } else { assert cmd == CMD_MOVE; } vertices[v] = (float) list.get(v + 1); vertices[v+1] = (float) list.get(v + 2); } return vertices; }
float[] getVertices() { int len = list.length(); assert len % 2 == 0; float[] vertices = new float[len]; for (int v = 0; v < len;) { int cmd = (int) list.get(v); if (v == vertices.length -2) { assert cmd == CMD_CLOSE; } else { assert cmd == CMD_MOVE; } vertices[v] = (float) list.get(v + 1); vertices[v+1] = (float) list.get(v + 2); } return vertices; }
float[] getVertices() { int len = list.length(); assert len % 2 == 0; float[] vertices = new float[len]; for (int v = 0; v < len;) { int cmd = (int) list.get(v); if (v == vertices.length -2) { assert cmd == CMD_CLOSE; } else { assert cmd == CMD_MOVE; } vertices[v] = (float) list.get(v + 1); vertices[v+1] = (float) list.get(v + 2); } return vertices; }
private List<Double> getNumberArrayAttribute(SliderOption option, List<Double> defaultValue) { // Get array attribute JsArrayNumber array = null; if (isAttached()) { array = getNumberArrayAttribute(getElement(), option.getName()); } else { String value = attributeMixin.getAttribute(option.getDataAttribute()); if (value != null && !value.isEmpty()) { array = JsonUtils.safeEval(value); } } // Attribute not set if (array == null) { return defaultValue; } // Put array to list List<Double> list = new ArrayList<Double>(array.length()); for (int i = 0; i < array.length(); i++) { list.add(array.get(i)); } return list; }
private List<Double> getNumberArrayAttribute(SliderOption option, List<Double> defaultValue) { // Get array attribute JsArrayNumber array = null; if (isAttached()) { array = getNumberArrayAttribute(getElement(), option.getName()); } else { String value = attributeMixin.getAttribute(option.getDataAttribute()); if (value != null && !value.isEmpty()) { array = JsonUtils.safeEval(value); } } // Attribute not set if (array == null) { return defaultValue; } // Put array to list List<Double> list = new ArrayList<Double>(array.length()); for (int i = 0; i < array.length(); i++) { list.add(array.get(i)); } return list; }
void replay(Path path) { path.reset(); int len = list.length(), i = 0; float x = 0, y = 0; while (i < len) {
void replay(Context2d ctx) { ctx.beginPath(); int len = list.length(), i = 0; double x = 0, y = 0; while (i < len) {
void replay(Context2d ctx) { ctx.beginPath(); int len = list.length(), i = 0; double x = 0, y = 0; while (i < len) {
void replay(Context2d ctx) { ctx.beginPath(); int len = list.length(), i = 0; double x = 0, y = 0; while (i < len) {
void replay(Path path) { path.reset(); int len = list.length(), i = 0; float x = 0, y = 0; while (i < len) {
void replay(Path path) { path.reset(); int len = list.length(), i = 0; float x = 0, y = 0; while (i < len) {