Hide Comments
Hide Comments

Comments (0)

Base class for SVG elements

SVG elements have a Owner , which specifies the SVG document that provides applicable styles, options, etc

SVG elements can have child elements, stored in the    Items property

SVG elements can have a Parent , which is the parent in the SVG hierarchy for inherited properties.

Namespace: RSSVG

expandingInheritance Hierarchy

TPersistent
  RSSVG.TSVGElement
    RSSVG.TSVGGraphicElement
    RSSVG.TSVGMetadata
 

expandingSyntax

Delphi

type 
  TSVGElement = class(TPersistent) 
  end; 
 

expandingConstructors

 

Name

Description

public constructor

Create(TSVGDocument)

Initializes a new instance of the TSVGElement class.

public destructor

Destroy

Represents the destructor of the TSVGElement class.

Top

expandingProperties

 

Name

Description

public property

Attributes

Represents property Attributes.

public property

BoundsRect

Returns the bounding rectangle for the SVG element unmodified by any transformations

To retrieve the "true" bounding rectangle which has been modified by any transformations, use the GetBoundsRect method

published property

Classes

Specifies the 'classes' that the SVG element belongs to. The classes property assigns one or more class names to an element. The element may be said to belong to these classes. A class name may be shared by several element instances.

published property

Description

Specifies a non-visual Description for the SVG element. When generating FMX controls, the FMX control's Hint property is set to the Description. If the Description is empty, the Hint is set to the Title

published property

ID

Unique name for the SVG element. The SVG document's   AllItems property uses the ID as the unique hash for returning SVG elements

public property

Items

The child SVG Items of the current element. The Parent and Items properties define the hierarchy of a SVG document fragment.

published property

Language

Specifies the Language of the SVG element

public property

Owner

Returns the Owner SVG document for the SVG element.

public property

Parent

The Parent SVG Element of the current element. The Parent and Items properties define the hierarchy of a SVG document fragment.

published property

RequiredExtensions

Specifies a list of required language extensions. Language extensions are capabilities within a user agent that go beyond the feature set defined in this specification. Each extension is identified by an IRI reference.

The RSCL supports no extensions.

published property

RequiredFeatures

Defines a list of feature strings. Determines whether all of the named features are supported by the RSCL.

published property

SystemLanguages

Specifies a list of language names as defined in BCP 47

published property

Title

Specifies a non-visual Title of the SVG element. When generating FMX controls, the FMX control's Hint property is set to Title if the Description property is empty

protected property

UpdateCount

Represents property UpdateCount.

Top

expandingMethods

 

Name

Description

public method

ApplyStyles

Applies all styles that match the element to the element. All child elements also have their styles applied.

public method

Assign(TPersistent)

Represents method Assign(TPersistent).

public method

AssignProperties(TPersistent)

Copies the properties of source to the current element (but not children)

protected method

AssignTo(TPersistent)

Represents method AssignTo(TPersistent).

public method

BeginUpdate

Marks the start of an update session of the element and its children.
 
No change events occur after the BeginUpdate call. A call to BeginUpdate must be complemented by calls to EndUpdate after the update is finished.
 
 

protected method

Change

Represents method Change.

public method

Clear

Clears the SVG element and resets its properties back to their defaults

public method

Clone(TSVGDocument)

Clones the element and all of its child elements. The aOwner parameter should be a different document

protected method

CreateControl(TControl)

Represents method CreateControl(TControl).

protected method

DoLoadFromXML(IXMLNode)

Represents method DoLoadFromXML(IXMLNode).

protected method

DoModifyControl(TControl,TSVGMatrix,TRSRect,TSVGControlElementEvent)

Represents method DoModifyControl(TControl,TSVGMatrix,TRSRect,TSVGControlElementEvent).

protected method

DoOnParsedNode(TSVGElement)

Represents method DoOnParsedNode(TSVGElement).

protected method

DoOnParsingNode(TSVGElement,IXMLNode)

Represents method DoOnParsingNode(TSVGElement,IXMLNode).

public method

Draw(TCanvas,TRect)

Overloaded. Draw the SVG to the specified canvas inside the specified rectangle

public method

Draw(TSVGCanvas,TSVGRect)

Overloaded. Draw the SVG to the specified canvas inside the specified rectangle

protected method

ElementNotification(TObject,TSVGElement,TCollectionNotification)

Represents method ElementNotification(TObject,TSVGElement,TCollectionNotification).

public method

EndUpdate

Marks the end of an update session of the element and its children.
 
The update session must be started first by calling BeginUpdate.
 
EndUpdate decreases a updating semaphore. If all update sessions end and the semaphore is 0, EndUpdate signals a OnChange event.
 

public method

FitToRect(TSVGRect)

Overloaded. Returns a transformation matrix that will properly scale and translate the SVG element's   BoundsRect so that it fits within the input rectangle

public method

FitToRect(TSVGRect,TSVGRect)

Overloaded. Returns a transformation matrix that will properly scale and translate the TargetRect so that it fits within the input rectangle

protected method

GenerateChildControls(TControl,TSVGMatrix,TRSRect,TSVGControlElementEvent)

Represents method GenerateChildControls(TControl,TSVGMatrix,TRSRect,TSVGControlElementEvent).

public method

GenerateControls(TControl,TRSRect,TSVGControlElementEvent)

Overloaded.  Generates FMX controls to represent this SVG element and its children. The Parent parameter specifies the parent control for the generated FMX control.

The FMX control is transformed by a matrix returned from the GetViewMatrix function

public method

GenerateControls(TControl,TSVGMatrix,TRSRect,TSVGControlElementEvent)

Overloaded. Generates FMX controls to represent this SVG element and its children. The Parent parameter specifies the parent control for the generated FMX control.

protected method

GetBoundsRect

Overloaded. Represents method GetBoundsRect.

public method

GetBoundsRect(TSVGMatrix)

Overloaded. Returns the "true" BoundsRect where the boundaries of the element are modified by the input matrix plus (for graphic elements) its transformation Matrix

public method

GetNearestViewBox

Returns the nearest ancestor (Parent, or Parent of Parent, or etc) element that is a TSVGCustomViewBox element

protected method

GetUnitFactors

Represents method GetUnitFactors.

public method

GetViewMatrix(TRect)

Overloaded. Returns a transformation matrix for viewing this element

public method

GetViewMatrix(TSVGMatrix,TRect)

Overloaded. Returns a transformation matrix for viewing this element

public method

GetViewMatrix(TSVGMatrix,TSVGRect)

Overloaded. Returns a transformation matrix for viewing this element

public method

GetViewMatrix(TSVGRect)

Overloaded. Returns a transformation matrix for viewing this element

public method

HasAncestor(TSVGElement)

Returns true if the input element is an ancestor of the current SVG element

public method

HasChild(TSVGElement)

Returns true if the input element is a direct child of the current SVG element

public method

HasDescendant(TSVGElement)

Returns true if the input element is a descendant of the current SVG element

public method

HasExtensions

Returns true if the required extensions are present. The RSCL supports no extensions at this time, if RequiredExtensions is not empty, this method will return False

public method

HasFeatures

Returns true if the Owner document supports all of the features of the element. If all of the given features are supported, then the function evaluates to true; otherwise, the current element and its children are skipped and thus will not be rendered.

public method

HasFollowing(TSVGElement)

Returns true if the input element follows the current SVG element

public method

HasLanguage(String)

Returns True if the Language property matches the language IDs in the input parameter. Multiple languages can be specified by separating the language IDs with commas and/or spaces.

public method

HasLanguages

Returns True if the Owner SVG document fragment supports the Language property or one of the SystemLanguages

public method

HasPreceding(TSVGElement)

Returns true if the input element precedes the current SVG element

public method

HasSibling(TSVGElement)

Returns true if the input element is a sibling (share same Parent) of the current SVG element

public method

LoadFromXML(IXMLNode)

Loads the SVG element's attributes and child nodes from the XML node

public method

Matches(String)

Returns the specificity (>=0) of the match with the selector string or -1 if there is no match.

A selector's specificity is calculated as follows:

1. Count the number of ID selectors in the selector (= a)
2. Count the number of class selectors, attributes selectors, and pseudo-classes in the selector (= b)
3. Count the number of type selectors and pseudo-elements in the selector (= c)
4. Ignore the universal selector
5. Selectors inside the negation pseudo-class are counted like any other, but the negation itself does not count as a pseudo-class.


















Concatenating the three numbers a-b-c (in a number system with a large base) gives the specificity.
 



protected method

ObjectPropChange(TObject)

Represents method ObjectPropChange(TObject).

public method

Reset

Resets the SVG for drawing

protected method

SetParent(TSVGElement)

Represents method SetParent(TSVGElement).

protected method

ShouldDraw

Represents method ShouldDraw.

public methodClass member

SVGType

Returns the SVG element type of the class

public methodClass member

SVGTypeName

Returns the SVG element type name (e.g., 'g', 'rect', etc)

Top

expandingFields

 

Name

Description

public fieldClass member

ControlConstructor

Represents field ControlConstructor.

protected field

FAttributes

Represents field FAttributes.

Top

expandingRemarks

noteNote

The Parent can change often for a SVG element, especially for elements like gradients or markers that can be referenced by other elements. As the SVG document fragment gets painted, the gradient's or marker's parent will change as its element that needs it gets painted.

expandingSee Also

Comments (0)

RiverSoftAVG SVG Component Library (RSCL) © 2013-2015, Thomas G. Grubb