public final class JsHelper extends Object
Modifier and Type | Method and Description |
---|---|
static JsHelper |
get()
Singleton object to get the helper instance
|
<T> CallbackProxy<T> |
newCallbackProxy()
Creates new proxy for callback which will pass
this environment of java script as first argument of callback
method. |
double |
propertyAsDouble(Object object,
String key)
Returns a property of java script object as double.
|
int |
propertyAsInt(Object object,
String key)
Returns a property of java script object as integer.
|
String |
propertyAsString(Object object,
String key)
Returns a property of java script object as string.
|
void |
setLineDash(Context2d context,
ArrayInteger object)
Sets the line dash pattern used when stroking lines.
It uses an array of values that specify alternating lengths of lines and gaps which describe the pattern. |
void |
setLineDash(Context2d context,
List<Integer> items)
Sets the line dash pattern used when stroking lines.
It uses a list of values that specify alternating lengths of lines and gaps which describe the pattern. |
void |
setLineDashOffset(Context2d context,
int offset)
Sets the line dash offset, or "phase."
|
ObjectType |
typeOf(Object object)
Returns the java script object type of object.
|
ObjectType |
typeOf(Object object,
String key)
Returns the java script object type of a property.
|
Object |
undefined()
Returns an undefined reference
|
public static JsHelper get()
public Object undefined()
public ObjectType typeOf(Object object)
object
- the object to get type.public ObjectType typeOf(Object object, String key)
object
- the object on which to search the property.key
- the string name of the property to test.public <T> CallbackProxy<T> newCallbackProxy()
this
environment of java script as first argument of callback
method.T
- type of callback wrapped by proxypublic int propertyAsInt(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.INTEGER
if arguments are not consistentpublic double propertyAsDouble(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.DOUBLE
if arguments are not consistentpublic String propertyAsString(Object object, String key)
object
- the object on which to define the property.key
- the string name of the property to be defined or modified..UndefinedValues.STRING
if arguments are not consistentpublic void setLineDashOffset(Context2d context, int offset)
context
- context of canvasoffset
- the line dash offset, or "phase."public void setLineDash(Context2d context, List<Integer> items)
context
- context of canvasitems
- list of values that specify alternating lengths of lines and gaps which describe the patternpublic void setLineDash(Context2d context, ArrayInteger object)
context
- context of canvasobject
- array of values that specify alternating lengths of lines and gaps which describe the pattern