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

public final class ShapeGeometry

  1. Object
  2. ShapeGeometry

The outlines of the preset shapes, as com.codename1.ui.geom.GeneralPaths.

Names are OOXML’s preset geometry names (ECMA-376 part 1, 20.1.10.56), which every reader maps its own shapes to. The same path fills and strokes on the screen and in PDF export, so a shape looks identical on both. Unknown names draw as a rectangle.

Methods

public static String[] presets()The preset names drawn exactly; any other name is drawn as a rectangle.
public static boolean isKnown(String name)True when the name is one of the presets drawn exactly.
public static boolean isLine(String name)True for the line and connector presets, which are stroked and never filled.
public static GeneralPath path(ShapeElement shape, float w, float h)The outline of a shape in its own box, from (0, 0) to (w, h), before rotation and flipping.
public static GeneralPath path(String name, float w, float h)The outline of a preset with its default adjustments.
public static GeneralPath arrowHead(String kind, float tipX, float tipY, float fromX, float fromY, float size)The outline of an arrowhead at the end of a line, for drawing LineStyle heads and tails.

Inherited methods

Method details

presets

public static String[] presets()
The preset names drawn exactly; any other name is drawn as a rectangle.

Returns

a copy of the names

isKnown

public static boolean isKnown(String name)
True when the name is one of the presets drawn exactly.

Parameters

name String
a preset name

Returns

true when known

isLine

public static boolean isLine(String name)
True for the line and connector presets, which are stroked and never filled.

Parameters

name String
a preset name

Returns

true for a line

path

public static GeneralPath path(ShapeElement shape, float w, float h)
The outline of a shape in its own box, from (0, 0) to (w, h), before rotation and flipping.

Parameters

shape ShapeElement
the shape
w float
the box width in any unit
h float
the box height in the same unit

Returns

the path

path

public static GeneralPath path(String name, float w, float h)
The outline of a preset with its default adjustments.

Parameters

name String
the preset name
w float
the box width
h float
the box height

Returns

the path

arrowHead

public static GeneralPath arrowHead(String kind, float tipX, float tipY, float fromX, float fromY, float size)
The outline of an arrowhead at the end of a line, for drawing LineStyle heads and tails.

Parameters

kind String
a LineStyle.ARROW_ constant
tipX float
the tip
tipY float
the tip
fromX float
a point the line comes from
fromY float
a point the line comes from
size float
the head’s length

Returns

the path, or null for no head