public class AnnotatedStyledText extends StyledText implements Annotated
| Constructor and Description |
|---|
AnnotatedStyledText(String text,
float size,
org.apache.pdfbox.pdmodel.font.PDFont font,
Color color,
float baselineOffset,
Collection<? extends Annotation> annotations)
Creates a styled text.
|
AnnotatedStyledText(String text,
FontDescriptor fontDescriptor,
Color color,
float leftMargin,
float rightMargin,
float baselineOffset,
Collection<? extends Annotation> annotations)
Creates a styled text.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAllAnnotation(Collection<Annotation> annos)
Adds all annotations.
|
void |
addAnnotation(Annotation annotation)
Adds an annotation.
|
<T extends Annotation> |
getAnnotationsOfType(Class<T> type)
Gets the annotations of a specific type.
|
AnnotatedStyledText |
inheritAttributes(String text,
float leftMargin,
float rightMargin) |
Iterator<Annotation> |
iterator() |
asSequence, getAsent, getBaselineOffset, getColor, getFontDescriptor, getHeight, getLeftMargin, getRightMargin, getText, getWidth, getWidthWithoutMargin, hasMargin, inheritAttributes, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitforEach, spliteratorpublic AnnotatedStyledText(String text, FontDescriptor fontDescriptor, Color color, float leftMargin, float rightMargin, float baselineOffset, Collection<? extends Annotation> annotations)
text - the text to draw. Must not contain line feeds ('\n').fontDescriptor - the font to use.color - the color to use.baselineOffset - the offset of the baseline.leftMargin - the margin left to the text.rightMargin - the margin right to the text.annotations - the annotations associated with the text.public AnnotatedStyledText(String text, float size, org.apache.pdfbox.pdmodel.font.PDFont font, Color color, float baselineOffset, Collection<? extends Annotation> annotations)
text - the text to draw. Must not contain line feeds ('\n').size - the size of the font.font - the font to use..color - the color to use.baselineOffset - the offset of the baseline.annotations - the annotations associated with the text.public Iterator<Annotation> iterator()
iterator in interface Iterable<Annotation>public <T extends Annotation> Iterable<T> getAnnotationsOfType(Class<T> type)
AnnotatedgetAnnotationsOfType in interface AnnotatedT - the annotation type.type - the type of interest.public void addAnnotation(Annotation annotation)
annotation - the annotation to add.public void addAllAnnotation(Collection<Annotation> annos)
annos - the annotations to add.public AnnotatedStyledText inheritAttributes(String text, float leftMargin, float rightMargin)
inheritAttributes in class StyledTextCopyright © 2022. All rights reserved.