Class Shapes
java.lang.Object
com.codename1.art.Shapes
Paths for the basic shapes.
-
Method Summary
Modifier and TypeMethodDescriptionstatic GeneralPathellipse(double cx, double cy, double rx, double ry) An ellipse.static GeneralPathpolygon(double[] pts, boolean close) A polygon or polyline through points given asx0, y0, x1, y1, ....static GeneralPathroundRect(double x, double y, double w, double h, double[] r) A rectangle with each corner rounded by its own radius, clockwise from top left.static GeneralPathroundRect(double x, double y, double w, double h, double rx, double ry) A rectangle with corners rounded byrxhorizontally andryvertically.static GeneralPathstar(double cx, double cy, double outer, double inner, int points) A regular star or polygon.static GeneralPathtransform(GeneralPath path, Matrix m) Returns a copy ofpathwith every point mapped throughm.
-
Method Details
-
roundRect
A rectangle with corners rounded by
rxhorizontally andryvertically.Parameters
x: lefty: topw: widthh: heightrx: horizontal corner radiusry: vertical corner radius
-
roundRect
A rectangle with each corner rounded by its own radius, clockwise from top left.
Parameters
x: lefty: topw: widthh: heightr: four radii: top left, top right, bottom right, bottom left
-
ellipse
An ellipse.
Parameters
cx: center xcy: center yrx: horizontal radiusry: vertical radius
-
polygon
A polygon or polyline through points given as
x0, y0, x1, y1, ....Parameters
pts: the pointsclose: true to close it
-
star
A regular star or polygon.
Parameters
cx: center xcy: center youter: outer radiusinner: inner radius; equal toouterfor a plain polygonpoints: number of points, at least 3
-
transform
Returns a copy of
pathwith every point mapped throughm.Parameters
path: the sourcem: the transform
-