Package com.github.weisj.jsvg.nodes.text
Class Text
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.Text
- All Implemented Interfaces:
Container<com.github.weisj.jsvg.nodes.text.TextSegment>,HasClip,HasContext,HasContext.ByDelegate,HasFillRule,HasFilter,HasFontContext,HasFontRenderContext,HasGeometryContext,HasGeometryContext.ByDelegate,HasPaintContext,HasShape,HasVectorEffects,Renderable,Transformable,SVGNode,com.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
@ElementCategories({Graphic,TextContent})
@PermittedContent(categories={Animation,Descriptive,TextContentChild},
anyOf=Anchor.class,
charData=true)
public final class Text
extends BaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
implements HasGeometryContext.ByDelegate
-
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.HasGeometryContext
HasGeometryContext.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 Length[]protected Length[]protected AttributeFontSpecprotected 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.final voidaddContent(char[] content) voidappendTextShape(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull Path2D textShape, @NotNull RenderContext context) voidbuild(@NotNull AttributeNode attributeNode) List<? extends @NotNull com.github.weisj.jsvg.nodes.text.TextSegment>children()Return all children of this container.protected 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 HasContextprotected com.github.weisj.jsvg.nodes.text.GlyphCursorcreateLocalCursor(@NotNull RenderContext context, @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current) protected void@NotNull HasGeometryContextbooleanbooleanisVisible(@NotNull RenderContext context) voidprepareSegmentForRendering(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull RenderContext context) voidrender(@NotNull RenderContext context, @NotNull Output output) protected final voidrenderSegment(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull RenderContext context, @NotNull Output output) voidrenderSegmentWithoutLayout(@NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull RenderContext context, @NotNull Output output) @NotNull StringtagName()@NotNull Rectangle2DuntransformedElementBounds(@NotNull RenderContext context, HasShape.Box box) @NotNull ShapeuntransformedElementShape(@NotNull RenderContext context) @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
fillRule, fontRenderContext, fontSpec, paintContextMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.HasGeometryContext.ByDelegate
clipPath, filter, mask, transform, transformOriginMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.HasShape
elementBounds, elementShapeMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.Renderable
parseIsVisible, requiresInstantiation, shouldEstablishChildContextMethods inherited from interface com.github.weisj.jsvg.nodes.prototype.Transformable
applyTransform, shouldTransform, transformShape
-
Field Details
-
TAG
- See Also:
-
x
-
y
-
dx
-
dy
-
rotate
protected float[] rotate -
fontSpec
-
lengthAdjust
-
textLength
-
-
Constructor Details
-
Text
public Text()
-
-
Method Details
-
tagName
-
build
-
geometryContextDelegate
- Specified by:
geometryContextDelegatein interfaceHasGeometryContext.ByDelegate
-
untransformedElementShape
-
render
-
createLocalCursor
protected com.github.weisj.jsvg.nodes.text.GlyphCursor createLocalCursor(@NotNull @NotNull RenderContext context, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current) -
cleanUpLocalCursor
protected void cleanUpLocalCursor(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor current, @NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor local) -
vectorEffects
- Specified by:
vectorEffectsin interfaceHasVectorEffects
-
contextDelegate
- Specified by:
contextDelegatein interfaceHasContext.ByDelegate
-
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.
-
doAdd
- Specified by:
doAddin classBaseContainerNode<com.github.weisj.jsvg.nodes.text.TextSegment>
-
addContent
public final void addContent(char[] content) - Specified by:
addContentin interfaceSVGNode- Overrides:
addContentin classAbstractSVGNode
-
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. -
renderSegment
protected final void renderSegment(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context, @NotNull @NotNull Output output) -
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
-
hasFixedLength
public boolean hasFixedLength()- Specified by:
hasFixedLengthin 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
-
prepareSegmentForRendering
public void prepareSegmentForRendering(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull RenderContext context) - Specified by:
prepareSegmentForRenderingin interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
appendTextShape
public void appendTextShape(@NotNull @NotNull com.github.weisj.jsvg.nodes.text.GlyphCursor cursor, @NotNull @NotNull Path2D textShape, @NotNull @NotNull RenderContext context) - Specified by:
appendTextShapein interfacecom.github.weisj.jsvg.nodes.text.TextSegment.RenderableSegment
-
untransformedElementBounds
@NotNull public @NotNull Rectangle2D untransformedElementBounds(@NotNull @NotNull RenderContext context, HasShape.Box box) - Specified by:
untransformedElementBoundsin interfaceHasShape
-
isVisible
- Specified by:
isVisiblein interfaceRenderable
-