Client API. The Codename One framework your app is built on: this runs on the device, not in a backend.
public final class ShapeGeometry
- Object
- 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
nameString- 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
nameString- 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
shapeShapeElement- the shape
wfloat- the box width in any unit
hfloat- 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
nameString- the preset name
wfloat- the box width
hfloat- 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
kindString- a
LineStyle.ARROW_constant tipXfloat- the tip
tipYfloat- the tip
fromXfloat- a point the line comes from
fromYfloat- a point the line comes from
sizefloat- the head’s length
Returns
the path, or null for no head