Libraries.Data.Formats.ScalableVectorGraphics.Pattern Documentation

The Pattern class is an implementation of SVG pattern definitions to be used in the SVG standard. Like other ScalableVectorGraphicsObjects the pattern class inherits global attributes but it also has its own attributes such as spacing.

Example Code

Libraries.Data.Formats.ScalableVectorGraphics.all

// make the svg pattern definitions
Pattern pattern
pattern:SetCanvasSize(1000,500)
pattern:SetSpacing(50)  
pattern:SetPatternPalette(options:GetPatternPalette())

output pattern:ToText()

Inherits from: Libraries.Language.Object, Libraries.Data.Formats.ScalableVectorGraphics.ScalableVectorGraphicsObject

Actions Documentation

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

ConvertReservedCharacters(text value)

This action returns a new string that automatically converts any characters that are reserved in the HTML specification before placing them into the vector graphic. This prevents the graphic from not compiling in circumstances where a DataFrame created a graphic that used a reserved character.

Parameters

  • text value: the text to be converted

Return

text: A new text value with converted reserved characters.

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetAriaDescribedBy()

This action will give a aria-describedby attribute to the SVG element. This aria-describedby can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescribedBy("This is a blue circle with a radius of 5.0")

GetAriaDescription()

This action will give a aria-description attribute to the SVG element. This aria-description can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescription("This is a blue circle with a radius of 5.0")

GetAriaHidden()

This action will give a aria-hidden attribute to the SVG element. This aria-hideen can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaHidden("true")

GetAriaLabel()

This action will give a aria-label attribute to the SVG element. This aria-label can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabel("My Circle")

GetAriaLabelledBy()

This action will give a aria-labelledby attribute to the SVG element. This aria-labelledby can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabelledBy("id")

GetAriaRoleDescription()

This action will give a aria-roledescription attribute to the SVG element. This aria-roledescription can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaRoleDescription("This is a blue circle with a radius of 5.0")

GetCloseTag(text name, boolean container)

This is an interal action that allows the ScalableVectorGraphicsObject generate the correct closing tag.

Parameters

  • text name
  • boolean container

Return

text:

GetColor()

This action returns the color of the object.

Return

text: the color of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetColor("navy")
output circle:GetColor()

GetDescription()

This action will return the currently set description to a ScalableVectorGraphicsObject.

Return

text: The current text description of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetDescription("This is my circle and it will be blue")
text myDescpription = circle:GetDescription()

GetFill()

This action returns the fill of the object.

Return

text: the fill of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("navy")
output circle:GetFill()

GetFillOpacity()

This action returns the fill opacity of the object.

Return

text: the fill opacity of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("navy")
circle:SetFillOpacity(0.7)
output circle:GetFillOpacity()

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()

GetID()

This action returns the id of the object.

Return

text: the id of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetID("My Circle")
output circle:GetID()

GetOnBlur()

This action will give a blur event handler attribute to the SVG element. This blur can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnBlur("console.log('hello world');")

GetOnFocus()

This action will give a focus event handler attribute to the SVG element. This focus can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Group group
group:SetOnFocus("console.log('hello world');")

GetPatternPalette()

This action retrieves the pattern palette that needs to be defined in the SVG

Return

Libraries.Containers.Array:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

ChartOptions options

Pattern patterns
patterns:GetPatternPalette(options:GetPatternPalette())

GetRole()

This action will give a role attribute to the SVG element. This role can be for general use by a web browser.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetRole("region")

GetStroke()

This action returns the stroke of the object.

Return

text: the stroke of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
output circle:GetStroke()

GetStrokeOpacity()

This action returns the stroke opacity of the object.

Return

text: the stroke opacity of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStroke("navy")
circle:SetStrokeOpacity(0.7)
output circle:GetStrokeOpacity()

GetStrokeWidth()

This action returns the stroke width of the object. Since lengths can have varying units in SVG the unit will be appended to the returned length

Return

text: the stroke width with the unit appended if one was given.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStrokeWidth(5, "%")
text strokeWidth = circle:GetStrokeWidth()

GetStyle()

This action returns the style information of the object.

Return

text: the style information of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyle("fill: skyblue; stroke: navy;")
output circle:GetStyle()

GetStyleClass()

This action will give a class attribute to the SVG element. This class can be for gerneral use by a web browser or for when using a styling sheet on the SVG file.

Return

text:

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetStyleClass("circleClass")

GetTabIndex()

This action returns the tab index of the object.

Return

integer: the tab index of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetTabIndex(5)
output circle:GetTabIndex()

GetTitle()

This action will return the currently set title of the object.

Return

text: The current title of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetTitle("My Circle")
text myTitle = circle:GetTitle()

GlobalAttributesToText()

This is an interal action that allows the ScalableVectorGraphicsObject to write out its global attributes.

Return

text:

IsContainer()

This action is used internally by the system to designate whether the SVG element is a single tag or contains more objects within it.

Return

boolean:

IsOneLine()

This action is used internally by the system to designate whether the SVG element should print with new lines.

Return

boolean:

SetAriaDescribedBy(text ariaDescribedBy)

This action will give a aria-describedby attribute to the SVG element. This aria-describedby can be for general use by a web browser.

Parameters

  • text ariaDescribedBy: The aria-describedby for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescribedBy("This is a blue circle with a radius of 5.0")

SetAriaDescription(text ariaDescription)

This action will give a aria-description attribute to the SVG element. This aria-description can be for general use by a web browser.

Parameters

  • text ariaDescription: The aria-description for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaDescription("This is a blue circle with a radius of 5.0")

SetAriaHidden(text ariaHidden)

This action will give a aria-hidden attribute to the SVG element. This aria-hideen can be for general use by a web browser.

Parameters

  • text ariaHidden: The aria-hidden for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaHidden("true")

SetAriaLabel(text ariaLabel)

This action will give a aria-label attribute to the SVG element. This aria-label can be for general use by a web browser.

Parameters

  • text ariaLabel: The aria-label name for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabel("My Circle")

SetAriaLabelledBy(text ariaLabelledBy)

This action will give a aria-labelledby attribute to the SVG element. This aria-labelledby can be for general use by a web browser.

Parameters

  • text ariaLabelledBy: The aria-labelledby name for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaLabelledBy("id")

SetAriaRoleDescription(text ariaRoleDescription)

This action will give a aria-roledescription attribute to the SVG element. This aria-roledescription can be for general use by a web browser.

Parameters

  • text ariaRoleDescription: The aria-roledescription for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetAriaRoleDescription("This is a blue circle with a radius of 5.0")

SetCanvasSize(integer width, integer height)

This action sets the width and height of canvas (used for default spacings).

Parameters

  • integer width
  • integer height

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Pattern patterns
patterns:SetCanvasSize(100,100)

SetColor(text color)

This action will give a color attribute to the SVG element. This attribute does not directly change an objects color. It provides a color for other attriubtes, such as fill and stroke that may not have a defined color, to inherit a color.

Parameters

  • text color: The color for the object. Color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetColor("green")

SetDescription(text description)

This action will give a description to a ScalableVectorGraphicsObject. When an object has a non-empty description a description tag will be generated when the whole object is written out. A description in SVG functions similarly to the description of an image in HTML.

Parameters

  • text description: The text that will be the description of the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetDescription("This is my circle and it will be blue")

SetFill(Libraries.Game.Graphics.Color fill)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color used to paint the object

Parameters

  • Libraries.Game.Graphics.Color: The fill attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)

SetFill(text fill)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color used to paint the object

Parameters

  • text fill: The fill attribute for the object. For shapes and text this will be a color and color in SVG is defined by the CSS data type so this could be defined a keyword, the RGB cubic-coordinate system, or the HSL cyclindrical-coordinate system.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("green")

SetFillOpacity(text opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

  • text opacity: The fill opacity attribute for the object.

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

Circle circle
circle:SetFill("green")
circle:SetFillOpacity("50%") // alternate: circle:SetFillOpacity("0.5")

SetFillOpacity(number opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

  • number opacity

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)
circle:SetFillOpacity(0.7)

SetFillOpacity(Libraries.Game.Graphics.Color opacity)

This action will give a fill attribute to the SVG element. This attribute may do different things depending on the type of SVG element. For shapes and text it will define the color opaqueness used to paint the object

Parameters

Example

Libraries.Data.Formats.ScalableVectorGraphics.all

use Libraries.Game.Graphics.Color

Color blue
blue:SetColor(0, 0, 1, 1)

Circle circle
circle:SetFill(blue)
circle:SetFillOpacity(blue) // alternate: circle:SetFillOpacity("1")

SetID(text id)

This action will give an ID attribute to the SVG element. This is useful