TResult - The type of the result this element will provide @author Xyanid on 28.10.2015.public abstract class SVGElementBase<TResult> extends ElementBase<SVGAttributeType,SVGAttributeHolder,SVGDocumentDataProvider,TResult,SVGElementBase<?>,SVGElementBase<?>>
| Modifier | Constructor and Description |
|---|---|
protected |
SVGElementBase(String name,
Attributes attributes,
SVGElementBase<?> parent,
SVGDocumentDataProvider dataProvider)
Creates a new instance of he element using the given attributes, parent and dataProvider.
|
| Modifier and Type | Method and Description |
|---|---|
TResult |
createAndInitializeResult(StyleSupplier styleSupplier)
Creates a result represented by this element and uses the given supplier in order to fetch data needed to initialize the result
|
protected abstract TResult |
createResult(StyleSupplier styleSupplier)
Must be overwritten in the actual implementation to create a new result for this element based on the
information available.
|
protected javafx.scene.Node |
getClipPath(StyleSupplier styleSupplier)
Returns a node which represents the clip path to be applied to this element.
|
TResult |
getResult()
Returns the result for the current element.
|
SVGCssStyle |
getStyle()
Gets the elements own style and resolves its inheritance, also removed any self references.
|
SVGCssStyle |
getStyleAndResolveInheritance(SVGCssStyle otherStyle)
Gets the elements own
SVGCssStyle and combines it with the given SVGCssStyle |
protected javafx.scene.transform.Transform |
getTransformation() |
protected abstract void |
initializeResult(TResult result,
StyleSupplier styleSupplier)
This method will be called in the
createAndInitializeResult(StyleSupplier) and allows to modify the result such as applying a style or
transformations. |
protected void |
storeElementInDocumentDataProvider()
Checks if the element is inside a
SVGDefinitions and store it inside the ElementBase.documentDataProvider if so. |
canConsumeResult, endProcessing, getAttributeHolder, getAttributes, getDocumentDataProvider, getName, getParent, getUnmodifiableChildren, processCharacterData, rememberElement, startProcessing, toStringprotected SVGElementBase(String name, Attributes attributes, SVGElementBase<?> parent, SVGDocumentDataProvider dataProvider) throws IllegalArgumentException
name - value of the elementattributes - attributes of the elementparent - parent of the elementdataProvider - dataprovider to be usedIllegalArgumentException - if either value or dataProvider are nullpublic final TResult getResult() throws SAXException
getResult in class ElementBase<SVGAttributeType,SVGAttributeHolder,SVGDocumentDataProvider,TResult,SVGElementBase<?>,SVGElementBase<?>>SAXException - will be thrown when an error occurs retrieving the resultpublic final TResult createAndInitializeResult(StyleSupplier styleSupplier) throws SVGException
styleSupplier - the StyleSupplier to use when a SVGCssStyle is needed.SVGException - thrown when an exception during creation occurs.public final SVGCssStyle getStyle() throws SVGException
SVGExceptionpublic final SVGCssStyle getStyleAndResolveInheritance(SVGCssStyle otherStyle) throws SVGException
SVGCssStyle and combines it with the given SVGCssStyleotherStyle - the other SVGCssStyle the own style shall be combined with, can be null in which case combineStylesAndResolveInheritance(SVGCssStyle, SVGCssStyle)
is not invoked, hence it will only return its own style.SVGCssStyle if this element combined and resolved with the given SVGCssStyle.SVGException - when an error occurs during the retrieval of the style.protected final javafx.scene.transform.Transform getTransformation()
throws SVGException
CoreAttributeMapper.TRANSFORM is present.
otherwise null.SVGException - if there is a transformation which has invalid data for its matrix.protected final javafx.scene.Node getClipPath(StyleSupplier styleSupplier) throws SVGException
styleSupplier - the StyleSupplier to be used when there is a SVGClipPath defined for the element and it needs a style.SVGException - when there is a SVGClipPath referenced but the reference can not be found in the ElementBase.documentDataProvider.IllegalArgumentException - if the referenced SVGClipPath is an empty string.protected final void storeElementInDocumentDataProvider()
throws SVGException
SVGDefinitions and store it inside the ElementBase.documentDataProvider if so.SVGException - if an error occurs during the retrieval of the id.protected abstract TResult createResult(StyleSupplier styleSupplier) throws SVGException
styleSupplier - the StyleSupplier to use when a SVGCssStyle is needed.SVGException - will be thrown when an error during creation occursprotected abstract void initializeResult(TResult result, StyleSupplier styleSupplier) throws SVGException
createAndInitializeResult(StyleSupplier) and allows to modify the result such as applying a style or
transformations.
The given inheritanceResolver should be used to retrieve such data, this simply is needed because some elements can actually be referenced e.g.
SVGUse and their actual parent is not
the one from which the inherited style attributes can be retrieved.result - the result which should be modified.styleSupplier - the StyleSupplier to use when a SVGCssStyle is needed.SVGException - will be thrown when an error during modificationCopyright © 2016 Saxonia Systems AG. All rights reserved.