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 StringThis is the name of theAnchor.protected StringThis is the reference of theAnchor.private static final longFields inherited from class Phrase
font, hyphenation, leading, multipliedLeading, tabSettingsFields inherited from class AbstractList
modCountFields inherited from interface 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, 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, YMARK -
Constructor Summary
ConstructorsConstructorDescriptionAnchor()Constructs anAnchorwithout specifying a leading.Anchor(float leading) Constructs anAnchorwith a certain leading.Constructs anAnchorwith a certainChunkand a certain leading.Constructs anAnchorwith a certain leading and a certainString.Constructs anAnchorwith a certain leading, a certainStringand a certainFont.Constructs anAnchorwith a certainChunk.Constructs anAnchorwith a certainPhrase.Constructs anAnchorwith a certainString.Constructs anAnchorwith a certainStringand a certainFont. -
Method Summary
Modifier and TypeMethodDescriptionprotected booleanapplyAnchor(Chunk chunk, boolean notGotoOK, boolean localDestination) Applies the properties of the Anchor to a Chunk.Gets all the chunks in this element.getName()Returns the name of thisAnchor.Gets the reference of thisAnchor.getUrl()Gets the reference of thisAnchor.booleanprocess(ElementListener listener) Processes the element by adding it (or the different parts) to anElementListener.voidSets the name of thisAnchor.voidsetReference(String reference) Sets the reference of thisAnchor.inttype()Gets the type of the text element.Methods inherited from class Phrase
add, 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, trimMethods inherited from class 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, trimToSizeMethods inherited from class AbstractCollection
containsAll, toStringMethods inherited from interface Collection
parallelStream, stream, toArrayMethods inherited from interface 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 anAnchorwithout specifying a leading. -
Anchor
public Anchor(float leading) Constructs anAnchorwith a certain leading.- Parameters:
leading- the leading
-
Anchor
-
Anchor
Constructs anAnchorwith a certainString.- Parameters:
string- aString
-
Anchor
-
Anchor
Constructs anAnchorwith a certainChunkand a certain leading.- Parameters:
leading- the leadingchunk- aChunk
-
Anchor
Constructs anAnchorwith a certain leading and a certainString.- Parameters:
leading- the leadingstring- aString
-
Anchor
-
Anchor
Constructs anAnchorwith a certainPhrase.- Parameters:
phrase- aPhrase
-
-
Method Details
-
process
Processes the element by adding it (or the different parts) to anElementListener. -
getChunks
-
applyAnchor
Applies the properties of the Anchor to a Chunk.- Parameters:
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 destination- Returns:
- the value of notGotoOK or false, if a previous Chunk was used to determine the local destination
-
type
-
setName
-
setReference
Sets the reference of thisAnchor.- Parameters:
reference- a new reference
-
getName
-
getReference
-
getUrl
-