Package eu.webtoolkit.jwt
Class WGLWidget.JavaScriptVector
java.lang.Object
eu.webtoolkit.jwt.WGLWidget.JavaScriptVector
- Enclosing class:
- WGLWidget
public static class WGLWidget.JavaScriptVector
extends java.lang.Object
A client-side JavaScript vector.
Using a WGLWidget.JavaScriptVector
, GL parameters can be modified without communication with
the server. The value of the WGLWidget.JavaScriptMatrix4x4
is updated server-side whenever an
event is sent to the server.
The WGLWidget.JavaScriptVector
is represented in JavaScript as an array, either as a
Float32Array or as a plain JavaScript array.
-
Constructor Summary
Constructors Constructor Description JavaScriptVector(int length)
Create a temporarily invalidWGLWidget.JavaScriptVector
. -
Method Summary
Modifier and Type Method Description int
getId()
java.lang.String
getJsRef()
Returns the JavaScript reference to thisWGLWidget.JavaScriptVector
.int
getLength()
Returns the length (number of items) of thisWGLWidget.JavaScriptVector
.java.util.List<java.lang.Float>
getValue()
Returns the current server-side value.boolean
hasContext()
Returns whether this JavaScriptVector has been assigned to aWGLWidget
.boolean
isInitialized()
Returns whether this JavaScriptVector has been initialized.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
JavaScriptVector
public JavaScriptVector(int length)Create a temporarily invalidWGLWidget.JavaScriptVector
.Should be added to a WGLWidget with
WGLWidget#addJavaScriptVector()
, and initialized withWGLWidget#initJavaScriptVector()
.
-
-
Method Details
-
getId
public int getId() -
isInitialized
public boolean isInitialized()Returns whether this JavaScriptVector has been initialized. -
hasContext
public boolean hasContext()Returns whether this JavaScriptVector has been assigned to aWGLWidget
. -
getLength
public int getLength()Returns the length (number of items) of thisWGLWidget.JavaScriptVector
. -
getJsRef
public java.lang.String getJsRef()Returns the JavaScript reference to thisWGLWidget.JavaScriptVector
.In order to get a valid JavaScript reference, this vector should have been added to a
WGLWidget
. -
getValue
public java.util.List<java.lang.Float> getValue()Returns the current server-side value.Client-side changes to the
WGLWidget.JavaScriptVector
are automatically synchronized.
-