Package com.lowagie.text
Class Anchor
- All Implemented Interfaces:
Element
,TextElementArray
,Serializable
,Cloneable
,Iterable<Element>
,Collection<Element>
,List<Element>
,RandomAccess
,SequencedCollection<Element>
An
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");
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String
This is the name of theAnchor
.protected String
This is the reference of theAnchor
.private static final long
Fields inherited from class com.lowagie.text.Phrase
font, hyphenation, leading
Fields inherited from class java.util.AbstractList
modCount
Fields inherited from interface com.lowagie.text.Element
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, MODIFICATIONDATE, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE, YMARK
-
Constructor Summary
ConstructorsConstructorDescriptionAnchor()
Constructs anAnchor
without specifying a leading.Anchor
(float leading) Constructs anAnchor
with a certain leading.Constructs anAnchor
with a certainChunk
and a certain leading.Constructs anAnchor
with a certain leading and a certainString
.Constructs anAnchor
with a certain leading, a certainString
and a certainFont
.Constructs anAnchor
with a certainChunk
.Constructs anAnchor
with a certainPhrase
.Constructs anAnchor
with a certainString
.Constructs anAnchor
with a certainString
and a certainFont
. -
Method Summary
Modifier and TypeMethodDescriptionGets all the chunks in this element.getName()
Returns the name of thisAnchor
.Gets the reference of thisAnchor
.getUrl()
Gets the reference of thisAnchor
.boolean
process
(ElementListener listener) Processes the element by adding it (or the different parts) to anElementListener
.void
Sets the name of thisAnchor
.void
setReference
(String reference) Sets the reference of thisAnchor
.int
type()
Gets the type of the text element.Methods inherited from class com.lowagie.text.Phrase
add, add, add, addAll, addChunk, addSpecial, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, hasLeading, isContent, isEmpty, isNestable, setFont, setHyphenation, setLeading
Methods inherited from class java.util.ArrayList
addAll, addFirst, addLast, clear, clone, contains, ensureCapacity, equals, forEach, get, getFirst, getLast, hashCode, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeFirst, removeIf, removeLast, removeRange, replaceAll, retainAll, set, size, sort, spliterator, subList, toArray, toArray, trimToSize
Methods inherited from class java.util.AbstractCollection
containsAll, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, stream, toArray
Methods inherited from interface java.util.List
containsAll, reversed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
This is the name of theAnchor
. -
reference
This is the reference of theAnchor
.
-
-
Constructor Details
-
Anchor
public Anchor()Constructs anAnchor
without specifying a leading. -
Anchor
public Anchor(float leading) Constructs anAnchor
with a certain leading.- Parameters:
leading
- the leading
-
Anchor
Constructs anAnchor
with a certainChunk
.- Parameters:
chunk
- aChunk
-
Anchor
Constructs anAnchor
with a certainString
.- Parameters:
string
- aString
-
Anchor
Constructs anAnchor
with a certainString
and a certainFont
.- Parameters:
string
- aString
font
- aFont
-
Anchor
Constructs anAnchor
with a certainChunk
and a certain leading.- Parameters:
leading
- the leadingchunk
- aChunk
-
Anchor
Constructs anAnchor
with a certain leading and a certainString
.- Parameters:
leading
- the leadingstring
- aString
-
Anchor
Constructs anAnchor
with a certain leading, a certainString
and a certainFont
.- Parameters:
leading
- the leadingstring
- aString
font
- aFont
-
Anchor
Constructs anAnchor
with a certainPhrase
.- Parameters:
phrase
- aPhrase
-
-
Method Details
-
process
Processes the element by adding it (or the different parts) to anElementListener
. -
getChunks
Gets all the chunks in this element. -
type
public int type()Gets the type of the text element. -
getName
Returns the name of thisAnchor
.- Returns:
- a name
-
setName
Sets the name of thisAnchor
.- Parameters:
name
- a new name
-
getReference
Gets the reference of thisAnchor
.- Returns:
- a reference
-
setReference
Sets the reference of thisAnchor
.- Parameters:
reference
- a new reference
-
getUrl
Gets the reference of thisAnchor
.- Returns:
- an
URL
-