Module org.htmlunit

Class DOMMatrixReadOnly

java.lang.Object
org.htmlunit.corejs.javascript.SlotMapOwner<org.htmlunit.corejs.javascript.Scriptable>
org.htmlunit.corejs.javascript.ScriptableObject
org.htmlunit.javascript.HtmlUnitScriptable
org.htmlunit.javascript.host.dom.DOMMatrixReadOnly
All Implemented Interfaces:
Serializable, Cloneable, org.htmlunit.corejs.javascript.ConstProperties<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.debug.DebuggableObject, org.htmlunit.corejs.javascript.PropHolder<org.htmlunit.corejs.javascript.Scriptable>, org.htmlunit.corejs.javascript.Scriptable, org.htmlunit.corejs.javascript.SymbolScriptable
Direct Known Subclasses:
DOMMatrix

public class DOMMatrixReadOnly extends HtmlUnitScriptable
A JavaScript object for DOMMatrixReadOnly.
Author:
Ahmed Ashour, Ronald Brill
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    org.htmlunit.corejs.javascript.ScriptableObject.DescriptorInfo, org.htmlunit.corejs.javascript.ScriptableObject.KeyComparator, org.htmlunit.corejs.javascript.ScriptableObject.LambdaGetterFunction, org.htmlunit.corejs.javascript.ScriptableObject.LambdaSetterFunction
  • Field Summary

    Fields inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST

    Fields inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    isSealed

    Fields inherited from interface org.htmlunit.corejs.javascript.Scriptable

    NOT_FOUND
  • Constructor Summary

    Constructors
    Constructor
    Description
    Ctor.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a new matrix being the result of the original matrix flipped about the x-axis.
    Returns a new matrix being the result of the original matrix flipped about the y-axis.
    double
    Returns the a property.
    double
    Returns the b property.
    double
    Returns the c property.
    double
    Returns the d property.
    double
    Returns the e property.
    double
    Returns the f property.
    boolean
    Returns whether this matrix is the identity matrix.
    double
    Returns the m11 property.
    double
    Returns the m12 property.
    double
    Returns the m13 property.
    double
    Returns the m14 property.
    double
    Returns the m21 property.
    double
    Returns the m22 property.
    double
    Returns the m23 property.
    double
    Returns the m24 property.
    double
    Returns the m31 property.
    double
    Returns the m32 property.
    double
    Returns the m33 property.
    double
    Returns the m34 property.
    double
    Returns the m41 property.
    double
    Returns the m42 property.
    double
    Returns the m43 property.
    double
    Returns the m44 property.
    protected void
    init(Object[] args, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Function ctorObj)
     
    Returns a new matrix which is the inverse of the original matrix.
    boolean
    Returns the is2D property.
    Returns the values of the matrix as a CSS transform function string.
    jsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr)
    JavaScript constructor.
    Returns a new matrix which is the dot product of the matrix and the given matrix.
    rotate(Object rotZ)
    Returns a new matrix rotated about the z-axis by the specified angle.
    rotateAxisAngle(Object xObj, Object yObj, Object zObj, Object alphaObj)
    Rotates the matrix by a given angle around the specified axis.
    void
    setIs2D(boolean is2D)
    Sets the is2D property.
    void
    setM11(double m11)
    Sets the m11 property.
    void
    setM12(double m12)
    Sets the m12 property.
    void
    setM13(double m13)
    Sets the m13 property.
    void
    setM14(double m14)
    Sets the m14 property.
    void
    setM21(double m21)
    Sets the m21 property.
    void
    setM22(double m22)
    Sets the m22 property.
    void
    setM23(double m23)
    Sets the m23 property.
    void
    setM24(double m24)
    Sets the m24 property.
    void
    setM31(double m31)
    Sets the m31 property.
    void
    setM32(double m32)
    Sets the m32 property.
    void
    setM33(double m33)
    Sets the m33 property.
    void
    setM34(double m34)
    Sets the m34 property.
    void
    setM41(double m41)
    Sets the m41 property.
    void
    setM42(double m42)
    Sets the m42 property.
    void
    setM43(double m43)
    Sets the m43 property.
    void
    setM44(double m44)
    Sets the m44 property.
    skewX(Object alphaObj)
    Returns a new matrix skewed along the x-axis by the specified angle.
    skewY(Object alphaObj)
    Returns a new matrix skewed along the y-axis by the specified angle.
    org.htmlunit.corejs.javascript.typedarrays.NativeFloat32Array
    Returns a new Float32Array containing all 16 elements of the matrix.
    org.htmlunit.corejs.javascript.typedarrays.NativeFloat64Array
    Returns a new Float64Array containing all 16 elements of the matrix.
    org.htmlunit.corejs.javascript.Scriptable
    Returns a JSON representation of the DOMMatrixReadOnly object.
    translate(Object xObj, Object yObj, Object zObj)
    Creates a new matrix being the result of the original matrix with a translation applied.

    Methods inherited from class org.htmlunit.corejs.javascript.ScriptableObject

    applyDescriptorToAttributeBitset, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkNotSealed, checkPropertyChangeForSlot, checkPropertyChangeForSlot, checkPropertyDefinition, checkPropertyDefinition, checkSlotRemoval, defineBuiltinProperty, defineBuiltinProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineBuiltInProperty, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureScriptableObjectButNotSymbol, ensureSymbolScriptable, ensureType, get, get, getAllIds, getAncestor, getArrayPrototype, getClassPrototype, getClassPrototype, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getGetterOrSetter, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSuperProperty, getSuperProperty, getSuperProperty, getThis, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, hasProperty, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGenericDescriptor, isGetterOrSetter, isGetterOrSetter, isTrue, preventExtensions, put, put, putConst, putConstProperty, putConstProperty, putOwnProperty, putOwnProperty, putOwnProperty, putProperty, putProperty, putProperty, putProperty, putSuperProperty, putSuperProperty, putSuperProperty, querySlot, redefineProperty, redefineProperty, sameValue, sealObject, setCommonDescriptorProperties, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size

    Methods inherited from class org.htmlunit.corejs.javascript.SlotMapOwner

    associateValue, checkNotSealed, copyAssociatedValue, createSlotMap, defineProperty, defineProperty, get, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getIds, has, has, isSealed, readMaps, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, writeMaps

    Methods inherited from class java.lang.Object

    equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.htmlunit.corejs.javascript.Scriptable

    get, getIds, has, has

    Methods inherited from interface org.htmlunit.corejs.javascript.SymbolScriptable

    get, has
  • Constructor Details

    • DOMMatrixReadOnly

      public DOMMatrixReadOnly()
      Ctor.
  • Method Details

    • jsConstructor

      public static DOMMatrixReadOnly jsConstructor(org.htmlunit.corejs.javascript.Context cx, org.htmlunit.corejs.javascript.VarScope scope, Object[] args, org.htmlunit.corejs.javascript.Function ctorObj, boolean inNewExpr)
      JavaScript constructor.
      Parameters:
      cx - the current context
      scope - the scope
      args - the arguments to the DOMMatrixReadOnly constructor
      ctorObj - the function object
      inNewExpr - true if invoked with the new operator
      Returns:
      the Java object that JavaScript can access
    • init

      protected void init(Object[] args, org.htmlunit.corejs.javascript.VarScope scope, org.htmlunit.corejs.javascript.Function ctorObj)
    • getM11

      public double getM11()
      Returns the m11 property.
      Returns:
      the m11 property
    • setM11

      public void setM11(double m11)
      Sets the m11 property.
      Parameters:
      m11 - the new value
    • getA

      public double getA()
      Returns the a property.
      Returns:
      the a property
    • getM12

      public double getM12()
      Returns the m12 property.
      Returns:
      the m12 property
    • setM12

      public void setM12(double m12)
      Sets the m12 property.
      Parameters:
      m12 - the new value
    • getB

      public double getB()
      Returns the b property.
      Returns:
      the b property
    • getM13

      public double getM13()
      Returns the m13 property.
      Returns:
      the m13 property
    • setM13

      public void setM13(double m13)
      Sets the m13 property.
      Parameters:
      m13 - the new value
    • getM14

      public double getM14()
      Returns the m14 property.
      Returns:
      the m14 property
    • setM14

      public void setM14(double m14)
      Sets the m14 property.
      Parameters:
      m14 - the new value
    • getM21

      public double getM21()
      Returns the m21 property.
      Returns:
      the m21 property
    • setM21

      public void setM21(double m21)
      Sets the m21 property.
      Parameters:
      m21 - the new value
    • getC

      public double getC()
      Returns the c property.
      Returns:
      the c property
    • getM22

      public double getM22()
      Returns the m22 property.
      Returns:
      the m22 property
    • setM22

      public void setM22(double m22)
      Sets the m22 property.
      Parameters:
      m22 - the new value
    • getD

      public double getD()
      Returns the d property.
      Returns:
      the d property
    • getM23

      public double getM23()
      Returns the m23 property.
      Returns:
      the m23 property
    • setM23

      public void setM23(double m23)
      Sets the m23 property.
      Parameters:
      m23 - the new value
    • getM24

      public double getM24()
      Returns the m24 property.
      Returns:
      the m24 property
    • setM24

      public void setM24(double m24)
      Sets the m24 property.
      Parameters:
      m24 - the new value
    • getM31

      public double getM31()
      Returns the m31 property.
      Returns:
      the m31 property
    • setM31

      public void setM31(double m31)
      Sets the m31 property.
      Parameters:
      m31 - the new value
    • getM32

      public double getM32()
      Returns the m32 property.
      Returns:
      the m32 property
    • setM32

      public void setM32(double m32)
      Sets the m32 property.
      Parameters:
      m32 - the new value
    • getM33

      public double getM33()
      Returns the m33 property.
      Returns:
      the m33 property
    • setM33

      public void setM33(double m33)
      Sets the m33 property.
      Parameters:
      m33 - the new value
    • getM34

      public double getM34()
      Returns the m34 property.
      Returns:
      the m34 property
    • setM34

      public void setM34(double m34)
      Sets the m34 property.
      Parameters:
      m34 - the new value
    • getM41

      public double getM41()
      Returns the m41 property.
      Returns:
      the m41 property
    • setM41

      public void setM41(double m41)
      Sets the m41 property.
      Parameters:
      m41 - the new value
    • getE

      public double getE()
      Returns the e property.
      Returns:
      the e property
    • getM42

      public double getM42()
      Returns the m42 property.
      Returns:
      the m42 property
    • setM42

      public void setM42(double m42)
      Sets the m42 property.
      Parameters:
      m42 - the new value
    • getF

      public double getF()
      Returns the f property.
      Returns:
      the f property
    • getM43

      public double getM43()
      Returns the m43 property.
      Returns:
      the m43 property
    • setM43

      public void setM43(double m43)
      Sets the m43 property.
      Parameters:
      m43 - the new value
    • getM44

      public double getM44()
      Returns the m44 property.
      Returns:
      the m44 property
    • setM44

      public void setM44(double m44)
      Sets the m44 property.
      Parameters:
      m44 - the new value
    • isIs2D

      public boolean isIs2D()
      Returns the is2D property.
      Returns:
      the is2D property
    • setIs2D

      public void setIs2D(boolean is2D)
      Sets the is2D property.
      Parameters:
      is2D - the new value
    • getIsIdentity

      public boolean getIsIdentity()
      Returns whether this matrix is the identity matrix.
      Returns:
      true if m12 element, m13 element, m14 element, m21 element, m23 element, m24 element, m31 element, m32 element, m34 element, m41 element, m42 element, m43 element are 0 or -0 and m11 element, m22 element, m33 element, m44 element are 1. Otherwise it returns false.
    • flipX

      public DOMMatrix flipX()
      Returns a new matrix being the result of the original matrix flipped about the x-axis.
      Returns:
      a new matrix being the result of the original matrix flipped about the x-axis. This is equivalent to multiplying the matrix by DOMMatrix(-1, 0, 0, 1, 0, 0). The original matrix is not modified.
    • flipY

      public DOMMatrix flipY()
      Returns a new matrix being the result of the original matrix flipped about the y-axis.
      Returns:
      a new matrix being the result of the original matrix flipped about the y-axis. This is equivalent to multiplying the matrix by DOMMatrix(1, 0, 0, -1, 0, 0). The original matrix is not modified.
    • inverse

      public DOMMatrix inverse()
      Returns a new matrix which is the inverse of the original matrix.
      Returns:
      new matrix which is the inverse of the original matrix. If the matrix cannot be inverted, the new matrix's components are all set to NaN and its is2D property is set to false. The original matrix is not changed.
    • multiply

      public DOMMatrix multiply(Object other)
      Returns a new matrix which is the dot product of the matrix and the given matrix.
      Parameters:
      other - the matrix to multiply with this matrix
      Returns:
      a new matrix which is the dot product of the matrix and the otherMatrix parameter. If otherMatrix is omitted, the matrix is multiplied by a matrix in which every element is 0 except the bottom-right corner and the element immediately above and to its left: m33 and m34. These have the default value of 1. The original matrix is not modified.
    • rotate

      public DOMMatrixReadOnly rotate(Object rotZ)
      Returns a new matrix rotated about the z-axis by the specified angle.
      Parameters:
      rotZ - the rotation angle in degrees. If omitted, defaults to 0.
      Returns:
      a new matrix which is the result of the original matrix rotated by the specified angle. The rotation is applied around the origin (0, 0) in the 2D plane. The original matrix is not modified.
    • rotateAxisAngle

      public DOMMatrixReadOnly rotateAxisAngle(Object xObj, Object yObj, Object zObj, Object alphaObj)
      Rotates the matrix by a given angle around the specified axis.
      Parameters:
      xObj - the x component of the axis
      yObj - the y component of the axis
      zObj - the z component of the axis
      alphaObj - the rotation angle in degrees
      Returns:
      a new matrix which is the result of the original matrix rotated by the specified axis and angle.
    • skewX

      public DOMMatrixReadOnly skewX(Object alphaObj)
      Returns a new matrix skewed along the x-axis by the specified angle.
      Parameters:
      alphaObj - the angle, in degrees, by which to skew the matrix along the x-axis
      Returns:
      returns a new DOMMatrix created by applying the specified skew transformation to the source matrix along its x-axis. The original matrix is not modified.
    • skewY

      public DOMMatrixReadOnly skewY(Object alphaObj)
      Returns a new matrix skewed along the y-axis by the specified angle.
      Parameters:
      alphaObj - the angle, in degrees, by which to skew the matrix along the y-axis
      Returns:
      returns a new DOMMatrix created by applying the specified skew transformation to the source matrix along its x-axis. The original matrix is not modified.
    • translate

      public DOMMatrixReadOnly translate(Object xObj, Object yObj, Object zObj)
      Creates a new matrix being the result of the original matrix with a translation applied.
      Parameters:
      xObj - a number representing the abscissa (x-coordinate) of the translating vector
      yObj - a number representing the ordinate (y-coordinate) of the translating vector
      zObj - A number representing the z component of the translating vector. If not supplied, this defaults to 0. If this is anything other than 0, the resulting matrix will be 3D
      Returns:
      a DOMMatrix containing a new matrix being the result of the matrix being translated by the given vector. The original matrix is not modified. If a translation is applied about the z-axis, the resulting matrix will be a 4x4 3D matrix.
    • toFloat32Array

      public org.htmlunit.corejs.javascript.typedarrays.NativeFloat32Array toFloat32Array()
      Returns a new Float32Array containing all 16 elements of the matrix.
      Returns:
      a new Float32Array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix. The elements are stored into the array as single-precision floating-point numbers in column-major (colexographical access, or "colex") order. (In other words, down the first column from top to bottom, then the second column, and so forth.)
    • toFloat64Array

      public org.htmlunit.corejs.javascript.typedarrays.NativeFloat64Array toFloat64Array()
      Returns a new Float64Array containing all 16 elements of the matrix.
      Returns:
      a new Float64Array containing all 16 elements (m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44) which comprise the matrix. The elements are stored into the array as single-precision floating-point numbers in column-major (colexographical access, or "colex") order. (In other words, down the first column from top to bottom, then the second column, and so forth.)
    • js_toString

      public String js_toString()
      Returns the values of the matrix as a CSS transform function string.
      Returns:
      the values of the list separated by commas, within matrix() or matrix3d() function syntax.
    • toJSON

      public org.htmlunit.corejs.javascript.Scriptable toJSON()
      Returns a JSON representation of the DOMMatrixReadOnly object.
      Returns:
      a JSON representation of the DOMMatrixReadOnly object