Class WRectArea


public class WRectArea extends WAbstractArea
A interactive area in a widget, specified by a rectangle.

The area may be added to a WImage or WPaintedWidget to provide interactivity on a rectangular area of the image. The rectangle is specified in pixel coordinates.

See Also:
  • Constructor Details

    • WRectArea

      public WRectArea()
      Default constructor.

      The default constructor creates a rectangular area spans the whole widget.

    • WRectArea

      public WRectArea(int x, int y, int width, int height)
      Creates a rectangular area with given geometry.

      The arguments are in pixel units.

    • WRectArea

      public WRectArea(double x, double y, double width, double height)
      Creates a rectangular area with given geometry.

      The arguments are in pixel units.

    • WRectArea

      public WRectArea(WRectF rect)
      Creates a rectangular area with given geometry.

      The rect argument is in pixel units.

  • Method Details

    • setX

      public void setX(int x)
      Sets the top-left X coordinate.
    • getX

      public int getX()
      Returns the top-left X coordinate.
    • setY

      public void setY(int y)
      Sets the top-left Y coordinate.
    • getY

      public int getY()
      Returns the top-left Y coordinate.
    • setWidth

      public void setWidth(int width)
      Sets the width.
    • getWidth

      public int getWidth()
      Returns the width.
    • setHeight

      public void setHeight(int height)
      Sets the height.
    • getHeight

      public int getHeight()
      Returns the height.
    • updateDom

      protected boolean updateDom(DomElement element, boolean all)
      Overrides:
      updateDom in class WAbstractArea
    • getUpdateAreaCoordsJS

      protected String getUpdateAreaCoordsJS()
      Specified by:
      getUpdateAreaCoordsJS in class WAbstractArea