Menu

class: Element

[413:14] (extern: com.aussom.aussomscript.AElement) extends: object

Extern class element provides managment of HTML elements and works in conjunction with doc to allow editing of the DOM.

Methods

  • Element (string TagName)

    The constructor takes the tag name and creates a new element of that type.

  • getTagName ()

    Gets the tag name of this element.

    • @r A string with the tag name.
  • blur ()

    Invokes the blur event.

    • @r This object.
  • click ()

    Invokes the click event.

    • @r This object.
  • dispatchEvent (string EventName)

    Dispatches a real DOM event of the given name on this element. Listeners registered via addListener will observe the event. Useful for driving 'input', 'change', and similar events from test harnesses or programmatic handlers.

    • @p EventName is a string with the event name to dispatch (e.g. 'click', 'input', 'change').
    • @r This object.
  • focus ()

    Invokes the focus event.

    • @r This object.
  • getByTagName (string TagName)

    Gets a list of child elements with the provided tag name.

    • @p TagName is a string with the tag name to look for.
    • @r A list with the element values.
  • setHtml (string InnerHtml)

    Sets the inner HTML of this element.

    • @p InnerHtml is a string with the inner HTML to set.
    • @r This object.
  • getHtml ()

    Gets the inner HTML of this element.

    • @r A string with the inner HTML.
  • setCss (string CssCode)

    Sets the style CSS text for the element.

    • @p CssCode is a string with the CSS.
    • @r This object.
  • getCss ()

    Gets the style CSS text.

    • @r A string with the CSS text.
  • setStyle (string Property, string Value)

    Sets the inline style property.

    • @p Property is a string with the css property name to set.
    • @p Value is a string with the property value.
    • @r This object.
  • getStyle (string Property)

    Gets the inline style property.

    • @p Property is a string with the css property name to get.
    • @r A string with the style property value.
  • removeStyle (string Property)

    Removes the provided style property.

    • @p Property is a string with the property to remove.
    • @r This object.
  • setAttributes (map Attributes)

    Sets the Element attributes with the provided map. Note that this function clears all the existing attributes that were set previously.

    • @p Attributes is a map with the attributes to set.
  • getAttributes ()

    Gets an Aussom map with the attributes key value pairs.

    • @r An Aussom Map with the attributes.
  • setAttr (string Name, string Value)

    Sets an attribute with the provided name and value.

    • @p Name is the attribute name.
    • @p Value is the attribute value.
    • @r This object.
  • getAttr (string Name)

    Gets the attribute value with the provided name. Returns null when the attribute is absent. For form-element live values use getValue() -- the 'value' attribute is the page-source default and does not track user input; the 'value' DOM property does.

    • @p Name is the attribute name. @r The attribute value or null.
  • setHidden (bool Hidden)

    Sets the hidden flag with the provided value.

    • @p Hidden is a bool with true if hidden and false if not.
    • @r This object
  • getHidden ()

    Gets the hidden flag.

    • @r A bool with true if hidden and false if not.
  • getValue ()

    Returns the .value property of an input, textarea, or select element. Returns an empty string for elements that do not carry a value.

    • @r A string with the current value.
  • setValue (string Value)

    Sets the .value property of an input, textarea, or select element.

    • @p Value is the value to assign.
    • @r this object
  • isChecked ()

    Returns the .checked property of a checkbox or radio input. Returns false for elements that do not carry a checked property.

    • @r A bool with the current checked state.
  • setChecked (bool Checked)

    Sets the .checked property on a checkbox or radio input.

    • @p Checked is a bool with the new checked state.
    • @r this object
  • getComputedStyle (string Property)

    Returns the computed CSS value for the named property as reported by window.getComputedStyle. Reads the post-cascade value rather than the inline style only -- useful for asserting visibility, layout, or any property set via a CSS rule rather than the style attribute.

    • @p Property is the CSS property name (e.g. 'display', 'color').
    • @r A string with the computed value (empty string when unavailable).
  • isFocused ()

    Returns true if this element is currently document.activeElement (i.e. has keyboard focus).

    • @r A bool with the focused state.
  • addListener (string EventName, callback OnCall, PassedObj = null)

    Registers an event listner with the provided event name and function to call on that event. The function definition should look something like myEventListener(string EventName, object EventObj, PassedObj). Available Events: https://www.w3schools.com/jsref/dom_obj_event.asp

    • @p EventName is a string with the event name to register.
    • @p OnCall is a function to call on the event.
    • @p PassedObj is an optional argument to pass which will be passed through to the callback when called.
    • @r This object.
  • add (object Child)

    Appends a child node to the element.

    • @p Child is the child node to append.
    • @r This object.
  • getChildren ()

    Gets a list of children nodes.

    • @r A list of child nodes.
  • getFirstChild ()

    Gets the first child node or returns null if none found.

    • @r A child node.
  • getLastChild ()

    Gets the last child node or returns null if none found.

    • @r A child node.
  • removeChild (object ChildNode)

    Removes the provided child node from this object.

    • @p ChildNode is a child node to remove.
    • @r This object.
  • replaceChild (object NewChild, object OldChild)

    Replaces the provided old child with the provided new child node.

    • @p NewChild is the new child node to replace with.
    • @p OldChild is the old child node to replace.
    • @r This object.
  • getContext2D ()

    Gets the 2d graphics context. See Context2D for details.

    • @p contextId is a string with the context id to get.
    • @r A Context2D object.
  • setWidth (int Width)

    Sets the canvas width.

    • @p Width is an int with the width of the canvas element.
    • @r this object
  • setHeight (int Height)

    Sets the canvas height.

    • @p Height is an int with the height of the canvas element.
    • @r this object
  • setSize (int Width, int Height)

    Sets the canvas size with the provided dimensions.

    • @p Width is an int with the width of the canvas element.
    • @p Height is an int with the height of the canvas element.
    • @r this object
  • clear ()

    Clears all the child nodes.

    • @r This object.
  • getFiles ()

    Returns a FileList for an input[type=file] element, or null if this element is not a file input or no files have been selected.

    • @r A FileList object or null.
  • _init (string TagName)

class: Path2D

[1758:14] (extern: com.aussom.aussomscript.APath2D) extends: object

The Path2D object represents a path that can be built up and then used with Context2D drawing methods such as fill() and stroke().

Methods

  • Path2D (Obj = null)

    Creates a Path2D object from an SVG path data string.

    • @p Obj is a string with the SVG path data (e.g. 'M 10 10 L 50 50'), or an object for the path, or empty.
  • addPath (object Path)

    Adds the given path to the current path.

    • @p Path is the Path2D object to add.
    • @r this object
  • closePath ()

    Closes the current sub-path by drawing a straight line back to the starting point of the path.

    • @r this object
  • moveTo (double X, double Y)

    Moves the starting point of a new sub-path to the given (X, Y) coordinates.

    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • lineTo (double X, double Y)

    Adds a straight line from the current position to the given (X, Y) point.

    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • bezierCurveTo (double Cp1X, double Cp1Y, double Cp2X, double Cp2Y, double X, double Y)

    Adds a cubic Bezier curve to the path with the two given control points and the end point.

    • @p Cp1X is a double with the x coordinate of the first control point.
    • @p Cp1Y is a double with the y coordinate of the first control point.
    • @p Cp2X is a double with the x coordinate of the second control point.
    • @p Cp2Y is a double with the y coordinate of the second control point.
    • @p X is a double with the x coordinate of the end point.
    • @p Y is a double with the y coordinate of the end point.
    • @r this object
  • quadraticCurveTo (double CpX, double CpY, double X, double Y)

    Adds a quadratic Bezier curve to the path with the given control point and end point.

    • @p CpX is a double with the x coordinate of the control point.
    • @p CpY is a double with the y coordinate of the control point.
    • @p X is a double with the x coordinate of the end point.
    • @p Y is a double with the y coordinate of the end point.
    • @r this object
  • arc (double X, double Y, double Radius, double StartAngle, double EndAngle)

    Adds an arc to the path centered at (X, Y) with the given radius, starting at StartAngle and ending at EndAngle going clockwise.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p Radius is a double with the arc radius.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @r this object
  • arcCounterclockwise (double X, double Y, double Radius, double StartAngle, double EndAngle, bool Counterclockwise)

    Adds an arc to the path centered at (X, Y) with the given radius, with direction controlled by the Counterclockwise parameter.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p Radius is a double with the arc radius.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @p Counterclockwise is a bool; true draws counter-clockwise, false clockwise.
    • @r this object
  • arcTo (double X1, double Y1, double X2, double Y2, double Radius)

    Adds an arc to the path with the given control points and radius, connecting the previous point to the first control point with a line.

    • @p X1 is a double with the x coordinate of the first control point.
    • @p Y1 is a double with the y coordinate of the first control point.
    • @p X2 is a double with the x coordinate of the second control point.
    • @p Y2 is a double with the y coordinate of the second control point.
    • @p Radius is a double with the arc radius.
    • @r this object
  • ellipse (double X, double Y, double RadiusX, double RadiusY, double Rotation, double StartAngle, double EndAngle)

    Adds an ellipse to the path centered at (X, Y) with the given x and y radii, rotation, start angle, and end angle, going clockwise.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p RadiusX is a double with the radius on the x axis.
    • @p RadiusY is a double with the radius on the y axis.
    • @p Rotation is a double with the rotation in radians.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @r this object
  • ellipseCounterclockwise (double X, double Y, double RadiusX, double RadiusY, double Rotation, double StartAngle, double EndAngle, bool Counterclockwise)

    Adds an ellipse to the path centered at (X, Y), with direction controlled by the Counterclockwise parameter.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p RadiusX is a double with the radius on the x axis.
    • @p RadiusY is a double with the radius on the y axis.
    • @p Rotation is a double with the rotation in radians.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @p Counterclockwise is a bool; true draws counter-clockwise, false clockwise.
    • @r this object
  • rect (double X, double Y, double Width, double Height)

    Adds a rectangle to the path.

    • @p X is a double with the x coordinate of the top-left corner.
    • @p Y is a double with the y coordinate of the top-left corner.
    • @p Width is a double with the width of the rectangle.
    • @p Height is a double with the height of the rectangle.
    • @r this object

class: Http

[110:21] static (extern: com.aussom.aussomscript.AHttp) extends: object

The static 'Http' class provides global HTTP client support.

Methods

  • get (string Url, map Headers = null)

    Synchronous HTTP GET. Returns an HttpResponse. Throws on error.

    • @p Url is the request URL. @p Headers optional headers map.
    • @r An HttpResponse with body, statusCode, statusText, headers.
  • post (string Url, string Body, map Headers = null)

    Synchronous HTTP POST. Returns an HttpResponse. Throws on error.

    • @p Url is the request URL. @p Body is the request body string.
    • @p Headers optional. @r An HttpResponse.
  • put (string Url, string Body, map Headers = null)

    Synchronous HTTP PUT. Returns an HttpResponse. Throws on error.

    • @p Url is the request URL. @p Body is the request body string.
    • @p Headers optional. @r An HttpResponse.
  • patch (string Url, string Body, map Headers = null)

    Synchronous HTTP PATCH. Returns an HttpResponse. Throws on error.

    • @p Url is the request URL. @p Body is the request body string.
    • @p Headers optional. @r An HttpResponse.
  • delete (string Url, map Headers = null)

    Synchronous HTTP DELETE. Returns an HttpResponse. Throws on error.

    • @p Url is the request URL. @p Headers optional.
    • @r An HttpResponse.
  • getBytes (string Url, map Headers = null)

    Synchronous binary GET. Returns an HttpResponse whose bufferBody holds the received bytes. Throws on error.

    • @p Url is the request URL. @p Headers optional.
    • @r An HttpResponse with bufferBody, statusCode, statusText, headers.
  • postBytes (string Url, object Body, map Headers = null)

    Synchronous binary POST. Returns an HttpResponse with bufferBody. Throws on error.

    • @p Url is the request URL. @p Body is a buffer with the request bytes.
    • @p Headers optional. @r An HttpResponse.
  • putBytes (string Url, object Body, map Headers = null)

    Synchronous binary PUT. Returns an HttpResponse with bufferBody. Throws on error.

    • @p Url is the request URL. @p Body is a buffer with the request bytes.
    • @p Headers optional. @r An HttpResponse.
  • patchBytes (string Url, object Body, map Headers = null)

    Synchronous binary PATCH. Returns an HttpResponse with bufferBody. Throws on error.

    • @p Url is the request URL. @p Body is a buffer with the request bytes.
    • @p Headers optional. @r An HttpResponse.
  • getAsync (string Url, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous HTTP GET.

    • @p Url request URL. @p OnComplete callback(HttpResponse).
    • @p OnError optional callback(string). @p Headers optional. @r null
  • postAsync (string Url, string Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous HTTP POST.

    • @p Url URL. @p Body string. @p OnComplete callback(HttpResponse).
    • @p OnError optional. @p Headers optional. @r null
  • putAsync (string Url, string Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous HTTP PUT.

    • @p Url URL. @p Body string. @p OnComplete callback(HttpResponse).
    • @p OnError optional. @p Headers optional. @r null
  • patchAsync (string Url, string Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous HTTP PATCH.

    • @p Url URL. @p Body string. @p OnComplete callback(HttpResponse).
    • @p OnError optional. @p Headers optional. @r null
  • deleteAsync (string Url, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous HTTP DELETE.

    • @p Url URL. @p OnComplete callback(HttpResponse).
    • @p OnError optional. @p Headers optional. @r null
  • getBytesAsync (string Url, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous binary GET. OnComplete receives an HttpResponse with bufferBody.

    • @p Url URL. @p OnComplete callback. @p OnError optional. @p Headers optional. @r null
  • postBytesAsync (string Url, object Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous binary POST.

    • @p Url URL. @p Body buffer. @p OnComplete callback. @p OnError optional. @p Headers optional. @r null
  • putBytesAsync (string Url, object Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous binary PUT.

    • @p Url URL. @p Body buffer. @p OnComplete callback. @p OnError optional. @p Headers optional. @r null
  • patchBytesAsync (string Url, object Body, callback OnComplete, callback OnError = null, map Headers = null)

    Asynchronous binary PATCH.

    • @p Url URL. @p Body buffer. @p OnComplete callback. @p OnError optional. @p Headers optional. @r null

class: Context2D

[869:14] (extern: com.aussom.aussomscript.AContext2D) extends: object

The Context2D object is provided from Element.getContext2D() and provides 2D support for drawing in a Canvas.

Methods

  • setFillStyle (string FillStyle)

    Sets the fill style with the provided string.

    • @p FillStyle is a string with the fill style to set.
    • @r this object
  • setStrokeStyle (string StrokeStyle)

    Sets the stroke style with the provided string.

    • @p StrokeStyle is a string with the stroke style to set.
    • @r this object
  • beginPath ()

    Begins a new path by emptying the list of sub-paths.

    • @r this object
  • closePath ()

    Closes the current sub-path by drawing a straight line back to the starting point of the path.

    • @r this object
  • moveTo (double X, double Y)

    Moves the starting point of a new sub-path to the given (x, y) coordinates.

    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • lineTo (double X, double Y)

    Adds a straight line from the current position to the given (x, y) point.

    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • arc (double X, double Y, double Radius, double StartAngle, double EndAngle)

    Adds an arc to the path centered at (X, Y) with the given radius, starting at StartAngle and ending at EndAngle going clockwise.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p Radius is a double with the arc radius.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @r this object
  • arcAnticlockwise (double X, double Y, double Radius, double StartAngle, double EndAngle, bool Anticlockwise)

    Adds an arc to the path centered at (X, Y) with the given radius, starting at StartAngle and ending at EndAngle, with direction controlled by the Anticlockwise parameter.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p Radius is a double with the arc radius.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @p Anticlockwise is a bool; true draws counter-clockwise, false clockwise.
    • @r this object
  • arcTo (double X1, double Y1, double X2, double Y2, double Radius)

    Adds an arc to the path with the given control points and radius, connecting the previous point to the first control point with a line.

    • @p X1 is a double with the x coordinate of the first control point.
    • @p Y1 is a double with the y coordinate of the first control point.
    • @p X2 is a double with the x coordinate of the second control point.
    • @p Y2 is a double with the y coordinate of the second control point.
    • @p Radius is a double with the arc radius.
    • @r this object
  • bezierCurveTo (double Cp1X, double Cp1Y, double Cp2X, double Cp2Y, double X, double Y)

    Adds a cubic Bezier curve to the path with the two given control points and the end point.

    • @p Cp1X is a double with the x coordinate of the first control point.
    • @p Cp1Y is a double with the y coordinate of the first control point.
    • @p Cp2X is a double with the x coordinate of the second control point.
    • @p Cp2Y is a double with the y coordinate of the second control point.
    • @p X is a double with the x coordinate of the end point.
    • @p Y is a double with the y coordinate of the end point.
    • @r this object
  • quadraticCurveTo (double CpX, double CpY, double X, double Y)

    Adds a quadratic Bezier curve to the path with the given control point and end point.

    • @p CpX is a double with the x coordinate of the control point.
    • @p CpY is a double with the y coordinate of the control point.
    • @p X is a double with the x coordinate of the end point.
    • @p Y is a double with the y coordinate of the end point.
    • @r this object
  • rect (double X, double Y, double Width, double Height)

    Adds a rectangle to the current path.

    • @p X is a double with the x coordinate of the top-left corner.
    • @p Y is a double with the y coordinate of the top-left corner.
    • @p Width is a double with the width of the rectangle.
    • @p Height is a double with the height of the rectangle.
    • @r this object
  • clearRect (double X, double Y, double Width, double Height)

    Erases the pixels in the given rectangular area, making them fully transparent.

    • @p X is a double with the x coordinate of the top-left corner.
    • @p Y is a double with the y coordinate of the top-left corner.
    • @p Width is a double with the width of the area.
    • @p Height is a double with the height of the area.
    • @r this object
  • ellipse (double X, double Y, double RadiusX, double RadiusY, double Rotation, double StartAngle, double EndAngle)

    Adds an ellipse to the path centered at (X, Y) with the given x and y radii, rotation, start angle, and end angle.

    • @p X is a double with the x coordinate of the center.
    • @p Y is a double with the y coordinate of the center.
    • @p RadiusX is a double with the radius on the x axis.
    • @p RadiusY is a double with the radius on the y axis.
    • @p Rotation is a double with the rotation in radians.
    • @p StartAngle is a double with the start angle in radians.
    • @p EndAngle is a double with the end angle in radians.
    • @r this object
  • isPointInPath (double X, double Y)

    Returns whether the given point is contained in the current path.

    • @p X is a double with the x coordinate of the point to test.
    • @p Y is a double with the y coordinate of the point to test.
    • @r A bool that is true if the point is inside the current path.
  • isPointInStroke (double X, double Y)

    Returns whether the given point is inside the area contained by the stroking of the current path.

    • @p X is a double with the x coordinate of the point to test.
    • @p Y is a double with the y coordinate of the point to test.
    • @r A bool that is true if the point is inside the stroked path.
  • clip ()

    Turns the current path into the current clipping region.

    • @r this object
  • fill ()

    Fills the current path using the current fill style.

    • @r this object
  • fillRect (int X, int Y, int Width, int Height)

    Creates a filled rectangle with the provided starting point and width and height.

    • @p X is an int with the x coordinate.
    • @p Y is an int with the y coordinate.
    • @p Width is an int with the width.
    • @p Height is an int with the height.
    • @r this object
  • fillText (string Text, double X, double Y)

    Draws a filled text string at the given (X, Y) position using the current font and fill style.

    • @p Text is a string with the text to draw.
    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • fillTextMax (string Text, double X, double Y, double MaxWidth)

    Draws a filled text string at the given (X, Y) position, constrained to the given maximum width.

    • @p Text is a string with the text to draw.
    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @p MaxWidth is a double with the maximum width in pixels.
    • @r this object
  • stroke ()

    Strokes (outlines) the current path using the current stroke style.

    • @r this object
  • strokeRect (double X, double Y, double Width, double Height)

    Draws an outlined rectangle at the given position with the given width and height using the current stroke style.

    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @p Width is a double with the width.
    • @p Height is a double with the height.
    • @r this object
  • strokeText (string Text, double X, double Y)

    Draws an outlined text string at the given (X, Y) position using the current font and stroke style.

    • @p Text is a string with the text to draw.
    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @r this object
  • strokeTextMax (string Text, double X, double Y, double MaxWidth)

    Draws an outlined text string at the given (X, Y) position, constrained to the given maximum width.

    • @p Text is a string with the text to draw.
    • @p X is a double with the x coordinate.
    • @p Y is a double with the y coordinate.
    • @p MaxWidth is a double with the maximum width in pixels.
    • @r this object
  • setTransform (double M11, double M12, double M21, double M22, double Dx, double Dy)

    Resets the current transform to the matrix described by the six provided values.

    • @p M11 is a double with the horizontal scaling.
    • @p M12 is a double with the horizontal skewing.
    • @p M21 is a double with the vertical skewing.
    • @p M22 is a double with the vertical scaling.
    • @p Dx is a double with the horizontal translation.
    • @p Dy is a double with the vertical translation.
    • @r this object
  • transform (double M11, double M12, double M21, double M22, double Dx, double Dy)

    Multiplies the current transformation matrix by the matrix described by the six provided values.

    • @p M11 is a double with the horizontal scaling.
    • @p M12 is a double with the horizontal skewing.
    • @p M21 is a double with the vertical skewing.
    • @p M22 is a double with the vertical scaling.
    • @p Dx is a double with the horizontal translation.
    • @p Dy is a double with the vertical translation.
    • @r this object
  • translate (double X, double Y)

    Adds a translation transformation to the current matrix.

    • @p X is a double with the distance to move in the x direction.
    • @p Y is a double with the distance to move in the y direction.
    • @r this object
  • rotate (double Angle)

    Adds a rotation to the current transformation matrix.

    • @p Angle is a double with the rotation angle in radians, clockwise.
    • @r this object
  • scale (double X, double Y)

    Adds a scaling transformation to the canvas units by the given x and y factors.

    • @p X is a double with the scaling factor in the horizontal direction.
    • @p Y is a double with the scaling factor in the vertical direction.
    • @r this object
  • save ()

    Saves the entire state of the canvas by pushing it onto a stack.

    • @r this object
  • restore ()

    Restores the most recently saved canvas state by popping it off the stack.

    • @r this object
  • getLineCap ()

    Gets the current line cap style.

    • @r A string with the line cap style ('butt', 'round', or 'square').
  • setLineCap (string LineCap)

    Sets the line cap style.

    • @p LineCap is a string with the line cap style ('butt', 'round', or 'square').
    • @r this object
  • getLineDashOffset ()

    Gets the current line dash offset.

    • @r A double with the line dash offset.
  • setLineDashOffset (double Offset)

    Sets the line dash offset.

    • @p Offset is a double with the line dash offset.
    • @r this object
  • getLineJoin ()

    Gets the current line join style.

    • @r A string with the line join style ('round', 'bevel', or 'miter').
  • setLineJoin (string LineJoin)

    Sets the line join style.

    • @p LineJoin is a string with the line join style ('round', 'bevel', or 'miter').
    • @r this object
  • getLineWidth ()

    Gets the current line width.

    • @r A double with the line width in pixels.
  • setLineWidth (double Width)

    Sets the line width.

    • @p Width is a double with the line width in pixels.
    • @r this object
  • getMiterLimit ()

    Gets the current miter limit ratio.

    • @r A double with the miter limit.
  • setMiterLimit (double Limit)

    Sets the miter limit ratio.

    • @p Limit is a double with the miter limit.
    • @r this object
  • getGlobalAlpha ()

    Gets the current global alpha (opacity) value.

    • @r A double with the global alpha value between 0.0 (transparent) and 1.0 (opaque).
  • setGlobalAlpha (double Alpha)

    Sets the global alpha (opacity) value applied to all drawing operations.

    • @p Alpha is a double with the alpha value between 0.0 (transparent) and 1.0 (opaque).
    • @r this object
  • getGlobalCompositeOperation ()

    Gets the current global composite operation.

    • @r A string with the global composite operation.
  • setGlobalCompositeOperation (string Operation)

    Sets the global composite operation used when drawing new shapes.

    • @p Operation is a string with the composite operation (e.g. 'source-over').
    • @r this object
  • getShadowBlur ()

    Gets the current shadow blur amount.

    • @r A double with the shadow blur level.
  • setShadowBlur (double Blur)

    Sets the shadow blur amount.

    • @p Blur is a double with the shadow blur level.
    • @r this object
  • getShadowColor ()

    Gets the current shadow color.

    • @r A string with the shadow color.
  • setShadowColor (string Color)

    Sets the shadow color.

    • @p Color is a string with the shadow color.
    • @r this object
  • getShadowOffsetX ()

    Gets the current horizontal shadow offset.

    • @r A double with the shadow offset in the x direction.
  • setShadowOffsetX (double OffsetX)

    Sets the horizontal shadow offset.

    • @p OffsetX is a double with the shadow offset in the x direction.
    • @r this object
  • getShadowOffsetY ()

    Gets the current vertical shadow offset.

    • @r A double with the shadow offset in the y direction.
  • setShadowOffsetY (double OffsetY)

    Sets the vertical shadow offset.

    • @p OffsetY is a double with the shadow offset in the y direction.
    • @r this object
  • getFont ()

    Gets the current font setting.

    • @r A string with the current font (e.g. '10px sans-serif').
  • setFont (string Font)

    Sets the font used for text drawing operations.

    • @p Font is a string with the font (e.g. 'bold 16px Arial').
    • @r this object
  • getTextAlign ()

    Gets the current text alignment setting.

    • @r A string with the text alignment ('left', 'right', 'center', 'start', or 'end').
  • setTextAlign (string Align)

    Sets the text alignment for text drawing operations.

    • @p Align is a string with the alignment ('left', 'right', 'center', 'start', or 'end').
    • @r this object
  • getTextBaseline ()

    Gets the current text baseline setting.

    • @r A string with the text baseline ('top', 'hanging', 'middle', 'alphabetic', 'ideographic', or 'bottom').
  • setTextBaseline (string Baseline)

    Sets the text baseline alignment for text drawing operations.

    • @p Baseline is a string with the baseline ('top', 'hanging', 'middle', 'alphabetic', 'ideographic', or 'bottom').
    • @r this object
  • createLinearGradient (double X0, double Y0, double X1, double Y1)

    Creates a linear gradient along the line between (X0, Y0) and (X1, Y1). Use addColorStop() on the returned CanvasGradient to define colors, then pass the gradient to setFillStyleGradient() or setStrokeStyleGradient().

    • @p X0 is a double with the x coordinate of the gradient start point.
    • @p Y0 is a double with the y coordinate of the gradient start point.
    • @p X1 is a double with the x coordinate of the gradient end point.
    • @p Y1 is a double with the y coordinate of the gradient end point.
    • @r A CanvasGradient object.
  • createRadialGradient (double X0, double Y0, double R0, double X1, double Y1, double R1)

    Creates a radial gradient using the size and coordinates of two circles. Use addColorStop() on the returned CanvasGradient to define colors, then pass the gradient to setFillStyleGradient() or setStrokeStyleGradient().

    • @p X0 is a double with the x coordinate of the start circle center.
    • @p Y0 is a double with the y coordinate of the start circle center.
    • @p R0 is a double with the radius of the start circle.
    • @p X1 is a double with the x coordinate of the end circle center.
    • @p Y1 is a double with the y coordinate of the end circle center.
    • @p R1 is a double with the radius of the end circle.
    • @r A CanvasGradient object.
  • setFillStyleGradient (object Gradient)

    Sets the fill style to the provided CanvasGradient object.

    • @p Gradient is a CanvasGradient object to use as the fill style.
    • @r this object
  • setStrokeStyleGradient (object Gradient)

    Sets the stroke style to the provided CanvasGradient object.

    • @p Gradient is a CanvasGradient object to use as the stroke style.
    • @r this object
  • getFillStyle ()

    Gets the current fill style as a string. Returns the string representation; gradient and pattern values return their JS type name.

    • @r A string with the current fill style.
  • getStrokeStyle ()

    Gets the current stroke style as a string. Returns the string representation; gradient and pattern values return their JS type name.

    • @r A string with the current stroke style.
  • createImageData (double Width, double Height)

    Creates a new, blank ImageData object with the given dimensions. All pixels are set to transparent black.

    • @p Width is a double with the width of the new ImageData.
    • @p Height is a double with the height of the new ImageData.
    • @r An ImageData object, or null if not yet supported.
  • getImageData (double X, double Y, double Width, double Height)

    Returns an ImageData object representing the pixel data for the rectangle of the canvas at the given position and size.

    • @p X is a double with the x coordinate of the top-left corner.
    • @p Y is a double with the y coordinate of the top-left corner.
    • @p Width is a double with the width of the rectangle.
    • @p Height is a double with the height of the rectangle.
    • @r An ImageData object, or null if not yet supported.
  • putImageData (object ImageData, double Dx, double Dy)

    Paints the data from the given ImageData object onto the canvas at the given (Dx, Dy) position.

    • @p ImageData is an ImageData object containing the pixel data.
    • @p Dx is a double with the x offset at which to place the image data.
    • @p Dy is a double with the y offset at which to place the image data.
    • @r this object
  • putImageDataDirty (object ImageData, double Dx, double Dy, double DirtyX, double DirtyY, double DirtyWidth, double DirtyHeight)

    Paints the data from the given ImageData object onto the canvas, applying the given dirty rectangle to restrict what is updated.

    • @p ImageData is an ImageData object containing the pixel data.
    • @p Dx is a double with the x offset at which to place the image data.
    • @p Dy is a double with the y offset at which to place the image data.
    • @p DirtyX is a double with the x of the top-left of the dirty rectangle.
    • @p DirtyY is a double with the y of the top-left of the dirty rectangle.
    • @p DirtyWidth is a double with the width of the dirty rectangle.
    • @p DirtyHeight is a double with the height of the dirty rectangle.
    • @r this object
  • drawImage (object Image, double Dx, double Dy)

    Draws the given image (Element such as canvas or img) at (Dx, Dy). Argument 1 expecting any of: HTMLImageElement, SVGImageElement, HTMLCanvasElement, HTMLVideoElement, OffscreenCanvas, ImageBitmap, VideoFrame.

    • @p Image is an Element object (canvas, img, etc.) to draw.
    • @p Dx is a double with the destination x coordinate.
    • @p Dy is a double with the destination y coordinate.
    • @r this object
  • drawImageDst (object Image, double Dx, double Dy, double Dw, double Dh)

    Draws the given image scaled to the destination rectangle.

    • @p Image is an Element object (canvas, img, etc.) to draw.
    • @p Dx is a double with the destination x coordinate.
    • @p Dy is a double with the destination y coordinate.
    • @p Dw is a double with the destination width.
    • @p Dh is a double with the destination height.
    • @r this object
  • drawImageSrc (object Image, double Sx, double Sy, double Sw, double Sh, double Dx, double Dy, double Dw, double Dh)

    Draws the given image using a source rectangle clipped to a destination rectangle.

    • @p Image is an Element object (canvas, img, etc.) to draw.
    • @p Sx is a double with the source x coordinate.
    • @p Sy is a double with the source y coordinate.
    • @p Sw is a double with the source width.
    • @p Sh is a double with the source height.
    • @p Dx is a double with the destination x coordinate.
    • @p Dy is a double with the destination y coordinate.
    • @p Dw is a double with the destination width.
    • @p Dh is a double with the destination height.
    • @r this object
  • measureText (string Text)

    Returns a TextMetrics object containing information about the measured width and bounding boxes of the provided text string.

    • @p Text is a string with the text to measure.
    • @r A TextMetrics object with measurement data.
  • getLineDash ()

    Gets the current line dash pattern as a list of doubles. Returns an empty list if no dash pattern is set.

    • @r A list of doubles with alternating dash and gap lengths in pixels.
  • setLineDash (LineDash)

    Sets the line dash pattern used when stroking lines.

    • @p LineDash is a list of doubles with alternating dash and gap lengths.
    • @r this object
  • clipPath (object Path)

    Turns the given Path2D into the current clipping region.

    • @p Path is a Path2D object defining the clipping region.
    • @r this object
  • fillPath (object Path)

    Fills the given Path2D using the current fill style.

    • @p Path is a Path2D object to fill.
    • @r this object
  • strokePath (object Path)

    Strokes (outlines) the given Path2D using the current stroke style.

    • @p Path is a Path2D object to stroke.
    • @r this object
  • isPointInPath2D (object Path, double X, double Y)

    Returns whether the given point is inside the given Path2D.

    • @p Path is a Path2D object to test against.
    • @p X is a double with the x coordinate of the point to test.
    • @p Y is a double with the y coordinate of the point to test.
    • @r A bool that is true if the point is inside the path.
  • isPointInStroke2D (object Path, double X, double Y)

    Returns whether the given point is inside the area covered by stroking the given Path2D.

    • @p Path is a Path2D object to test against.
    • @p X is a double with the x coordinate of the point to test.
    • @p Y is a double with the y coordinate of the point to test.
    • @r A bool that is true if the point is inside the stroked path area.
  • scrollPathIntoView ()

    Scrolls the current path into view. Has no visual effect on canvas but may affect accessibility focus rings.

    • @r this object
  • scrollPathIntoViewPath (object Path)

    Scrolls the given Path2D into view.

    • @p Path is a Path2D object to scroll into view.
    • @r this object
  • drawCustomFocusRing (object Element)

    Draws a custom focus ring around the current path if the given element is focused.

    • @p Element is an Element object to check for focus.
    • @r A bool that is true if the focus ring was drawn.
  • drawSystemFocusRing (object Element)

    Draws the system focus ring around the current path for the given element if it is focused.

    • @p Element is an Element object to draw the focus ring for.
    • @r this object
  • getCanvas ()

    Gets the canvas element that this Context2D belongs to.

    • @r The canvas Element object, or null if not yet supported.

class: ImageData

[1679:14] (extern: com.aussom.aussomscript.AImageData) extends: object

The ImageData object which is used in Context2D.

Methods

  • getWidth ()

    Gets the ImageData width.

    • @r An int with the width.
  • getHeight ()

    Gets the ImageData height.

    • @r An int with the height.
  • getData ()

    Gets an Aussom buffer object with the ImageData bytes.

    • @r An Aussom buffer object.

class: Doc

[314:21] static (extern: com.aussom.aussomscript.ADoc) extends: object

The static 'doc' class provides global HTML support.

Methods

  • body ()

    Gets the body element.

    • @r The body element.
  • head ()

    Gets the head element.

    • @r The head element.
  • getById (string Id)

    Gets the element with the provided ID and returns it as an HNode object. This is the preferred way to get page elements for use with HNode methods like add().

    • @p Id is a string with the ID to look for.
    • @r An HNode with the ID or null if not found.
  • getElementById (string Id)

    Gets the raw Element extern with the provided ID. Use this when you need direct access to the Element extern object rather than an HNode wrapper.

    • @p Id is a string with the ID to look for.
    • @r An Element with the ID or null if not found.
  • getBySelector (string Selector)

    Returns the first HNode matching the given CSS selector, or null when nothing matches. Wraps document.querySelector.

    • @p Selector is a CSS selector string.
    • @r An HNode or null.
  • getAllBySelector (string Selector)

    Returns every HNode matching the given CSS selector as an Aussom list. Empty list when nothing matches. Wraps document.querySelectorAll.

    • @p Selector is a CSS selector string.
    • @r A list of HNode (possibly empty).
  • getElementBySelector (string Selector)

    Returns the first raw Element matching the given CSS selector, or null when nothing matches. Use getBySelector for HNode wrapping. Wraps document.querySelector.

    • @p Selector is a CSS selector string.
    • @r An Element or null.
  • getElementsBySelector (string Selector)

    Returns every raw Element matching the given CSS selector as an Aussom list. Use getAllBySelector for HNode wrapping. Wraps document.querySelectorAll.

    • @p Selector is a CSS selector string.
    • @r A list of Element (possibly empty).
  • createElement (string TagName)

    Creates a new raw Element extern with the provided tag name. Use this when you need direct access to the Element extern object rather than an HNode wrapper.

    • @p TagName is a string with the element to create.
    • @r A new Element object.

class: TextMetrics

[1703:14] (extern: com.aussom.aussomscript.ATextMetrics) extends: object

Returned with the metrics of the text.

Methods

  • getWidth ()

    Gets the measured width of the text string.

    • @r A double with the width of the text in pixels.
  • getActualBoundingBoxAscent ()

    Gets the distance from the text baseline to the top of the highest bounding box of the actual glyphs rendered.

    • @r A double with the ascent distance above the baseline in pixels.
  • getActualBoundingBoxDescent ()

    Gets the distance from the text baseline to the bottom of the lowest bounding box of the actual glyphs rendered.

    • @r A double with the descent distance below the baseline in pixels.
  • getActualBoundingBoxLeft ()

    Gets the distance from the alignment point to the left side of the bounding box of the actual glyphs rendered.

    • @r A double with the distance to the left edge of the bounding box in pixels.
  • getActualBoundingBoxRight ()

    Gets the distance from the alignment point to the right side of the bounding box of the actual glyphs rendered.

    • @r A double with the distance to the right edge of the bounding box in pixels.
  • getFontBoundingBoxAscent ()

    Gets the distance from the text baseline to the top of the highest bounding box of the font's em square.

    • @r A double with the font ascent distance above the baseline in pixels.
  • getFontBoundingBoxDescent ()

    Gets the distance from the text baseline to the bottom of the lowest bounding box of the font's em square.

    • @r A double with the font descent distance below the baseline in pixels.

class: HttpResponse

[255:7] extends: object

HTTP response object returned by Http requests.

Members

  • body

    The response body as a string. Empty for binary responses.

  • bufferBody

    The binary response body as a buffer, or null for text responses.

  • statusCode

    The HTTP status code.

  • statusText

    The HTTP status code text.

  • headers

    A string with the response headers.

  • readyState

    An integer with the ready state.

  • responseType

    A string with the response type.

Methods

  • isSuccessful ()

    Returns the is successful flag. This function checks for a 20X status code.

    • @r A bool with true for success and false for not.

class: Text

[729:14] (extern: com.aussom.aussomscript.AText) extends: object

Extern class element provides managment of HTML elements and works in conjunction with doc to allow editing of the DOM.

Methods

  • Text (string TextValue)

    The constructor takes the text value and creates a new text node.

  • add (object Child)

    Appends a child node to the text node.

    • @p Child is the child node to append.
    • @r This object.
  • set (string Value)

    Sets the text value.

    • @p Value is a string with the text to set.
    • @r This object.
  • get ()

    Gets the text value as a string.

    • @r A string with the text value.
  • getChildren ()

    Gets a list of children nodes.

    • @r A list of child nodes.
  • getFirstChild ()

    Gets the first child node or returns null if none found.

    • @r A child node.
  • getLastChild ()

    Gets the last child node or returns null if none found.

    • @r A child node.
  • removeChild (object ChildNode)

    Removes the provided child node from this object.

    • @p ChildNode is a child node to remove.
    • @r This object.
  • replaceChild (object NewChild, object OldChild)

    Replaces the provided old child with the provided new child node.

    • @p NewChild is the new child node to replace with.
    • @p OldChild is the old child node to replace.
    • @r This object.
  • clear ()

    Clears all the child nodes.

    • @r This object.
  • _init (string TextValue)

class: Event

[821:14] (extern: com.aussom.aussomscript.AEvent) extends: object

Extern class element provides managment of HTML elements and works in conjunction with doc to allow editing of the DOM.

Methods

  • getType ()

    Gets a string with the event type.

    • @r A string with the event type.
  • preventDefault ()

    Prevents the default.

    • @r This object.
  • stopPropagation ()

    Stops the event propogation.

    • @r This object.
  • getEventPhase ()

    Gets the event phase number.

    • @r An int with the event phase.
  • isBubbles ()

    Checks to see if the event bubbles.

    • @r A boolean with true if bubbles and false if not.
  • isCancelable ()

    Checks to see if the event is cancelable.

    • @r A bool with true if cancelable and false if not.
  • toString ()

    Gets a string representation of this event object.

    • @r A string with the event object.

class: CanvasGradient

[1665:14] (extern: com.aussom.aussomscript.ACanvasGradient) extends: object

The CanvasGradient object is returned from various Context2D function and is used to add a color stop to the gradient.

Methods

  • addColorStop (double Offset, string Color)

    Adds the color stop to the gradient with the provided offset and color.

    • @p Offset is a double with the offset value.
    • @p Color is a string with the color value.
    • @r this object

class: Win

[8:21] static (extern: com.aussom.aussomscript.AWin) extends: object

The static 'Win' class provides global HTML support.

Methods

  • currentPath ()

    Gets the current path directory.

    • @r A string with the current path.
  • invokeSimple (string functionName, string arg = "")

    Invokes the Javascript function with the provided functionName and string argument. This method uses windowfunctionName to execute the function and returns the result as a string. A possible way to pass arguments to/from this function is to convert to/from JSON.

    • @p functionName is a string with the function name to invoke.
    • @p arg is a string with the argument to pass.
    • @r A string with the result.
  • eval (string code)

    Evaluates the provided Javascript code and returns the result.

    • @p code is a string with the Javascript to run.
    • @r A converted type.
  • alert (string message)

    Executes the browser alert function with the provided message.

    • @p message is a string with the message to alert.
    • @r null
  • getSelectValueByName (string name)

    Gets the value of the select with the provided name.

    • @p name is a string with the select name.
    • @r A string with the value.
  • getValueByName (string name)

    Gets the value of the form element with the provided name.

    • @p name is a string with the element name.
    • @r A string with the value.
  • getFileValuesByName (string name)

    Gets the file valules of the form element with the provided name.

    • @p name is a string with the element name.
    • @r A list of files or null if not found.
  • setValueByName (string name, string value)

    Sets the value of any form element with the provided name and value.

    • @p name is a string with the select name.
    • @p value is a string with the value to set.
    • @r This object.
  • getCheckedByName (string name)

    Gets the checked bool of the form element with the provided name.

    • @p name is a string with the element name.
    • @r A bool with the value.
  • setCheckedByName (string name, bool value)

    Sets the checked bool of any form element with the provided name and value.

    • @p name is a string with the select name.
    • @p value is a bool with the check value to set.
    • @r This object.
  • getCheckedById (string id)

    Gets the checked bool of the form element with the provided id.

    • @p id is a string with the element id.
    • @r A bool with the value.
  • setCheckedById (string id, bool value)

    Sets the checked bool of any form element with the provided id and value.

    • @p id is a string with the id.
    • @p value is a bool with the check value to set.
    • @r This object.