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
Fields Modifier and Type Field Description private @NotNull java.awt.Color[]
colors
protected java.awt.geom.AffineTransform
gradientTransform
protected UnitType
gradientUnits
private float[]
offsets
protected SpreadMethod
spreadMethod
-
Fields inherited from interface com.github.weisj.jsvg.attributes.paint.SVGPaint
CONTEXT_FILL, CONTEXT_STROKE, CURRENT_COLOR, DEFAULT_PAINT, NONE
-
-
Constructor Summary
Constructors Constructor Description AbstractGradient()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
build(@NotNull AttributeNode attributeNode)
protected abstract void
buildGradient(@NotNull AttributeNode attributeNode, Self template)
@NotNull java.awt.Color[]
colors()
protected @NotNull java.awt.geom.AffineTransform
computeViewTransform(@NotNull java.awt.geom.Rectangle2D bounds)
void
drawShape(@NotNull Output output, @NotNull RenderContext context, @NotNull java.awt.Shape shape, @Nullable java.awt.geom.Rectangle2D bounds)
void
fillShape(@NotNull Output output, @NotNull RenderContext context, @NotNull java.awt.Shape shape, @Nullable java.awt.geom.Rectangle2D bounds)
protected abstract @NotNull java.awt.Paint
gradientForBounds(@NotNull MeasureContext measure, @NotNull java.awt.geom.Rectangle2D bounds, float[] gradOffsets, @NotNull java.awt.Color[] gradColors)
float[]
offsets()
private @NotNull java.awt.Paint
paintForBounds(@NotNull MeasureContext context, @NotNull java.awt.geom.Rectangle2D bounds)
private void
parseStops(@NotNull java.util.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 Detail
-
gradientTransform
protected java.awt.geom.AffineTransform gradientTransform
-
gradientUnits
protected UnitType gradientUnits
-
spreadMethod
protected SpreadMethod spreadMethod
-
colors
@NotNull private @NotNull java.awt.Color[] colors
-
offsets
private float[] offsets
-
-
Method Detail
-
offsets
public final float[] offsets()
-
colors
@NotNull public final @NotNull java.awt.Color[] colors()
-
build
public final void build(@NotNull @NotNull AttributeNode attributeNode)
- Specified by:
build
in interfaceSVGNode
- Overrides:
build
in classAbstractSVGNode
-
parseStops
private void parseStops(@NotNull @NotNull java.util.List<Stop> stops)
-
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 java.awt.Shape shape, @Nullable @Nullable java.awt.geom.Rectangle2D bounds)
-
drawShape
public void drawShape(@NotNull @NotNull Output output, @NotNull @NotNull RenderContext context, @NotNull @NotNull java.awt.Shape shape, @Nullable @Nullable java.awt.geom.Rectangle2D bounds)
-
paintForBounds
@NotNull private @NotNull java.awt.Paint paintForBounds(@NotNull @NotNull MeasureContext context, @NotNull @NotNull java.awt.geom.Rectangle2D bounds)
-
gradientForBounds
@NotNull protected abstract @NotNull java.awt.Paint gradientForBounds(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull java.awt.geom.Rectangle2D bounds, float[] gradOffsets, @NotNull @NotNull java.awt.Color[] gradColors)
-
computeViewTransform
@NotNull protected final @NotNull java.awt.geom.AffineTransform computeViewTransform(@NotNull @NotNull java.awt.geom.Rectangle2D bounds)
-
-