Package eu.webtoolkit.jwt
Class WPolygonArea
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WAbstractArea
eu.webtoolkit.jwt.WPolygonArea
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
ConstructorDescriptionCreates an empty polygon.WPolygonArea
(List<WPoint> points) Creates a polygon area with given vertices. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPoint
(double x, double y) Adds a point.void
addPoint
(int x, int y) Adds a point.void
Adds a point.void
Adds a point.Returns the polygon vertices.Returns the polygon vertices.protected String
void
Sets the polygon vertices.protected boolean
updateDom
(DomElement element, boolean all) Methods inherited from class eu.webtoolkit.jwt.WAbstractArea
addStyleClass, addStyleClass, clicked, doubleClicked, enterPressed, escapePressed, getAlternateText, getCursor, getJsRef, getLink, getStyleClass, getToolTip, isHole, isTransformable, keyPressed, keyWentDown, keyWentUp, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, removeStyleClass, removeStyleClass, setAlternateText, setCursor, setCursor, setCursor, setHole, setLink, setStyleClass, setToolTip, setTransformable
Methods inherited from class eu.webtoolkit.jwt.WObject
getId, getObjectName, remove, setFormData, setObjectName, tr
-
Constructor Details
-
WPolygonArea
public WPolygonArea()Creates an empty polygon.Defines an empty polygon.
-
WPolygonArea
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
Adds a point. -
addPoint
Adds a point. -
setPoints
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
Returns the polygon vertices.- See Also:
-
getPoints
Returns the polygon vertices.- See Also:
-
updateDom
- Overrides:
updateDom
in classWAbstractArea
-
getUpdateAreaCoordsJS
- Specified by:
getUpdateAreaCoordsJS
in classWAbstractArea
-