com.gargoylesoftware.htmlunit.javascript.host.canvas
Class CanvasRenderingContext2D

java.lang.Object
  extended by net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
      extended by com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
          extended by com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasRenderingContext2D
All Implemented Interfaces:
Serializable, Cloneable, Map, net.sourceforge.htmlunit.corejs.javascript.ConstProperties, net.sourceforge.htmlunit.corejs.javascript.debug.DebuggableObject, net.sourceforge.htmlunit.corejs.javascript.Scriptable

public class CanvasRenderingContext2D
extends SimpleScriptable

A JavaScript object for a CanvasRenderingContext2D.

Version:
$Revision: 5351 $
Author:
Ahmed Ashour
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from interface java.util.Map
Map.Entry<K,V>
 
Field Summary
 
Fields inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
 
Fields inherited from interface net.sourceforge.htmlunit.corejs.javascript.Scriptable
NOT_FOUND
 
Constructor Summary
CanvasRenderingContext2D()
           
 
Method Summary
 void jsxFunction_arc(double x, double y, double radius, double startAngle, double endAngle, boolean anticlockwise)
          Draws an arc.
 void jsxFunction_arcTo(double x1, double y1, double x2, double y2, double radius)
          Draws an arc.
 void jsxFunction_beginPath()
          Begins the subpaths.
 void jsxFunction_bezierCurveTo(double cp1x, double cp1y, double cp2x, double cp2y, double x, double y)
          Draws a cubic Bézier curve.
 void jsxFunction_clearRect(double x, double y, double w, double h)
          Clears the specified rectangular area.
 void jsxFunction_clip()
          Creates a new clipping region.
 void jsxFunction_closePath()
          Closes the subpaths.
 void jsxFunction_createLinearGradient(double x0, double y0, double r0, double x1, Object y1, Object r1)
          Creates linear gradient.
static void jsxFunction_drawImage(net.sourceforge.htmlunit.corejs.javascript.Context context, net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj, Object[] args, net.sourceforge.htmlunit.corejs.javascript.Function function)
          Draws images onto the canvas.
 void jsxFunction_fill()
          Fills the shape.
 void jsxFunction_fillRect(double x, double y, double w, double h)
          Paints the specified rectangular area.
 void jsxFunction_lineTo(double x, double y)
          Connect the last point to the given point.
 void jsxFunction_moveTo(double x, double y)
          Creates a new subpath.
 void jsxFunction_restore()
          Pops state stack and restore state.
 void jsxFunction_save()
          Pushes state on state stack.
 void jsxFunction_stroke()
          Calculates the strokes of all the subpaths of the current path.
 void jsxFunction_strokeRect(double x, double y, double w, double h)
          Strokes the specified rectangular area.
 Object jsxGet_fillStyle()
          Returns the "fillStyle" property.
 double jsxGet_globalAlpha()
          Returns the "globalAlpha" property.
 double jsxGet_lineWidth()
          Returns the "lineWidth" property.
 Object jsxGet_strokeStyle()
          Returns the "strokeStyle" property.
 void jsxSet_fillStyle(Object fillStyle)
          Sets the "fillStyle" property.
 void jsxSet_globalAlpha(Object globalAlpha)
          Sets the "globalAlpha" property.
 void jsxSet_lineWidth(Object lineWidth)
          Sets the "lineWidth" property.
 void jsxSet_strokeStyle(Object strokeStyle)
          Sets the "strokeStyle" property.
 
Methods inherited from class com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
clone, defineFunctionProperties, defineProperty, equivalentValues, get, getBrowserVersion, getClassName, getDefaultValue, getDomNodeOrDie, getDomNodeOrNull, getPrototype, getScriptableFor, getStartingScope, getTransformerScriptableFor, getWindow, getWindow, getWithPreemption, hasInstance, initParentScope, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement
 
Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, clear, containsKey, containsValue, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, entrySet, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, keySet, preventExtensions, put, put, put, putAll, putConst, putConstProperty, putProperty, putProperty, redefineProperty, remove, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size, values
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Constructor Detail

CanvasRenderingContext2D

public CanvasRenderingContext2D()
Method Detail

jsxGet_fillStyle

public Object jsxGet_fillStyle()
Returns the "fillStyle" property.

Returns:
the "fillStyle" property

jsxSet_fillStyle

public void jsxSet_fillStyle(Object fillStyle)
Sets the "fillStyle" property.

Parameters:
fillStyle - the "fillStyle" property

jsxGet_strokeStyle

public Object jsxGet_strokeStyle()
Returns the "strokeStyle" property.

Returns:
the "strokeStyle" property

jsxSet_strokeStyle

public void jsxSet_strokeStyle(Object strokeStyle)
Sets the "strokeStyle" property.

Parameters:
strokeStyle - the "strokeStyle" property

jsxGet_lineWidth

public double jsxGet_lineWidth()
Returns the "lineWidth" property.

Returns:
the "lineWidth" property

jsxSet_lineWidth

public void jsxSet_lineWidth(Object lineWidth)
Sets the "lineWidth" property.

Parameters:
lineWidth - the "lineWidth" property

jsxGet_globalAlpha

public double jsxGet_globalAlpha()
Returns the "globalAlpha" property.

Returns:
the "globalAlpha" property

jsxSet_globalAlpha

public void jsxSet_globalAlpha(Object globalAlpha)
Sets the "globalAlpha" property.

Parameters:
globalAlpha - the "globalAlpha" property

jsxFunction_clearRect

public void jsxFunction_clearRect(double x,
                                  double y,
                                  double w,
                                  double h)
Clears the specified rectangular area.

Parameters:
x - the x
y - the y
w - the width
h - the height

jsxFunction_fillRect

public void jsxFunction_fillRect(double x,
                                 double y,
                                 double w,
                                 double h)
Paints the specified rectangular area.

Parameters:
x - the x
y - the y
w - the width
h - the height

jsxFunction_strokeRect

public void jsxFunction_strokeRect(double x,
                                   double y,
                                   double w,
                                   double h)
Strokes the specified rectangular area.

Parameters:
x - the x
y - the y
w - the width
h - the height

jsxFunction_beginPath

public void jsxFunction_beginPath()
Begins the subpaths.


jsxFunction_closePath

public void jsxFunction_closePath()
Closes the subpaths.


jsxFunction_moveTo

public void jsxFunction_moveTo(double x,
                               double y)
Creates a new subpath.

Parameters:
x - the x
y - the y

jsxFunction_lineTo

public void jsxFunction_lineTo(double x,
                               double y)
Connect the last point to the given point.

Parameters:
x - the x
y - the y

jsxFunction_save

public void jsxFunction_save()
Pushes state on state stack.


jsxFunction_restore

public void jsxFunction_restore()
Pops state stack and restore state.


jsxFunction_createLinearGradient

public void jsxFunction_createLinearGradient(double x0,
                                             double y0,
                                             double r0,
                                             double x1,
                                             Object y1,
                                             Object r1)
Creates linear gradient.

Parameters:
x0 - the x0
y0 - the y0
r0 - the r0
x1 - the x1
y1 - the y1
r1 - the r1

jsxFunction_arc

public void jsxFunction_arc(double x,
                            double y,
                            double radius,
                            double startAngle,
                            double endAngle,
                            boolean anticlockwise)
Draws an arc.

Parameters:
x - the x
y - the y
radius - the radius
startAngle - the start angle
endAngle - the end angle
anticlockwise - is anti-clockwise

jsxFunction_arcTo

public void jsxFunction_arcTo(double x1,
                              double y1,
                              double x2,
                              double y2,
                              double radius)
Draws an arc.

Parameters:
x1 - the x1
y1 - the y1
x2 - the x2
y2 - the y2
radius - the radius

jsxFunction_bezierCurveTo

public void jsxFunction_bezierCurveTo(double cp1x,
                                      double cp1y,
                                      double cp2x,
                                      double cp2y,
                                      double x,
                                      double y)
Draws a cubic Bézier curve.

Parameters:
cp1x - the cp1x
cp1y - the cp1y
cp2x - the cp2x
cp2y - the cp2y
x - the x
y - the y

jsxFunction_fill

public void jsxFunction_fill()
Fills the shape.


jsxFunction_stroke

public void jsxFunction_stroke()
Calculates the strokes of all the subpaths of the current path.


jsxFunction_clip

public void jsxFunction_clip()
Creates a new clipping region.


jsxFunction_drawImage

public static void jsxFunction_drawImage(net.sourceforge.htmlunit.corejs.javascript.Context context,
                                         net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
                                         Object[] args,
                                         net.sourceforge.htmlunit.corejs.javascript.Function function)
Draws images onto the canvas.

Parameters:
context - the JavaScript context
thisObj - the scriptable
args - the arguments passed into the method
function - the function


Copyright © 2002-2011 Gargoyle Software Inc.. All Rights Reserved.