com.lowagie.text

Class Anchor

public class Anchor extends Phrase

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: Element Phrase

Field Summary
protected Stringname
This is the name of the Anchor.
protected Stringreference
This is the reference of the Anchor.
static longserialVersionUID
Constructor Summary
Anchor()
Constructs an Anchor without specifying a leading.
Anchor(float leading)
Constructs an Anchor with a certain leading.
Anchor(Chunk chunk)
Constructs an Anchor with a certain Chunk.
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.
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.
Method Summary
ArrayListgetChunks()
Gets all the chunks in this element.
StringgetName()
Returns the name of this Anchor.
StringgetReference()
Gets the reference of this Anchor.
URLgetUrl()
Gets the reference of this Anchor.
booleanprocess(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.
voidsetName(String name)
Sets the name of this Anchor.
voidsetReference(String reference)
Sets the reference of this Anchor.
inttype()
Gets the type of the text element.

Field Detail

name

protected String name
This is the name of the Anchor.

reference

protected String reference
This is the reference of the Anchor.

serialVersionUID

private static final long serialVersionUID

Constructor Detail

Anchor

public Anchor()
Constructs an Anchor without specifying a leading.

Anchor

public Anchor(float leading)
Constructs an Anchor with a certain leading.

Parameters: leading the leading

Anchor

public Anchor(Chunk chunk)
Constructs an Anchor with a certain Chunk.

Parameters: chunk a Chunk

Anchor

public Anchor(String string)
Constructs an Anchor with a certain String.

Parameters: string a String

Anchor

public Anchor(String string, Font font)
Constructs an Anchor with a certain String and a certain Font.

Parameters: string a String font a Font

Anchor

public Anchor(float leading, Chunk chunk)
Constructs an Anchor with a certain Chunk and a certain leading.

Parameters: leading the leading chunk a Chunk

Anchor

public Anchor(float leading, String string)
Constructs an Anchor with a certain leading and a certain String.

Parameters: leading the leading string a String

Anchor

public Anchor(float leading, String string, Font font)
Constructs an Anchor with a certain leading, a certain String and a certain Font.

Parameters: leading the leading string a String font a Font

Anchor

public Anchor(Phrase phrase)
Constructs an Anchor with a certain Phrase.

Parameters: phrase a Phrase

Method Detail

getChunks

public ArrayList getChunks()
Gets all the chunks in this element.

Returns: an ArrayList

getName

public String getName()
Returns the name of this Anchor.

Returns: a name

getReference

public String getReference()
Gets the reference of this Anchor.

Returns: a reference

getUrl

public URL getUrl()
Gets the reference of this Anchor.

Returns: an URL

process

public boolean process(ElementListener listener)
Processes the element by adding it (or the different parts) to an ElementListener.

Parameters: listener an ElementListener

Returns: true if the element was processed successfully

setName

public void setName(String name)
Sets the name of this Anchor.

Parameters: name a new name

setReference

public void setReference(String reference)
Sets the reference of this Anchor.

Parameters: reference a new reference

type

public int type()
Gets the type of the text element.

Returns: a type