Class WPointF

public class WPointF extends WJavaScriptExposableObject
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 Details

    • WPointF

      public WPointF()
      Creates point (0, 0).
    • WPointF

      public WPointF(double x, double y)
      Creates a point (x, y).
    • WPointF

      public WPointF(WPointF other)
      Copy constructor.
    • WPointF

      public WPointF(Coordinates other)
      Creates a point from mouse coordinates.
  • Method Details

    • clone

      public WPointF clone()
      Specified by:
      clone in class WJavaScriptExposableObject
    • 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

      public boolean equals(WPointF other)
      Indicates whether some other object is "equal to" this one.
    • getJsValue

      public String 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 class WJavaScriptExposableObject
    • swapHV

      public WPointF swapHV(double width)
    • inverseSwapHV

      public WPointF inverseSwapHV(double width)
    • assignFromJSON

      protected void assignFromJSON( value)
      Specified by:
      assignFromJSON in class WJavaScriptExposableObject