Element, TextElementArray, java.io.Serializable, java.lang.Cloneable, java.lang.Iterable<Element>, java.util.Collection<Element>, java.util.List<Element>, java.util.RandomAccesspublic 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 Form| Modifier and Type | Field | Description |
|---|---|---|
protected java.lang.String |
name |
This is the name of the
Anchor. |
protected java.lang.String |
reference |
This is the reference of the
Anchor. |
ALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANCHOR, ANNOTATION, AUTHOR, BODY, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CHAPTER, CHUNK, CREATIONDATE, CREATOR, DIV, HEADER, IMGRAW, IMGTEMPLATE, JBIG2, JPEG, JPEG2000, KEYWORDS, LANGUAGE, LIST, LISTITEM, MARKED, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, SECTION, SUBJECT, TITLE, WRITABLE_DIRECT, YMARKfont, hyphenation, leading, multipliedLeading, tabSettings| Constructor | Description |
|---|---|
Anchor() |
Constructs an
Anchor without specifying a leading. |
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,
java.lang.String string) |
Constructs an
Anchor with a certain leading
and a certain String. |
Anchor(float leading,
java.lang.String string,
Font font) |
Constructs an
Anchor with a certain leading,
a certain String and a certain Font. |
Anchor(Chunk chunk) |
Constructs an
Anchor with a certain Chunk. |
Anchor(Phrase phrase) |
Constructs an
Anchor with a certain Phrase. |
Anchor(java.lang.String string) |
Constructs an
Anchor with a certain String. |
Anchor(java.lang.String string,
Font font) |
Constructs an
Anchor with a certain String
and a certain Font. |
| Modifier and Type | Method | Description |
|---|---|---|
protected boolean |
applyAnchor(Chunk chunk,
boolean notGotoOK,
boolean localDestination) |
Applies the properties of the Anchor to a Chunk.
|
java.util.List<Chunk> |
getChunks() |
Gets all the chunks in this element.
|
java.lang.String |
getName() |
Returns the name of this
Anchor. |
java.lang.String |
getReference() |
Gets the reference of this
Anchor. |
java.net.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(java.lang.String name) |
Sets the name of this
Anchor. |
void |
setReference(java.lang.String reference) |
Sets the reference of this
Anchor. |
int |
type() |
Gets the type of the text element.
|
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, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitadd, add, add, addAll, addChunk, addSpecial, getContent, getFont, getHyphenation, getInstance, getInstance, getInstance, getLeading, getMultipliedLeading, getTabSettings, getTotalLeading, hasLeading, isContent, isEmpty, isNestable, setFont, setHyphenation, setLeading, setLeading, setMultipliedLeading, setTabSettings, trimprotected java.lang.String name
Anchor.protected java.lang.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 Chunkpublic Anchor(java.lang.String string)
Anchor with a certain String.string - a Stringpublic Anchor(java.lang.String string,
Font font)
Anchor with a certain String
and a certain Font.string - a Stringfont - a Fontpublic Anchor(float leading,
Chunk chunk)
Anchor with a certain Chunk
and a certain leading.leading - the leadingchunk - a Chunkpublic Anchor(float leading,
java.lang.String string)
Anchor with a certain leading
and a certain String.leading - the leadingstring - a Stringpublic Anchor(float leading,
java.lang.String string,
Font font)
Anchor with a certain leading,
a certain String and a certain Font.leading - the leadingstring - a Stringfont - a Fontpublic Anchor(Phrase phrase)
Anchor with a certain Phrase.phrase - a Phrasepublic boolean process(ElementListener listener)
ElementListener.public java.util.List<Chunk> getChunks()
protected boolean applyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination)
chunk - the Chunk (part of the Anchor)notGotoOK - if true, this chunk will determine the local destinationlocalDestination - true if the chunk is a local goto and the reference a local destinationpublic int type()
public void setName(java.lang.String name)
Anchor.name - a new namepublic void setReference(java.lang.String reference)
Anchor.reference - a new referencepublic java.lang.String getName()
Anchor.public java.lang.String getReference()
Anchor.public java.net.URL getUrl()
Anchor.URLCopyright © 1998–2018. All rights reserved.