Class AbstractGradient<Self extends AbstractGradient<Self>>
java.lang.Object
com.github.weisj.jsvg.nodes.AbstractSVGNode
com.github.weisj.jsvg.nodes.container.BaseContainerNode<SVGNode>
com.github.weisj.jsvg.nodes.container.ContainerNode
com.github.weisj.jsvg.nodes.AbstractGradient<Self>
- Direct Known Subclasses:
LinearGradient, RadialGradient
abstract class AbstractGradient<Self extends AbstractGradient<Self>>
extends ContainerNode
implements SVGPaint
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate @NotNull Color[]protected TransformValueprotected UnitTypeprivate Percentage[]protected SpreadMethodprivate float[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidbuild(@NotNull AttributeNode attributeNode) protected abstract voidbuildGradient(@NotNull AttributeNode attributeNode, Self template) final @NotNull Color[]colors()protected final @NotNull AffineTransformcomputeViewTransform(@NotNull MeasureContext measure, @NotNull Rectangle2D bounds) voiddrawShape(@NotNull Output output, @NotNull RenderContext context, @NotNull Shape shape, @Nullable Rectangle2D bounds) voidfillShape(@NotNull Output output, @NotNull RenderContext context, @NotNull Shape shape, @Nullable Rectangle2D bounds) protected abstract @NotNull PaintgradientForBounds(@NotNull MeasureContext measure, @NotNull Rectangle2D bounds, Percentage[] gradOffsets, @NotNull Color[] gradColors) private static booleanisEffectiveStop(float stopOffset, @NotNull Color stopColor, @NotNull List<@NotNull Percentage> offsetsList, @NotNull List<@NotNull Color> colorsList) private static voidmakeStrictlyIncreasing(@NotNull Percentage @NotNull [] offsets) final Percentage[]offsets()protected float[]offsetsToFractions(Percentage[] gradOffsets) private @NotNull PaintpaintForBounds(@NotNull MeasureContext context, @NotNull Rectangle2D bounds) private voidparseStops(@NotNull List<Stop> stops) private @Nullable AbstractGradient<?> parseTemplate(@NotNull AttributeNode attributeNode) Methods inherited from class ContainerNode
children, doAddMethods inherited from class BaseContainerNode
acceptChild, addChild, isAcceptableTypeMethods inherited from class AbstractSVGNode
addContent, id, toStringMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface Container
childrenOfType
-
Field Details
-
gradientTransform
-
gradientUnits
-
spreadMethod
-
colors
-
offsets
-
tmpFractions
private float[] tmpFractions
-
-
Constructor Details
-
AbstractGradient
AbstractGradient()
-
-
Method Details
-
offsets
-
colors
-
build
- Specified by:
buildin interfaceSVGNode- Overrides:
buildin classAbstractSVGNode
-
parseStops
-
makeStrictlyIncreasing
-
isEffectiveStop
private static boolean isEffectiveStop(float stopOffset, @NotNull @NotNull Color stopColor, @NotNull @NotNull List<@NotNull Percentage> offsetsList, @NotNull @NotNull List<@NotNull Color> colorsList) -
parseTemplate
@Nullable private @Nullable AbstractGradient<?> parseTemplate(@NotNull @NotNull AttributeNode attributeNode) -
buildGradient
protected abstract void buildGradient(@NotNull @NotNull AttributeNode attributeNode, @Nullable Self template) -
fillShape
public void fillShape(@NotNull @NotNull Output output, @NotNull @NotNull RenderContext context, @NotNull @NotNull Shape shape, @Nullable @Nullable Rectangle2D bounds) -
drawShape
public void drawShape(@NotNull @NotNull Output output, @NotNull @NotNull RenderContext context, @NotNull @NotNull Shape shape, @Nullable @Nullable Rectangle2D bounds) -
paintForBounds
@NotNull private @NotNull Paint paintForBounds(@NotNull @NotNull MeasureContext context, @NotNull @NotNull Rectangle2D bounds) -
offsetsToFractions
-
gradientForBounds
@NotNull protected abstract @NotNull Paint gradientForBounds(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull Rectangle2D bounds, Percentage[] gradOffsets, @NotNull @NotNull Color[] gradColors) -
computeViewTransform
@NotNull protected final @NotNull AffineTransform computeViewTransform(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull Rectangle2D bounds)
-