|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sourceforge.htmlunit.corejs.javascript.ScriptableObject
com.gargoylesoftware.htmlunit.javascript.SimpleScriptable
com.gargoylesoftware.htmlunit.javascript.host.canvas.CanvasRenderingContext2D
public class CanvasRenderingContext2D
A JavaScript object for a CanvasRenderingContext2D.
| 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 |
arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean anticlockwise)
Draws an arc. |
void |
arcTo(double x1,
double y1,
double x2,
double y2,
double radius)
Draws an arc. |
void |
beginPath()
Begins the subpaths. |
void |
bezierCurveTo(double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
Draws a cubic Bézier curve. |
void |
clearRect(double x,
double y,
double w,
double h)
Clears the specified rectangular area. |
void |
clip()
Creates a new clipping region. |
void |
closePath()
Closes the subpaths. |
void |
createLinearGradient(double x0,
double y0,
double r0,
double x1,
Object y1,
Object r1)
Creates linear gradient. |
static void |
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 |
fill()
Fills the shape. |
void |
fillRect(double x,
double y,
double w,
double h)
Paints the specified rectangular area. |
Object |
getFillStyle()
Returns the "fillStyle" property. |
double |
getGlobalAlpha()
Returns the "globalAlpha" property. |
double |
getLineWidth()
Returns the "lineWidth" property. |
Object |
getStrokeStyle()
Returns the "strokeStyle" property. |
void |
lineTo(double x,
double y)
Connect the last point to the given point. |
void |
moveTo(double x,
double y)
Creates a new subpath. |
void |
restore()
Pops state stack and restore state. |
void |
save()
Pushes state on state stack. |
void |
scale(Object x,
Object y)
Changes the transformation matrix to apply a scaling transformation with the given characteristics. |
void |
setFillStyle(Object fillStyle)
Sets the "fillStyle" property. |
void |
setGlobalAlpha(Object globalAlpha)
Sets the "globalAlpha" property. |
void |
setLineWidth(Object lineWidth)
Sets the "lineWidth" property. |
void |
setStrokeStyle(Object strokeStyle)
Sets the "strokeStyle" property. |
void |
stroke()
Calculates the strokes of all the subpaths of the current path. |
void |
strokeRect(double x,
double y,
double w,
double h)
Strokes the specified rectangular area. |
void |
translate(Object x,
Object y)
Changes the transformation matrix to apply a translation transformation with the given characteristics. |
| 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, isReadOnlySettable, makeScriptableFor, setCaseSensitive, setDomNode, setDomNode, setHtmlElement |
| Methods inherited from class net.sourceforge.htmlunit.corejs.javascript.ScriptableObject |
|---|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getClassPrototype, getDefaultValue, getFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, putConst, putConstProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setGetterOrSetter, setParentScope, setPrototype, size |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CanvasRenderingContext2D()
| Method Detail |
|---|
public Object getFillStyle()
public void translate(Object x,
Object y)
x - the translation distance in the horizontal directiony - the translation distance in the vertical direction
public void scale(Object x,
Object y)
x - the scale factor in the horizontal directiony - the scale factor in the vertical directionpublic void setFillStyle(Object fillStyle)
fillStyle - the "fillStyle" propertypublic Object getStrokeStyle()
public void setStrokeStyle(Object strokeStyle)
strokeStyle - the "strokeStyle" propertypublic double getLineWidth()
public void setLineWidth(Object lineWidth)
lineWidth - the "lineWidth" propertypublic double getGlobalAlpha()
public void setGlobalAlpha(Object globalAlpha)
globalAlpha - the "globalAlpha" property
public void clearRect(double x,
double y,
double w,
double h)
x - the xy - the yw - the widthh - the height
public void fillRect(double x,
double y,
double w,
double h)
x - the xy - the yw - the widthh - the height
public void strokeRect(double x,
double y,
double w,
double h)
x - the xy - the yw - the widthh - the heightpublic void beginPath()
public void closePath()
public void moveTo(double x,
double y)
x - the xy - the y
public void lineTo(double x,
double y)
x - the xy - the ypublic void save()
public void restore()
public void createLinearGradient(double x0,
double y0,
double r0,
double x1,
Object y1,
Object r1)
x0 - the x0y0 - the y0r0 - the r0x1 - the x1y1 - the y1r1 - the r1
public void arc(double x,
double y,
double radius,
double startAngle,
double endAngle,
boolean anticlockwise)
x - the xy - the yradius - the radiusstartAngle - the start angleendAngle - the end angleanticlockwise - is anti-clockwise
public void arcTo(double x1,
double y1,
double x2,
double y2,
double radius)
x1 - the x1y1 - the y1x2 - the x2y2 - the y2radius - the radius
public void bezierCurveTo(double cp1x,
double cp1y,
double cp2x,
double cp2y,
double x,
double y)
cp1x - the cp1xcp1y - the cp1ycp2x - the cp2xcp2y - the cp2yx - the xy - the ypublic void fill()
public void stroke()
public void clip()
public static void drawImage(net.sourceforge.htmlunit.corejs.javascript.Context context,
net.sourceforge.htmlunit.corejs.javascript.Scriptable thisObj,
Object[] args,
net.sourceforge.htmlunit.corejs.javascript.Function function)
context - the JavaScript contextthisObj - the scriptableargs - the arguments passed into the methodfunction - the function
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||