All shapes support nesting of other operations and the following optional properties
- color: defines the color of the shape's outline
- strokeWidth: defines the thicknes of the shape's outline
- fill: defines the color, paint or gradient to fill the shape's content
They also support an option to not draw the shape right away but to store it for later use, in order to do that you must specify 'asShape: true'.
rect |
Draws a rectangle defined by a location (x,y) and dimension (width x height). |
rect (round) |
Draws a rectangle with rounded corners defined by a location (x,y), a dimension (w x h), and the width and height of an arc with which to round the corners. |
rect (3d) |
Draws a 3-D highlighted outline of the specified rectangle. Use the same properties as rect and specify a boolean value for 'raised'. |
circle |
Draws a circle that is defined by a framing rectangle. properties: [cx,cy,radius] |
ellipse |
Draws a circle that is defined by a framing rectangle. properties: [cx,cy,fx,fy,radiusx,radiusy]. If fx or fy don't have an specific value they will use cx and cy accordingly. |
arc |
Draws an arc defined by a framing rectangle, start angle, angular extent (length of the arc), and a closure type (OPEN, CHORD, or PIE). properties [x,y,width,height,start,extent], optional [close=open,chord,pie] |
polygon |
Draws a closed, two-dimensional region within a coordinate space. This region is bounded by an arbitrary number of line segments, each of which is one side of the polygon. Internally, a polygon comprises of a list of (x,y) coordinate pairs, where each pair defines a vertex of the polygon, and two successive pairs are the endpoints of a line that is a side of the polygon. The first and final pairs of (x,y) points are joined by a line segment that closes the polygon. properties [points] |
text |
Draws a string at the specified coordinates. properties [text,x,y] |
path |
Draws an arbitrary geometric path. Paths are described by a series of pathOperations:
|
xpath |
Draws an arbitrary geometric path using the Batik library. Paths are described by a series of pathOperations:
|
star |
Draws a star shape. A star is defined by two radii and a number of branches. Each branch spans between the two radii. The inner radius is the distance between the center of the star and the origin of the branches. The outer radius is the distance between the center of the star and the tips of the branches. properties [x,y,ir,or,count]. Requires graphicsbuilder-ext-swingx |
morph |
Draws a shape which geometry is constructed from two other shapes: a start shape and an end shape. The morph property of a morphing shape defines the amount of transformation applied to the start shape to turn it into the end shape. Both shapes must have the same winding rule. properties [start,end,morph]. Requires graphicsbuilder-ext-swingx |
|
The following shapes do not accept 'fill' |
line |
Draws a line, using the current color, between the points (x1, y1) and (x2, y2). |
polyline |
Draws a sequence of connected lines defined by arrays of x and y coordinates. properties [points] |
cubicCurve |
properties [x1,y1,ctrlx1,ctrly1,ctrlx2,ctrly2,x2,y2] |
quadCurve |
properties [x1,y1,ctrlx,ctrly,x2,y2] |