public class Anchor extends Phrase
Anchor
can be a reference or a destination of a reference.
An Anchor
is a special kind of Phrase
.
It is constructed in the same way.
Example:
Anchor anchor = new Anchor("this is a link"); anchor.setName("LINK"); anchor.setReference("http://www.lowagie.com");
Element
,
Phrase
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected String |
name
This is the name of the
Anchor . |
protected String |
reference
This is the reference of the
Anchor . |
font, hyphenation, leading
modCount
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, FOOTNOTE, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LIST, LISTITEM, MARKED, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
Constructor and Description |
---|
Anchor()
Constructs an
Anchor without specifying a leading. |
Anchor(Chunk chunk)
Constructs an
Anchor with a certain Chunk . |
Anchor(float leading)
Constructs an
Anchor with a certain leading. |
Anchor(float leading,
Chunk chunk)
Constructs an
Anchor with a certain Chunk
and a certain leading. |
Anchor(float leading,
String string)
Constructs an
Anchor with a certain leading
and a certain String . |
Anchor(float leading,
String string,
Font font)
Constructs an
Anchor with a certain leading,
a certain String and a certain Font . |
Anchor(Phrase phrase)
Constructs an
Anchor with a certain Phrase . |
Anchor(String string)
Constructs an
Anchor with a certain String . |
Anchor(String string,
Font font)
Constructs an
Anchor with a certain String
and a certain Font . |
Modifier and Type | Method and Description |
---|---|
ArrayList |
getChunks()
Gets all the chunks in this element.
|
String |
getName()
Returns the name of this
Anchor . |
String |
getReference()
Gets the reference of this
Anchor . |
URL |
getUrl()
Gets the reference of this
Anchor . |
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener . |
void |
setName(String name)
Sets the name of this
Anchor . |
void |
setReference(String reference)
Sets the reference of this
Anchor . |
int |
type()
Gets the type of the text element.
|
add, add, addAll, addChunk, addSpecial, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, hasLeading, isContent, isEmpty, isNestable, setFont, setHyphenation, setLeading
addAll, clear, clone, contains, ensureCapacity, forEach, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeIf, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
equals, hashCode
containsAll, toString
finalize, getClass, notify, notifyAll, wait, wait, wait
containsAll, equals, hashCode
parallelStream, stream
protected String name
Anchor
.protected String reference
Anchor
.public Anchor()
Anchor
without specifying a leading.public Anchor(float leading)
Anchor
with a certain leading.leading
- the leadingpublic Anchor(Chunk chunk)
Anchor
with a certain Chunk
.chunk
- a Chunk
public Anchor(String string)
Anchor
with a certain String
.string
- a String
public Anchor(String string, Font font)
Anchor
with a certain String
and a certain Font
.string
- a String
font
- a Font
public Anchor(float leading, Chunk chunk)
Anchor
with a certain Chunk
and a certain leading.leading
- the leadingchunk
- a Chunk
public Anchor(float leading, String string)
Anchor
with a certain leading
and a certain String
.leading
- the leadingstring
- a String
public Anchor(float leading, String string, Font font)
Anchor
with a certain leading,
a certain String
and a certain Font
.leading
- the leadingstring
- a String
font
- a Font
public Anchor(Phrase phrase)
Anchor
with a certain Phrase
.phrase
- a Phrase
public boolean process(ElementListener listener)
ElementListener
.public ArrayList getChunks()
public int type()
public void setName(String name)
Anchor
.name
- a new namepublic void setReference(String reference)
Anchor
.reference
- a new referencepublic String getName()
Anchor
.public String getReference()
Anchor
.public URL getUrl()
Anchor
.URL
Copyright © 2018. All rights reserved.