public class Anchor extends Phrase implements TextElementArray, MarkupAttributes
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 and Description |
|---|---|
static java.lang.String |
ANCHOR
This is the anchor tag.
|
protected java.lang.String |
name
This is the name of the
Anchor. |
protected java.lang.String |
reference
This is the reference of the
Anchor. |
font, leading, markupAttributesALIGN_BASELINE, ALIGN_BOTTOM, ALIGN_CENTER, ALIGN_JUSTIFIED, ALIGN_JUSTIFIED_ALL, ALIGN_LEFT, ALIGN_MIDDLE, ALIGN_RIGHT, ALIGN_TOP, ALIGN_UNDEFINED, ANNOTATION, AUTHOR, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE| 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,
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(java.util.Properties attributes)
Returns an
Anchor that has been constructed taking in account
the value of some attributes. |
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 and Description |
|---|---|
java.util.ArrayList |
getChunks()
Gets all the chunks in this element.
|
java.util.Iterator |
getElements()
Gets an iterator of
Elements. |
static boolean |
isTag(java.lang.String tag)
Checks if a given tag corresponds with this object.
|
java.lang.String |
name()
Returns the name of this
Anchor. |
boolean |
process(ElementListener listener)
Processes the element by adding it (or the different parts) to an
ElementListener. |
java.lang.String |
reference()
Gets the reference of this
Anchor. |
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.
|
java.net.URL |
url()
Gets the reference of this
Anchor. |
add, add, addAll, addSpecial, content, font, getInstance, getInstance, getInstance, getMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, isEmpty, leading, leadingDefined, setLeading, setMarkupAttribute, setMarkupAttributesaddAll, clear, clone, contains, ensureCapacity, get, indexOf, iterator, lastIndexOf, listIterator, listIterator, remove, remove, removeAll, removeRange, retainAll, set, size, subList, toArray, toArray, trimToSizefinalize, getClass, notify, notifyAll, wait, wait, waitaddgetMarkupAttribute, getMarkupAttributeNames, getMarkupAttributes, setMarkupAttribute, setMarkupAttributespublic static final java.lang.String ANCHOR
protected 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(java.util.Properties attributes)
Anchor that has been constructed taking in account
the value of some attributes.attributes - Some attributespublic boolean process(ElementListener listener)
ElementListener.public java.util.ArrayList getChunks()
public int type()
public java.util.Iterator getElements()
Elements.Iteratorpublic 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 name()
Anchor.public java.lang.String reference()
Anchor.public java.net.URL url()
Anchor.URLpublic static boolean isTag(java.lang.String tag)
tag - the given tag