Module com.github.weisj.jsvg
Package com.github.weisj.jsvg.nodes
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 AffineTransform
protected UnitType
private float[]
protected SpreadMethod
Fields inherited from interface com.github.weisj.jsvg.attributes.paint.SVGPaint
CONTEXT_FILL, CONTEXT_STROKE, CURRENT_COLOR, DEFAULT_PAINT, NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
build
(@NotNull AttributeNode attributeNode) protected abstract void
buildGradient
(@NotNull AttributeNode attributeNode, Self template) final @NotNull Color[]
colors()
protected final @NotNull AffineTransform
computeViewTransform
(@NotNull Rectangle2D bounds) void
drawShape
(@NotNull Output output, @NotNull RenderContext context, @NotNull Shape shape, @Nullable Rectangle2D bounds) void
fillShape
(@NotNull Output output, @NotNull RenderContext context, @NotNull Shape shape, @Nullable Rectangle2D bounds) protected abstract @NotNull Paint
gradientForBounds
(@NotNull MeasureContext measure, @NotNull Rectangle2D bounds, float[] gradOffsets, @NotNull Color[] gradColors) final float[]
offsets()
private @NotNull Paint
paintForBounds
(@NotNull MeasureContext context, @NotNull Rectangle2D bounds) private void
parseStops
(@NotNull List<Stop> stops) private @Nullable AbstractGradient
<?> parseTemplate
(@NotNull AttributeNode attributeNode) Methods inherited from class com.github.weisj.jsvg.nodes.container.ContainerNode
children, doAdd
Methods inherited from class com.github.weisj.jsvg.nodes.container.BaseContainerNode
acceptChild, addChild, isAcceptableType
Methods inherited from class com.github.weisj.jsvg.nodes.AbstractSVGNode
addContent, id, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.github.weisj.jsvg.nodes.prototype.Container
childrenOfType
-
Field Details
-
gradientTransform
-
gradientUnits
-
spreadMethod
-
colors
-
offsets
private float[] offsets
-
-
Constructor Details
-
AbstractGradient
AbstractGradient()
-
-
Method Details
-
offsets
public final float[] offsets() -
colors
-
build
- Specified by:
build
in interfaceSVGNode
- Overrides:
build
in classAbstractSVGNode
-
parseStops
-
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) -
gradientForBounds
@NotNull protected abstract @NotNull Paint gradientForBounds(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull Rectangle2D bounds, float[] gradOffsets, @NotNull @NotNull Color[] gradColors) -
computeViewTransform
@NotNull protected final @NotNull AffineTransform computeViewTransform(@NotNull @NotNull Rectangle2D bounds)
-