Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.

public final class Shapes

  1. Object
  2. Shapes
Paths for the basic shapes.

Methods

public static GeneralPath roundRect(double x, double y, double w, double h, double rx, double ry)A rectangle with corners rounded by rx horizontally and ry vertically.
public static GeneralPath roundRect(double x, double y, double w, double h, double[] r)A rectangle with each corner rounded by its own radius, clockwise from top left.
public static GeneralPath ellipse(double cx, double cy, double rx, double ry)An ellipse.
public static GeneralPath polygon(double[] pts, boolean close)A polygon or polyline through points given as x0, y0, x1, y1, ....
public static GeneralPath star(double cx, double cy, double outer, double inner, int points)A regular star or polygon.
public static GeneralPath transform(GeneralPath path, Matrix m)Returns a copy of path with every point mapped through m.

Inherited methods

Method details

roundRect

public static GeneralPath roundRect(double x, double y, double w, double h, double rx, double ry)
A rectangle with corners rounded by rx horizontally and ry vertically.

Parameters

x double
left
y double
top
w double
width
h double
height
rx double
horizontal corner radius
ry double
vertical corner radius

roundRect

public static GeneralPath roundRect(double x, double y, double w, double h, double[] r)
A rectangle with each corner rounded by its own radius, clockwise from top left.

Parameters

x double
left
y double
top
w double
width
h double
height
r double[]
four radii: top left, top right, bottom right, bottom left

ellipse

public static GeneralPath ellipse(double cx, double cy, double rx, double ry)
An ellipse.

Parameters

cx double
center x
cy double
center y
rx double
horizontal radius
ry double
vertical radius

polygon

public static GeneralPath polygon(double[] pts, boolean close)
A polygon or polyline through points given as x0, y0, x1, y1, ....

Parameters

pts double[]
the points
close boolean
true to close it

star

public static GeneralPath star(double cx, double cy, double outer, double inner, int points)
A regular star or polygon.

Parameters

cx double
center x
cy double
center y
outer double
outer radius
inner double
inner radius; equal to outer for a plain polygon
points int
number of points, at least 3

transform

public static GeneralPath transform(GeneralPath path, Matrix m)
Returns a copy of path with every point mapped through m.

Parameters

path GeneralPath
the source
m Matrix
the transform