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
Fields Modifier and Type Field Description private @NotNull java.awt.Color[]colorsprotected TransformValuegradientTransformprotected UnitTypegradientUnitsprivate Percentage[]offsetsprotected SpreadMethodspreadMethodprivate float[]tmpFractions
-
Constructor Summary
Constructors Constructor Description AbstractGradient()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidbuild(@NotNull AttributeNode attributeNode)protected abstract voidbuildGradient(@NotNull AttributeNode attributeNode, Self template)@NotNull java.awt.Color[]colors()protected @NotNull java.awt.geom.AffineTransformcomputeViewTransform(@NotNull MeasureContext measure, @NotNull java.awt.geom.Rectangle2D bounds)voiddrawShape(@NotNull Output output, @NotNull RenderContext context, @NotNull java.awt.Shape shape, @Nullable java.awt.geom.Rectangle2D bounds)voidfillShape(@NotNull Output output, @NotNull RenderContext context, @NotNull java.awt.Shape shape, @Nullable java.awt.geom.Rectangle2D bounds)protected abstract @NotNull java.awt.PaintgradientForBounds(@NotNull MeasureContext measure, @NotNull java.awt.geom.Rectangle2D bounds, Percentage[] gradOffsets, @NotNull java.awt.Color[] gradColors)private static booleanisEffectiveStop(float stopOffset, @NotNull java.awt.Color stopColor, @NotNull java.util.List<@NotNull Percentage> offsetsList, @NotNull java.util.List<@NotNull java.awt.Color> colorsList)private static voidmakeStrictlyIncreasing(@NotNull Percentage @NotNull [] offsets)Percentage[]offsets()protected float[]offsetsToFractions(Percentage[] gradOffsets)private @NotNull java.awt.PaintpaintForBounds(@NotNull MeasureContext context, @NotNull java.awt.geom.Rectangle2D bounds)private voidparseStops(@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 TransformValue gradientTransform
-
gradientUnits
protected UnitType gradientUnits
-
spreadMethod
protected SpreadMethod spreadMethod
-
colors
@NotNull private @NotNull java.awt.Color[] colors
-
offsets
private Percentage[] offsets
-
tmpFractions
private float[] tmpFractions
-
-
Method Detail
-
offsets
public final Percentage[] offsets()
-
colors
@NotNull public final @NotNull java.awt.Color[] colors()
-
build
public final void build(@NotNull @NotNull AttributeNode attributeNode)- Specified by:
buildin interfaceSVGNode- Overrides:
buildin classAbstractSVGNode
-
parseStops
private void parseStops(@NotNull @NotNull java.util.List<Stop> stops)
-
makeStrictlyIncreasing
private static void makeStrictlyIncreasing(@NotNull @NotNull Percentage @NotNull [] offsets)
-
isEffectiveStop
private static boolean isEffectiveStop(float stopOffset, @NotNull @NotNull java.awt.Color stopColor, @NotNull @NotNull java.util.List<@NotNull Percentage> offsetsList, @NotNull @NotNull java.util.List<@NotNull java.awt.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 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)
-
offsetsToFractions
protected float[] offsetsToFractions(Percentage[] gradOffsets)
-
gradientForBounds
@NotNull protected abstract @NotNull java.awt.Paint gradientForBounds(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull java.awt.geom.Rectangle2D bounds, Percentage[] gradOffsets, @NotNull @NotNull java.awt.Color[] gradColors)
-
computeViewTransform
@NotNull protected final @NotNull java.awt.geom.AffineTransform computeViewTransform(@NotNull @NotNull MeasureContext measure, @NotNull @NotNull java.awt.geom.Rectangle2D bounds)
-
-