Class WPolygonArea


public class WPolygonArea extends WAbstractArea
An interactive area in a widget, specified by a polygon.

The area may be added to a WImage or WPaintedWidget to provide interactivity on a polygon area of the image. The polygon is specified in pixel coordinates, and uses an even-odd winding rule (overlaps create holes).

The polygon area corresponds to the HTML <area shape="poly"> tag.

See Also:
  • Constructor Details

    • WPolygonArea

      public WPolygonArea()
      Creates an empty polygon.

      Defines an empty polygon.

    • WPolygonArea

      public WPolygonArea(List<WPoint> points)
      Creates a polygon area with given vertices.

      The polygon is defined with vertices corresponding to points. The polygon is closed by connecting the last point with the first point.

  • Method Details

    • addPoint

      public void addPoint(int x, int y)
      Adds a point.
    • addPoint

      public void addPoint(double x, double y)
      Adds a point.
    • addPoint

      public void addPoint(WPoint point)
      Adds a point.
    • addPoint

      public void addPoint(WPointF point)
      Adds a point.
    • setPoints

      public void setPoints(List<WPoint> points)
      Sets the polygon vertices.

      The polygon is defined with vertices corresponding to points. The polygon is closed by connecting the last point with the first point.

    • getPointFs

      public List<WPointF> getPointFs()
      Returns the polygon vertices.

      See Also:
    • getPoints

      public List<WPoint> getPoints()
      Returns the polygon vertices.

      See Also:
    • updateDom

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

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