public final class SVGUtils extends Object
| Modifier and Type | Method and Description |
|---|---|
static <TShape extends javafx.scene.shape.Shape> |
applyStyle(TShape shape,
CssStyle style,
SVGDataProvider dataProvider)
Applies the basic style every
Shape supports to the given shape. |
static <TData> boolean |
applyStyleDeclaration(CssStyle style,
Enumerations.CssStyleProperty declaration,
Consumer<TData> consumer,
Function<String,TData> converter)
Tries to get the
Enumerations.CssStyleProperty from the given CssStyle.
|
static <TData> boolean |
applyStyleDeclaration(CssStyle style,
Enumerations.CssStyleProperty declaration,
Consumer<TData> consumer,
Function<String,TData> converter,
Function<String,Boolean> validator)
Tries to get the
Enumerations.CssStyleProperty from the given CssStyle.
|
static javafx.scene.transform.Transform |
getTransform(Enumerations.Matrix matrix,
String data,
boolean checkIfStartWithMatrix)
Gets the
Transform that is represented by the given data. |
static javafx.scene.transform.Transform |
getTransform(String data)
Returns the combined transformations available in the given string.
|
static javafx.scene.paint.Paint |
parseColor(String data,
SVGDataProvider provider)
Resolves the given data into a paint.
|
public static javafx.scene.paint.Paint parseColor(String data, SVGDataProvider provider)
data - data to be resolvedprovider - the SVGDataProvider to be used
Paint which represents the colorIllegalArgumentException
- if the the data is empty, the provider is null.
public static <TData> boolean applyStyleDeclaration(CssStyle style, Enumerations.CssStyleProperty declaration, Consumer<TData> consumer, Function<String,TData> converter)
Enumerations.CssStyleProperty from the given CssStyle.
The declaration is
first converted and then consumed.
TData - type of the datastyle - style which will provide tha datadeclaration - declaration to be usedconsumer - consumer which will use that converted dataconverter - converter which will parse the provided data into the desired typepublic static <TData> boolean applyStyleDeclaration(CssStyle style, Enumerations.CssStyleProperty declaration, Consumer<TData> consumer, Function<String,TData> converter, Function<String,Boolean> validator)
Enumerations.CssStyleProperty from the given CssStyle.
The declaration is
first converted and then if need be validated and then consumed.
TData - type of the datastyle - style which will provide tha datadeclaration - declaration to be usedconsumer - consumer which will use that converted dataconverter - converter which will parse the provided data into the desired typevalidator - validator to use, may be null if not needed in which case no validation is performedpublic static <TShape extends javafx.scene.shape.Shape> void applyStyle(TShape shape,
CssStyle style,
SVGDataProvider dataProvider)
throws IllegalArgumentException
Shape supports to the given shape.TShape - type of the shape to be usedshape - Shape to which the the styles should be applied, must not be nullstyle - CssStyle to use,
must not be null
dataProvider - the SVGDataProvider to be used
IllegalArgumentException
- if either shape or style is null
public static javafx.scene.transform.Transform getTransform(String data) throws SVGException
data - the string which contains the transformation data.SVGException - if there is an error in the
transformation data of the given string.
public static javafx.scene.transform.Transform getTransform(Enumerations.Matrix matrix, String data, boolean checkIfStartWithMatrix) throws SVGException
Transform that is represented by the given data. The data must meet the following requirements.
Data can start with the name of the provide Enumerations.Matrix, in which case checkIfStartWithMatrix must be true,
otherwise an exception will occur when the actual data is processed.
Data must contain the values separated with a coma (e.g. 1,2,3). Optionally the values can be embraces with ().
matrix - the matrix to usedata - the data to be used, must not be null or empty or Enumerations.Matrix#NONE.checkIfStartWithMatrix - determines if the given data is to be checked if it starts with the Enumerations.Matrix#nameTransform which contains the transformation represented by the data.IllegalArgumentException
- if the given data is empty or matrix is Enumerations.Matrix#NONE.
SVGException - if there is an error in the
transformation data of the given string.
Copyright © 2015 Saxonia Systems AG. All rights reserved.