Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

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:

  • moveTo[x,y] : adds a point to the path by moving to the specified coordinates (x,y)
  • lineTo[x,y] : adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates (x,y)
  • curveTo[x1,y1,x2,y2,x3,y3] : adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates (x3,y3), using the specified points (x1,y1) and (x2,y2) as Bézier control points.
  • quadTo[x1,y1,x2,y2] : adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates (x2,y2), using the specified point (x1,y1) as a quadratic parametric control point.
  • hline[x] : adds a point to the path by drawing an horizontal line to the specified coordinates (x,current.y)
  • vline[y] : adds a point to the path by drawing a vertical line to the specified coordinates (current.x,y)
  • shape[shape,connect] : appends the geometry of the specified Shape object to the path, possibly connecting the new geometry to the existing path segments with a line segment.
  • close : closes the current subpath by drawing a straight line back to the coordinates of the last moveTo.
    The first operation must be moveTo. The path will be closed automatically.
    Requires graphicsbuilder-ext-jdk6

xpath

Draws an arbitrary geometric path using the Batik library. Paths are described by a series of pathOperations:

  • xmoveTo[x,y] : adds a point to the path by moving to the specified coordinates (x,y)
  • xlineTo[x,y] : adds a point to the path by drawing a straight line from the current coordinates to the new specified coordinates (x,y)
  • xcurveTo[x1,y1,x2,y2,x3,y3] : adds a curved segment, defined by three new points, to the path by drawing a Bézier curve that intersects both the current coordinates and the specified coordinates (x3,y3), using the specified points (x1,y1) and (x2,y2) as Bézier control points.
  • xquadTo[x1,y1,x2,y2] : adds a curved segment, defined by two new points, to the path by drawing a Quadratic curve that intersects both the current coordinates and the specified coordinates (x2,y2), using the specified point (x1,y1) as a quadratic parametric control point.
  • xhline[x] : adds a point to the path by drawing an horizontal line to the specified coordinates (x,current.y)
  • xvline[y] : adds a point to the path by drawing a vertical line to the specified coordinates (current.x,y)
  • xshape[shape,connect] : appends the geometry of the specified Shape object to the path, possibly connecting the new geometry to the existing path segments with a line segment.
  • xclose : closes the current subpath by drawing a straight line back to the coordinates of the last moveTo.
  • xarcTo[x,y,rx,ry,angle,sweep,largeArc] : adds an elliptical arc, defined by two radii (rx,ry), an angle from the x-axis, a flag to choose the large arc or not, a flag to indicate if we increase or decrease the angles and the final point of the arc (x,y).
    The first operation must be xmoveTo. The path will be closed automatically.
    Requires graphicsbuilder-ext-svg

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]

  • No labels