Package com.github.weisj.jsvg.nodes.text
Class TextSpan
java.lang.Object
com.github.weisj.jsvg.nodes.AbstractSVGNode
com.github.weisj.jsvg.nodes.container.BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
com.github.weisj.jsvg.nodes.text.TextSpan
- All Implemented Interfaces:
Container<com.github.weisj.jsvg.nodes.text.TextSegment>,HasContext,HasContext.ByDelegate,HasFontContext,HasFontRenderContext,HasPaintContext,HasShape,HasVectorEffects,SVGNode,CursorContext,com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
@ElementCategories({TextContent,TextContentChild})
@PermittedContent(categories=Descriptive,
anyOf={Anchor.class,TextSpan.class,Animate.class,AnimateTransform.class,Set.class},
charData=true)
public final class TextSpan
extends BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
implements com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.github.weisj.jsvg.nodes.prototype.HasContext
HasContext.ByDelegateNested classes/interfaces inherited from interface com.github.weisj.jsvg.nodes.prototype.HasShape
HasShape.BoxNested classes/interfaces inherited from interface com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment.UseTextLengthForCalculation -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final List<com.github.weisj.jsvg.nodes.text.TextSegment> protected Length[]protected Length[]protected AttributeFontSpecprotected booleanprotected LengthAdjustprotected float[]static final Stringprotected Lengthprotected Length[]protected Length[] -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanacceptChild(@Nullable String id, @NotNull SVGNode node) Determine whether the container accepts thisSVGNodeas a child.voidaddContent(TextContent.Segment content) voidappendTextShape(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull com.github.weisj.jsvg.nodes.text.MutableGlyphRun glyphRun, @NotNull RenderContext context) voidbuild(@NotNull AttributeNode attributeNode) List<? extends com.github.weisj.jsvg.nodes.text.TextSegment> children()Return all children of this container.voidcleanUpLocalCursor(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current, @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor local) @NotNull TextMetricscomputeTextMetrics(@NotNull RenderContext context, @NotNull com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment.UseTextLengthForCalculation flag) @NotNull HasContext@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursorcreateLocalCursor(boolean isInitial, @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current) protected voidbooleanisSegmentVisible(@NotNull RenderContext currentContext) booleanisVisible(@NotNull RenderContext context) voidprepareSegmentForRendering(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull RenderContext context, @NotNull TextOutput textOutput) voidrenderSegmentWithoutLayout(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull RenderContext context, @NotNull Output output) @NotNull StringtagName()final TextAnchortextAnchor(@NotNull RenderContext context) @NotNull Rectangle2DuntransformedElementBounds(@NotNull RenderContext context, HasShape.Box box) final @NotNull ShapeuntransformedElementShape(@NotNull RenderContext context, @NotNull HasShape.Box box) @NotNull Set<VectorEffect> Methods inherited from class com.github.weisj.jsvg.nodes.container.BaseContainerNode
addChild, isAcceptableTypeMethods inherited from class com.github.weisj.jsvg.nodes.AbstractSVGNode
id, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.Container
childrenOfTypeMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.HasContext.ByDelegate
fontRenderContext, fontSpec, paintContextMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.HasShape
elementBounds, elementShape
-
Field Details
-
TAG
- See Also:
-
x
-
y
-
dx
-
dy
-
rotate
protected float[] rotate -
children
-
isVisible
protected boolean isVisible -
fontSpec
-
lengthAdjust
-
textLength
-
-
Constructor Details
-
TextSpan
public TextSpan()
-
-
Method Details
-
tagName
-
doAdd
- Specified by:
doAddin classBaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
-
addContent
- Specified by:
addContentin interfaceSVGNode
-
acceptChild
Description copied from class:BaseContainerNodeDetermine whether the container accepts thisSVGNodeas a child. By default, this will always report true but subclasses may choose to reject certain types of nodes.- Overrides:
acceptChildin classBaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>- Parameters:
id- the id of the nodenode- the node itself- Returns:
- whether the node can be inserted as a child.
-
prepareSegmentForRendering
public void prepareSegmentForRendering(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull TextOutput textOutput) - Specified by:
prepareSegmentForRenderingin interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
renderSegmentWithoutLayout
public void renderSegmentWithoutLayout(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull Output output) - Specified by:
renderSegmentWithoutLayoutin interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
computeTextMetrics
@NotNull public @NotNull TextMetrics computeTextMetrics(@NotNull @NotNull RenderContext context, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment.UseTextLengthForCalculation flag) - Specified by:
computeTextMetricsin interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
appendTextShape
public void appendTextShape(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.MutableGlyphRun glyphRun, @NotNull @NotNull RenderContext context) - Specified by:
appendTextShapein interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
isSegmentVisible
-
build
-
createLocalCursor
@NotNull public @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor createLocalCursor(boolean isInitial, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current) - Specified by:
createLocalCursorin interfaceCursorContext
-
cleanUpLocalCursor
public void cleanUpLocalCursor(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor local) - Specified by:
cleanUpLocalCursorin interfaceCursorContext
-
vectorEffects
- Specified by:
vectorEffectsin interfaceHasVectorEffects
-
contextDelegate
- Specified by:
contextDelegatein interfaceHasContext.ByDelegate
-
children
Description copied from interface:ContainerReturn all children of this container. Note that the return type of this function internationally contains a wild card to make it a compilation error trying to modify it. -
isVisible
-
textAnchor
-
untransformedElementShape
@NotNull public final @NotNull Shape untransformedElementShape(@NotNull @NotNull RenderContext context, @NotNull @NotNull HasShape.Box box) - Specified by:
untransformedElementShapein interfaceHasShape
-
untransformedElementBounds
@NotNull public @NotNull Rectangle2D untransformedElementBounds(@NotNull @NotNull RenderContext context, HasShape.Box box) - Specified by:
untransformedElementBoundsin interfaceHasShape
-