Package eu.webtoolkit.jwt
Class WPolygonArea
java.lang.Object
eu.webtoolkit.jwt.WObject
eu.webtoolkit.jwt.WAbstractArea
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.
-
Nested Class Summary
Nested classes/interfaces inherited from class eu.webtoolkit.jwt.WObject
WObject.FormData
-
Constructor Summary
Constructors Constructor Description WPolygonArea()
Creates an empty polygon.WPolygonArea(java.util.List<WPoint> points)
Creates a polygon area with given vertices. -
Method Summary
Modifier and Type Method Description 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<WPointF>
getPointFs()
Returns the polygon vertices.java.util.List<WPoint>
getPoints()
Returns the polygon vertices.protected java.lang.String
getUpdateAreaCoordsJS()
void
setPoints(java.util.List<WPoint> points)
Sets the polygon vertices.protected boolean
updateDom(DomElement element, boolean all)
Methods inherited from class eu.webtoolkit.jwt.WAbstractArea
addStyleClass, clicked, doubleClicked, enterPressed, escapePressed, getAlternateText, getCursor, getJsRef, getLink, getRef, getResource, getStyleClass, getTarget, getToolTip, isHole, isTransformable, keyPressed, keyWentDown, keyWentUp, mouseDragged, mouseMoved, mouseWentDown, mouseWentOut, mouseWentOver, mouseWentUp, mouseWheel, remove, removeStyleClass, setAlternateText, setCursor, setCursor, setCursor, setHole, setLink, setRef, setResource, setStyleClass, setTarget, setToolTip, setTransformable
Methods inherited from class eu.webtoolkit.jwt.WObject
addChild, getId, getObjectName, setFormData, setObjectName, tr
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
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:
setPoints(List points)
,getPoints()
-
getPoints
Returns the polygon vertices.- See Also:
setPoints(List points)
,getPointFs()
-
updateDom
- Overrides:
updateDom
in classWAbstractArea
-
getUpdateAreaCoordsJS
protected java.lang.String getUpdateAreaCoordsJS()- Specified by:
getUpdateAreaCoordsJS
in classWAbstractArea
-