TPaint - the type of the paint needpublic abstract class SVGGradientBase<TPaint extends javafx.scene.paint.Paint> extends SVGElementBase<TPaint>
| Modifier | Constructor and Description |
|---|---|
protected |
SVGGradientBase(String name,
Attributes attributes,
SVGDocumentDataProvider dataProvider)
Creates a new instance of he element using the given attributes, parent and dataProvider.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
convertToAbsoluteCoordinates(javafx.scene.shape.Rectangle boundingBox,
List<Wrapper<javafx.geometry.Point2D>> points)
Converts the given coordinates into absolute coordinates based on the given bounding box.
|
protected void |
convertToRelativeCoordinates(javafx.scene.shape.Rectangle boundingBox,
List<Wrapper<javafx.geometry.Point2D>> points)
Converts the given coordinates into relative coordinates based on the given bounding box.
|
abstract TPaint |
createResult(SVGAttributeTypeRectangle.SVGTypeRectangle elementBoundingBox,
javafx.scene.transform.Transform elementTransform)
This method can be used to create a result, that depends on the provided
SVGElementBase. |
protected TPaint |
createResult(SVGCssStyle ownStyle,
javafx.scene.transform.Transform ownTransform)
Must be overwritten in the actual implementation to create a new result for this element based on the information available.
|
protected Optional<javafx.scene.transform.Transform> |
getCombinedTransform(javafx.scene.transform.Transform elementTransform)
Will be used to get the correct transformation for the gradient if any.
|
protected Optional<javafx.scene.transform.Transform> |
getGradientTransform()
Returns a
Optional containing the CoreAttributeMapper.GRADIENT_TRANSFORM of this gradient if present or Optional.empty(). |
List<javafx.scene.paint.Stop> |
getStops()
Gets the stops related to this gradient.
|
protected void |
initializeResult(TPaint paint,
SVGCssStyle ownStyle,
javafx.scene.transform.Transform ownTransform)
This method will be called in the
SVGElementBase.createAndInitializeResult(SVGCssStyle, Transform) and allows to modify the result such as applying a style or transformations. |
boolean |
keepElement()
Determines if the element will be kept, meaning it will be kept in memory and is available as a parent for all its children.
|
void |
processCharacterData(char[] ch,
int start,
int length)
Will be called when character data (CDATA) is read for an element.
|
protected javafx.scene.shape.Rectangle |
transformBoundingBox(SVGAttributeTypeRectangle.SVGTypeRectangle boundingBox,
javafx.scene.transform.Transform transform)
Creates an adjusted
Rectangle that is the given SVGAttributeTypeRectangle.SVGTypeRectangle which has the given Transform applied. |
createAndInitializeResult, endProcessing, getResult, getTransformation, startProcessinggetAttributeHolder, getAttributes, getDocumentDataProvider, getName, getUnmodifiableChildren, toStringprotected SVGGradientBase(String name, Attributes attributes, SVGDocumentDataProvider dataProvider) throws IllegalArgumentException
name - value of the elementattributes - attributes of the elementdataProvider - dataprovider to be usedIllegalArgumentException - if either value or dataProvider are nullpublic final boolean keepElement()
ElementBasekeepElement in class ElementBase<SVGAttributeType,SVGAttributeHolder,SVGDocumentDataProvider,TPaint extends javafx.scene.paint.Paint,SVGElementBase<?>>public final void processCharacterData(char[] ch,
int start,
int length)
throws SAXException
ElementBaseprocessCharacterData in class ElementBase<SVGAttributeType,SVGAttributeHolder,SVGDocumentDataProvider,TPaint extends javafx.scene.paint.Paint,SVGElementBase<?>>ch - The characters.start - The start position in the character array.length - The number of characters to use from the
character array.SAXException - will be thrown when an error occurs during processing the charactersprotected final void initializeResult(TPaint paint, SVGCssStyle ownStyle, javafx.scene.transform.Transform ownTransform) throws SVGException
SVGElementBaseSVGElementBase.createAndInitializeResult(SVGCssStyle, Transform) 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.initializeResult in class SVGElementBase<TPaint extends javafx.scene.paint.Paint>paint - the result which should be modified.ownStyle - the SVGCssStyle to use, which represents this elements style which is already resolved of inheritance and collisionownTransform - the Transform of this element.SVGException - will be thrown when an error during modificationpublic final List<javafx.scene.paint.Stop> getStops() throws SVGException
SVGException - if an error occurs during the retrieval of the stops.protected final void convertToRelativeCoordinates(javafx.scene.shape.Rectangle boundingBox,
List<Wrapper<javafx.geometry.Point2D>> points)
throws SVGException
boundingBox - the bounding box to be use.points - the points to transform.SVGException - if an error occurs during the transformation.protected final void convertToAbsoluteCoordinates(javafx.scene.shape.Rectangle boundingBox,
List<Wrapper<javafx.geometry.Point2D>> points)
throws SVGException
boundingBox - the bounding box to be use.points - the points to transform.SVGException - if an error occurs during the transformation.protected final javafx.scene.shape.Rectangle transformBoundingBox(SVGAttributeTypeRectangle.SVGTypeRectangle boundingBox, javafx.scene.transform.Transform transform) throws SVGException
Rectangle that is the given SVGAttributeTypeRectangle.SVGTypeRectangle which has the given Transform applied.boundingBox - the SVGAttributeTypeRectangle.SVGTypeRectangle that represents the bounding box.transform - the Transform the transform to apply.Rectangle representing the transformed bounding box.SVGException - if an error occurs during the creation.protected Optional<javafx.scene.transform.Transform> getGradientTransform() throws SVGException
Optional containing the CoreAttributeMapper.GRADIENT_TRANSFORM of this gradient if present or Optional.empty().Optional containing the CoreAttributeMapper.GRADIENT_TRANSFORM of this gradient if present or Optional.empty().SVGException - if an error occurs during the retrieval of the transform cause by an incorrect matrix.protected Optional<javafx.scene.transform.Transform> getCombinedTransform(javafx.scene.transform.Transform elementTransform) throws SVGException
elementTransform - the Transform supplied by the element that uses this gradient.Optional with the correct Transform or Optional.empty() if there is no transform.SVGException - if an error occurs during the retrieval of the transform cause by an incorrect matrix.protected final TPaint createResult(SVGCssStyle ownStyle, javafx.scene.transform.Transform ownTransform) throws SVGException
SVGElementBasecreateResult in class SVGElementBase<TPaint extends javafx.scene.paint.Paint>ownStyle - the SVGCssStyle to use, which represents this elements style which is already resolved of inheritance and collision.ownTransform - the Transform of this element.SVGException - will be thrown when an error during creation occurspublic abstract TPaint createResult(SVGAttributeTypeRectangle.SVGTypeRectangle elementBoundingBox, javafx.scene.transform.Transform elementTransform) throws SVGException
SVGElementBase.elementBoundingBox - the bounding box of the element .elementTransform - the Transform to apply.TPaint.SVGException - if an error occurs during the creation of the result.Copyright © 2017 Saxonia Systems AG. All rights reserved.