/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(short[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(byte[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(int[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
newlySelectedRows.add(i); if (!wasSelected) { modifiedRows.push(i); modifiedRows.push(i); modifiedRows.push(i); modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow); modifiedRows.push(oldState.getKeyboardSelectedRow()); modifiedRows.push(newState.keyboardSelectedRow);
public void push(short value) { if(GWT.isScript()) { stackNative.push(value); } else { stackJava.add(value); } }
public void push(int value) { if(GWT.isScript()) { stackNative.push(value); } else { stackJava.add(value); } }
public void setHiddenDays(final int... days) { if (days != null) { final JsArrayInteger intArr = (JsArrayInteger) JsArrayInteger.createArray(); for (final int i : days) { assert i >= 0 && i <= 6; intArr.push(i); } setHiddenDays(intArr); } }
static JsArrayInteger toIntegerArray(int... javaArray) { JsArrayInteger jsArray = JavaScriptObject.createArray().cast(); for (int integer : javaArray) { jsArray.push(integer); } return jsArray; }
static JsArrayInteger toIntegerArray(final Collection<Integer> collection) { JsArrayInteger array = JavaScriptObject.createArray().cast(); for (Integer integer : collection) { array.push(integer); } return array; }
public void setHiddenDays(final int... days) { if (days != null) { final JsArrayInteger intArr = (JsArrayInteger) JsArrayInteger.createArray(); for (final int i : days) { assert i >= 0 && i <= 6; intArr.push(i); } setHiddenDays(intArr); } }
protected int createObject(WebGLObject object, WebGLObjectType type) { // TODO (haustein) keep track of empty positions. // for (int i = 0; i < webGLObjects.size(); i++) { // if (webGLObjects.get(i) == null) { // webGLObjects.set(i, container); // return i; // } // } webGLObjects.push(object); webGLObjectTypes.push(type.ordinal()); return webGLObjects.length() - 1; }
/** * Array of keycodes which will add a tag when typing in the input. * (default: [13, 188], which are ENTER and comma) * * @param confirmKeys Array of keycodes */ public void setConfirmKeys(final List<Integer> confirmKeys) { JsArrayInteger keys = JsArrayInteger.createArray().cast(); for(int key : confirmKeys) { keys.push(key); } options.setConfirmKeys(keys); }
/** * Array of keycodes which will add a tag when typing in the input. * (default: [13, 188], which are ENTER and comma) * * @param confirmKeys Array of keycodes */ public void setConfirmKeys(final List<Integer> confirmKeys) { JsArrayInteger keys = JsArrayInteger.createArray().cast(); for(int key : confirmKeys) { keys.push(key); } options.setConfirmKeys(keys); }
HtmlGL20(WebGLRenderingContext gl) { this.gl = gl; webGLObjects.push(null); webGLObjectTypes.push(WebGLObjectType.NULL.ordinal()); elementBuffer = gl.createBuffer(); for (int i = 0; i < VERTEX_ATTRIB_ARRAY_COUNT; i++) { VertexAttribArrayState data = new VertexAttribArrayState(); data.webGlBuffer = gl.createBuffer(); vertexAttribArrayState[i] = data; } }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(byte[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(short[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(byte[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(int[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(short[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }
/** * Take a Java array, and produce a JS array that is only used for reading. As * this is actually a reference to the original array in prod mode, the source * must not be modified while this copy is in use or you will get different * behavior between DevMode and prod mode. * * @param array source array * @return JS array, which may be a copy or an alias of the input array */ public static JsArrayInteger readOnlyJsArray(int[] array) { if (GWT.isScript()) { return arrayAsJsArrayForProdMode(array).cast(); } JsArrayInteger dest = JsArrayInteger.createArray().cast(); for (int i = 0; i < array.length; ++i) { dest.push(array[i]); } return dest; }