Package eu.webtoolkit.jwt
Class WPointF
java.lang.Object
eu.webtoolkit.jwt.WJavaScriptExposableObject
eu.webtoolkit.jwt.WPointF
A value class that defines a 2D point.
JavaScript exposability
A WPointF is JavaScript exposable. If a WPointF is JavaScript bound
, it can be accessed in your
custom JavaScript code through its handle's jsRef()
. A
point is represented in JavaScript as an array of two elements, e.g. a point WPointF(10,20) will
be represented in JavaScript as:
[10, 20]
Warning: A WPointF that is JavaScript exposed should be modified only through its
handle
. Any attempt at modifying it will cause an exception to be
thrown.
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
assignFromJSON
(com.google.gson.JsonElement value) clone()
boolean
Indicates whether some other object is "equal to" this one.Returns a JavaScript representation of the value of this object.double
getX()
Returns the X coordinate.double
getY()
Returns the Y coordinate.inverseSwapHV
(double width) void
setX
(double x) Sets the X coordinate.void
setY
(double y) Sets the Y coordinate.swapHV
(double width) Methods inherited from class eu.webtoolkit.jwt.WJavaScriptExposableObject
assignBinding, assignBinding, checkModifiable, closeTo, getJsRef, isJavaScriptBound, sameBindingAs
-
Constructor Details
-
WPointF
public WPointF()Creates point (0, 0). -
WPointF
public WPointF(double x, double y) Creates a point (x, y). -
WPointF
Copy constructor. -
WPointF
Creates a point from mouse coordinates.
-
-
Method Details
-
clone
- Specified by:
clone
in classWJavaScriptExposableObject
-
setX
public void setX(double x) Sets the X coordinate. -
setY
public void setY(double y) Sets the Y coordinate. -
getX
public double getX()Returns the X coordinate. -
getY
public double getY()Returns the Y coordinate. -
equals
Indicates whether some other object is "equal to" this one. -
getJsValue
Description copied from class:WJavaScriptExposableObject
Returns a JavaScript representation of the value of this object.Note: The value returned will reflect the current server side value of the object. If this object is JavaScript bound, this value may not reflect the actual client side value. If you need access to the client side value, use
getJsRef()
intead.- Specified by:
getJsValue
in classWJavaScriptExposableObject
-
swapHV
-
inverseSwapHV
-
assignFromJSON
protected void assignFromJSON(com.google.gson.JsonElement value) - Specified by:
assignFromJSON
in classWJavaScriptExposableObject
-