dojox/gfx/_gfxBidiSupport.Path (version 1.10)

Summary

a generalized path shape

Usage

var foo = new _gfxBidiSupport.Path(rawNode);
dojox/gfx/path
Parameter Type Description
rawNode Node

a DOM node to be used by this path object

See the dojox/gfx/_gfxBidiSupport.Path reference documentation for more information.

Property Summary

Method Summary

  • _applyTransform()
  • _collectArgs(array,args) converts an array of arguments to plain numeric values
  • _confirmSegmented()
  • _getRealBBox() returns an array of four points or null four points represent four corners of the untransformed bounding box
  • _getRealMatrix() returns the cumulative ('real') transformation matrix by combining the shape's matrix with its parent's matrix
  • _moveToBack() renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()
  • _moveToFront() renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()
  • _pushSegment(action,args) adds a segment
  • _setParent(parent,matrix) sets a parent
  • _setPath(path) forms a path using an SVG path string
  • _updateBBox(x,y,m) updates the bounding box of path with new point
  • _updateParentMatrix(matrix) updates the parent matrix with new matrix
  • _updateWithSegment(segment,matrix) updates the bounding box of path with new segment
  • applyLeftTransform(matrix) multiplies the existing matrix with an argument on left side (matrix * this.matrix)
  • applyRightTransform(matrix) multiplies the existing matrix with an argument on right side (this.matrix * matrix)
  • applyTransform(matrix) a shortcut for dojox/gfx/shape.Shape.applyRightTransform
  • arcTo() forms an elliptic arc segment
  • closePath() closes a path
  • connect(name,object,method) connects a handler to an event on this shape
  • curveTo() forms a curve segment
  • destroy() Releases all internal resources owned by this shape.
  • disconnect(token) connects a handler by token from an event on this shape
  • getAbsoluteMode() returns a current value of the absolute mode
  • getBoundingBox() returns the bounding box {x, y, width, height} or null
  • getClip()
  • getEventSource() returns a Node, which is used as a source of events for this shape
  • getFill() Returns the current fill object or null (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/Color)
  • getLastPosition() returns the last point in the path, or null
  • getNode() Different graphics rendering subsystems implement shapes in different ways.
  • getParent() Returns the parent Shape, Group or null if this Shape is unparented. (see dojox/gfx/shape.Surface, or dojox/gfx.Group)
  • getShape() returns the current Shape object or null (see dojox/gfx.defaultPath, dojox/gfx.defaultPolyline, dojox/gfx.defaultRect, dojox/gfx.defaultEllipse, dojox/gfx.defaultCircle, dojox/gfx.defaultLine, or dojox/gfx.defaultImage)
  • getStroke() Returns the current stroke object or null (see dojox/gfx.defaultStroke)
  • getTransform() Returns the current transformation matrix applied to this Shape or null
  • getTransformedBoundingBox() returns an array of four points or null four points represent four corners of the untransformed bounding box
  • hLineTo() forms a horizontal line segment
  • lineTo() forms a line segment
  • moveTo() forms a move segment
  • moveToBack() moves a shape to back of its parent's list of shapes
  • moveToFront() moves a shape to front of its parent's list of shapes
  • on(type,listener) Connects an event to this shape.
  • qCurveTo() forms a quadratic curve segment
  • qSmoothCurveTo() forms a quadratic smooth curve segment
  • removeShape(silently) removes the shape from its parent's list of shapes
  • setAbsoluteMode(mode) sets an absolute or relative mode for path points
  • setClip(clip) sets the clipping area of this shape.
  • setFill(fill) sets a fill object (the default implementation simply ignores it)
  • setShape(newShape) forms a path using a shape
  • setStroke(stroke) sets a stroke object (the default implementation simply ignores it)
  • setTransform(matrix) sets a transformation matrix
  • smoothCurveTo() forms a smooth curve segment
  • vLineTo() forms a vertical line segment

Properties

_2PI
Defined by: dojox/gfx/path
_validSegments
Defined by: dojox/gfx/path

Methods

_applyTransform()
Defined by dojox/gfx/path
Returns:undefined
_collectArgs(array,args)
Defined by dojox/gfx/path

converts an array of arguments to plain numeric values

Parameter Type Description
array Array

an output argument (array of numbers)

args Array

an input argument (can be values of Boolean, Number, dojox/gfx.Point, or an embedded array of them)

_confirmSegmented()
Defined by dojox/gfx/path
_getRealBBox()
Defined by dojox/gfx/path

returns an array of four points or null four points represent four corners of the untransformed bounding box

Returns:undefined | null
_getRealMatrix()
Defined by dojox/gfx/shape

returns the cumulative ('real') transformation matrix by combining the shape's matrix with its parent's matrix

Returns:undefined
_moveToBack()
Defined by dojox/gfx/shape

renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()

_moveToFront()
Defined by dojox/gfx/shape

renderer-specific hook, see dojox/gfx/shape.Shape.moveToFront()

_pushSegment(action,args)
Defined by dojox/gfx/path

adds a segment

Parameter Type Description
action String

valid SVG code for a segment's type

args Array

a list of parameters for this segment

_setParent(parent,matrix)
Defined by dojox/gfx/shape

sets a parent

Parameter Type Description
parent Object

a parent or null (see dojox/gfx/shape.Surface, or dojox/gfx.Group)

matrix dojox/gfx/matrix.Matrix2D

a 2D matrix or a matrix-like object

Returns:undefined
_setPath(path)
Defined by dojox/gfx/path

forms a path using an SVG path string

Parameter Type Description
path String

an SVG path string

_updateBBox(x,y,m)
Defined by dojox/gfx/path

updates the bounding box of path with new point

Parameter Type Description
x Number

an x coordinate

y Number

a y coordinate

m undefined
_updateParentMatrix(matrix)
Defined by dojox/gfx/shape

updates the parent matrix with new matrix

Parameter Type Description
matrix dojox/gfx/Matrix2D

a 2D matrix or a matrix-like object

Returns:undefined
_updateWithSegment(segment,matrix)
Defined by dojox/gfx/path

updates the bounding box of path with new segment

Parameter Type Description
segment Object

a segment

matrix undefined
applyLeftTransform(matrix)
Defined by dojox/gfx/shape

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on left side (matrix * this.matrix)

applyRightTransform(matrix)
Defined by dojox/gfx/shape

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

multiplies the existing matrix with an argument on right side (this.matrix * matrix)

applyTransform(matrix)
Defined by dojox/gfx/shape

a shortcut for dojox/gfx/shape.Shape.applyRightTransform

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:function

a shortcut for dojox/gfx/shape.Shape.applyRightTransform

arcTo()
Defined by dojox/gfx/path

forms an elliptic arc segment

Returns:function

forms an elliptic arc segment

closePath()
Defined by dojox/gfx/path

closes a path

Returns:function

closes a path

connect(name,object,method)
Defined by dojox/gfx/shape

connects a handler to an event on this shape

Parameter Type Description
name undefined
object undefined
method undefined
Returns:undefined
curveTo()
Defined by dojox/gfx/path

forms a curve segment

Returns:function

forms a curve segment

destroy()
Defined by dojox/gfx/shape

Releases all internal resources owned by this shape. Once this method has been called, the instance is considered destroyed and should not be used anymore.

disconnect(token)
Defined by dojox/gfx/shape

connects a handler by token from an event on this shape

Parameter Type Description
token undefined
Returns:undefined
getAbsoluteMode()
Defined by dojox/gfx/path

returns a current value of the absolute mode

Returns:undefined
getBoundingBox()
Defined by dojox/gfx/path

returns the bounding box {x, y, width, height} or null

Returns:null
getClip()
Defined by dojox/gfx/shape
Returns:undefined
getEventSource()
Defined by dojox/gfx/shape

returns a Node, which is used as a source of events for this shape

Returns:undefined
getFill()
Defined by dojox/gfx/shape

Returns the current fill object or null (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/Color)

Returns:undefined
getLastPosition()
Defined by dojox/gfx/path

returns the last point in the path, or null

Returns:null
getNode()
Defined by dojox/gfx/shape

Different graphics rendering subsystems implement shapes in different ways. This method provides access to the underlying graphics subsystem object. Clients calling this method and using the return value must be careful not to try sharing or using the underlying node in a general way across renderer implementation. Returns the underlying graphics Node, or null if no underlying graphics node is used by this shape.

Returns:undefined
getParent()
Defined by dojox/gfx/shape

Returns the parent Shape, Group or null if this Shape is unparented. (see dojox/gfx/shape.Surface, or dojox/gfx.Group)

Returns:undefined
getShape()
Defined by dojox/gfx/shape

returns the current Shape object or null (see dojox/gfx.defaultPath, dojox/gfx.defaultPolyline, dojox/gfx.defaultRect, dojox/gfx.defaultEllipse, dojox/gfx.defaultCircle, dojox/gfx.defaultLine, or dojox/gfx.defaultImage)

Returns:undefined
getStroke()
Defined by dojox/gfx/shape

Returns the current stroke object or null (see dojox/gfx.defaultStroke)

Returns:undefined
getTransform()
Defined by dojox/gfx/shape

Returns the current transformation matrix applied to this Shape or null

Returns:undefined
getTransformedBoundingBox()
Defined by dojox/gfx/shape

returns an array of four points or null four points represent four corners of the untransformed bounding box

Returns:null | Array
hLineTo()
Defined by dojox/gfx/path

forms a horizontal line segment

Returns:function

forms a horizontal line segment

lineTo()
Defined by dojox/gfx/path

forms a line segment

Returns:function

forms a line segment

moveTo()
Defined by dojox/gfx/path

forms a move segment

Returns:function

forms a move segment

moveToBack()
Defined by dojox/gfx/shape

moves a shape to back of its parent's list of shapes

Returns:function

moves a shape to back of its parent's list of shapes

moveToFront()
Defined by dojox/gfx/shape

moves a shape to front of its parent's list of shapes

Returns:function

moves a shape to front of its parent's list of shapes

on(type,listener)
Defined by dojox/gfx/shape

Connects an event to this shape.

Parameter Type Description
type undefined
listener undefined
Returns:undefined
qCurveTo()
Defined by dojox/gfx/path

forms a quadratic curve segment

Returns:function

forms a quadratic curve segment

qSmoothCurveTo()
Defined by dojox/gfx/path

forms a quadratic smooth curve segment

Returns:function

forms a quadratic smooth curve segment

removeShape(silently)
Defined by dojox/gfx/shape

removes the shape from its parent's list of shapes

Parameter Type Description
silently Boolean

if true, do not redraw a picture yet

Returns:function

removes the shape from its parent's list of shapes

setAbsoluteMode(mode)
Defined by dojox/gfx/path

sets an absolute or relative mode for path points

Parameter Type Description
mode Boolean

true/false or "absolute"/"relative" to specify the mode

Returns:function

sets an absolute or relative mode for path points

setClip(clip)
Defined by dojox/gfx/shape

sets the clipping area of this shape.

The clipping area defines the shape area that will be effectively visible. Everything that would be drawn outside of the clipping area will not be rendered. The possible clipping area types are rectangle, ellipse, polyline and path, but all are not supported by all the renderers. vml only supports rectangle clipping, while the gfx silverlight renderer does not support path clipping. The clip parameter defines the clipping area geometry, and should be an object with the following properties:

  • {x:Number, y:Number, width:Number, height:Number} for rectangular clip
  • {cx:Number, cy:Number, rx:Number, ry:Number} for ellipse clip
  • {points:Array} for polyline clip
  • {d:String} for a path clip.

The clip geometry coordinates are expressed in the coordinate system used to draw the shape. In other words, the clipping area is defined in the shape parent coordinate system and the shape transform is automatically applied.

Parameter Type Description
clip undefined

Examples

Example 1

The following example shows how to clip a gfx image with all the possible clip geometry: a rectangle, an ellipse, a circle (using the ellipse geometry), a polyline and a path:

surface.createImage({src:img, width:200,height:200}).setClip({x:10,y:10,width:50,height:50});
surface.createImage({src:img, x:100,y:50,width:200,height:200}).setClip({cx:200,cy:100,rx:20,ry:30});
surface.createImage({src:img, x:0,y:350,width:200,height:200}).setClip({cx:100,cy:425,rx:60,ry:60});
surface.createImage({src:img, x:300,y:0,width:200,height:200}).setClip({points:[350,0,450,50,380,130,300,110]});
surface.createImage({src:img, x:300,y:350,width:200,height:200}).setClip({d:"M 350,350 C314,414 317,557 373,450.0000 z"});
setFill(fill)
Defined by dojox/gfx/shape

sets a fill object (the default implementation simply ignores it)

Parameter Type Description
fill Object

a fill object (see dojox/gfx.defaultLinearGradient, dojox/gfx.defaultRadialGradient, dojox/gfx.defaultPattern, or dojo/_base/Color)

Returns:function

sets a fill object (the default implementation simply ignores it)

setShape(newShape)
Defined by dojox/gfx/path

forms a path using a shape

Parameter Type Description
newShape Object

an SVG path string or a path object (see dojox/gfx.defaultPath)

Returns:function

forms a path using a shape

setStroke(stroke)
Defined by dojox/gfx/shape

sets a stroke object (the default implementation simply ignores it)

Parameter Type Description
stroke Object

a stroke object (see dojox/gfx.defaultStroke)

Returns:function

sets a stroke object (the default implementation simply ignores it)

setTransform(matrix)
Defined by dojox/gfx/shape

sets a transformation matrix

Parameter Type Description
matrix dojox/gfx/matrix.Matrix2D

a matrix or a matrix-like object (see an argument of dojox/gfx/matrix.Matrix2D constructor for a list of acceptable arguments)

Returns:undefined
smoothCurveTo()
Defined by dojox/gfx/path

forms a smooth curve segment

Returns:function

forms a smooth curve segment

vLineTo()
Defined by dojox/gfx/path

forms a vertical line segment

Returns:function

forms a vertical line segment

Error in the documentation? Can’t find what you are looking for? Let us know!