eu.webtoolkit.jwt
Class WPolygonArea

java.lang.Object
  extended by eu.webtoolkit.jwt.WObject
      extended by eu.webtoolkit.jwt.WAbstractArea
          extended by eu.webtoolkit.jwt.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:
WImage.addArea(WAbstractArea area), WPaintedWidget.addArea(WAbstractArea area), WCircleArea, WRectArea

Constructor Summary
WPolygonArea()
          Creates an empty polygon.
WPolygonArea(java.util.List<WPoint> points)
          Creates a polygon area with given vertices.
 
Method Summary
 void addPoint(double x, double y)
          Adds a point.
 void addPoint(int x, int y)
          Adds a point.
 void addPoint(WPoint point)
          Adds a point.
 void addPoint(WPointF point)
          Adds a point.
 java.util.List<WPoint> getPoints()
          Returns the polygon vertices.
 void setPoints(java.util.List<WPoint> points)
          Sets the polygon vertices.
 
Methods inherited from class eu.webtoolkit.jwt.WAbstractArea
addStyleClass, clicked, doubleClicked, enterPressed, escapePressed, getAlternateText, getCursor, getLink, getRef, getResource, getStyleClass, getTarget, getToolTip, isHole, keyPressed, keyWentDown, keyWentUp, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, removeStyleClass, setAlternateText, setCursor, setHole, setLink, setRef, setResource, setStyleClass, setTarget, setToolTip
 
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, remove, setObjectName, tr
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WPolygonArea

public WPolygonArea()
Creates an empty polygon.

Defines an empty polygon.


WPolygonArea

public WPolygonArea(java.util.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 Detail

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(java.util.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.


getPoints

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

See Also:
setPoints(List points)