Java Doc for Phrase.java in  » PDF » pdf-itext » com » lowagie » text » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » pdf itext » com.lowagie.text 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.util.ArrayList
   com.lowagie.text.Phrase

All known Subclasses:   com.lowagie.text.Anchor,  com.lowagie.text.Paragraph,
Phrase
public class Phrase extends ArrayList implements TextElementArray(Code)
A Phrase is a series of Chunks.

A Phrase has a main Font, but some chunks within the phrase can have a Font that differs from the main Font. All the Chunks in a Phrase have the same leading.

Example:

 // When no parameters are passed, the default leading = 16
 Phrase phrase0 = new Phrase();
 Phrase phrase1 = new Phrase("this is a phrase");
 // In this example the leading is passed as a parameter
 Phrase phrase2 = new Phrase(16, "this is a phrase with leading 16");
 // When a Font is passed (explicitely or embedded in a chunk), the default leading = 1.5 * size of the font
 Phrase phrase3 = new Phrase("this is a phrase with a red, normal font Courier, size 12", FontFactory.getFont(FontFactory.COURIER, 12, Font.NORMAL, new Color(255, 0, 0)));
 Phrase phrase4 = new Phrase(new Chunk("this is a phrase"));
 Phrase phrase5 = new Phrase(18, new Chunk("this is a phrase", FontFactory.getFont(FontFactory.HELVETICA, 16, Font.BOLD, new Color(255, 0, 0)));
 

See Also:   Element
See Also:   Chunk
See Also:   Paragraph
See Also:   Anchor


Field Summary
protected  Fontfont
     This is the font of this phrase.
protected  floatleading
     This is the leading of this phrase.

Constructor Summary
public  Phrase()
     Constructs a Phrase without specifying a leading.
public  Phrase(Phrase phrase)
     Copy constructor for Phrase.
public  Phrase(float leading)
     Constructs a Phrase with a certain leading.
public  Phrase(Chunk chunk)
     Constructs a Phrase with a certain Chunk.
public  Phrase(float leading, Chunk chunk)
     Constructs a Phrase with a certain Chunk and a certain leading.
public  Phrase(String string)
     Constructs a Phrase with a certain String.
public  Phrase(String string, Font font)
     Constructs a Phrase with a certain String and a certain Font.
public  Phrase(float leading, String string)
     Constructs a Phrase with a certain leading and a certain String.
public  Phrase(float leading, String string, Font font)
     Constructs a Phrase with a certain leading, a certain String and a certain Font.
public  Phrase(Properties attributes)
     Returns a Phrase that has been constructed taking in account the value of some attributes.

Method Summary
public  voidadd(int index, Object o)
     Adds a Chunk, an Anchor or another Phrase to this Phrase.
public  booleanadd(Object o)
     Adds a Chunk, Anchor or another Phrase to this Phrase.
public  booleanaddAll(Collection collection)
     Adds a collection of Chunks to this Phrase.
protected  booleanaddChunk(Chunk chunk)
     Adds a Chunk.
protected  voidaddSpecial(Object object)
     Adds a Object to the Paragraph.
public  Stringcontent()
     Returns the content as a String object.
public  Fontfont()
     Gets the font of the first Chunk that appears in this Phrase.
public  ArrayListgetChunks()
     Gets all the chunks in this element.
public  StringgetContent()
     Returns the content as a String object.
public  FontgetFont()
     Gets the font of the first Chunk that appears in this Phrase.
final public static  PhrasegetInstance(String string)
     Gets a special kind of Phrase that changes some characters into corresponding symbols.
final public static  PhrasegetInstance(int leading, String string)
     Gets a special kind of Phrase that changes some characters into corresponding symbols.
final public static  PhrasegetInstance(int leading, String string, Font font)
     Gets a special kind of Phrase that changes some characters into corresponding symbols.
public  floatgetLeading()
     Gets the leading of this phrase.
public  booleanhasLeading()
     Checks you if the leading of this phrase is defined.
public  booleanisEmpty()
     Checks is this Phrase contains no or 1 empty Chunk.
public  floatleading()
     Gets the leading of this phrase.
public  booleanleadingDefined()
     Checks you if the leading of this phrase is defined.
public  booleanprocess(ElementListener listener)
     Processes the element by adding it (or the different parts) to an ElementListener.
public  voidsetFont(Font font)
     Sets the main font of this phrase.
public  voidsetLeading(float leading)
     Sets the leading of this phrase.
public  inttype()
     Gets the type of the text element.

Field Detail
font
protected Font font(Code)
This is the font of this phrase.



leading
protected float leading(Code)
This is the leading of this phrase.




Constructor Detail
Phrase
public Phrase()(Code)
Constructs a Phrase without specifying a leading.



Phrase
public Phrase(Phrase phrase)(Code)
Copy constructor for Phrase.



Phrase
public Phrase(float leading)(Code)
Constructs a Phrase with a certain leading.
Parameters:
  leading - the leading



Phrase
public Phrase(Chunk chunk)(Code)
Constructs a Phrase with a certain Chunk.
Parameters:
  chunk - a Chunk



Phrase
public Phrase(float leading, Chunk chunk)(Code)
Constructs a Phrase with a certain Chunk and a certain leading.
Parameters:
  leading - the leading
Parameters:
  chunk - a Chunk



Phrase
public Phrase(String string)(Code)
Constructs a Phrase with a certain String.
Parameters:
  string - a String



Phrase
public Phrase(String string, Font font)(Code)
Constructs a Phrase with a certain String and a certain Font.
Parameters:
  string - a String
Parameters:
  font - a Font



Phrase
public Phrase(float leading, String string)(Code)
Constructs a Phrase with a certain leading and a certain String.
Parameters:
  leading - the leading
Parameters:
  string - a String



Phrase
public Phrase(float leading, String string, Font font)(Code)
Constructs a Phrase with a certain leading, a certain String and a certain Font.
Parameters:
  leading - the leading
Parameters:
  string - a String
Parameters:
  font - a Font



Phrase
public Phrase(Properties attributes)(Code)
Returns a Phrase that has been constructed taking in account the value of some attributes.
Parameters:
  attributes - Some attributes




Method Detail
add
public void add(int index, Object o)(Code)
Adds a Chunk, an Anchor or another Phrase to this Phrase.
Parameters:
  index - index at which the specified element is to be inserted
Parameters:
  o - an object of type Chunk, Anchor or Phrase
throws:
  ClassCastException - when you try to add something that isn't a Chunk, Anchor or Phrase



add
public boolean add(Object o)(Code)
Adds a Chunk, Anchor or another Phrase to this Phrase.
Parameters:
  o - an object of type Chunk, Anchor or Phrase a boolean
throws:
  ClassCastException - when you try to add something that isn't a Chunk, Anchor or Phrase



addAll
public boolean addAll(Collection collection)(Code)
Adds a collection of Chunks to this Phrase.
Parameters:
  collection - a collection of Chunks, Anchors and Phrases. true if the action succeeded, false if not.
throws:
  ClassCastException - when you try to add something that isn't a Chunk, Anchor or Phrase



addChunk
protected boolean addChunk(Chunk chunk)(Code)
Adds a Chunk.

This method is a hack to solve a problem I had with phrases that were split between chunks in the wrong place.
Parameters:
  chunk - a Chunk to add to the Phrase true if adding the Chunk succeeded




addSpecial
protected void addSpecial(Object object)(Code)
Adds a Object to the Paragraph.
Parameters:
  object - the object to add.



content
public String content()(Code)
Returns the content as a String object. This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase. Phrase.getContent()



font
public Font font()(Code)
Gets the font of the first Chunk that appears in this Phrase. a FontPhrase.getFont()



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



getContent
public String getContent()(Code)
Returns the content as a String object. This method differs from toString because toString will return an ArrayList with the toString value of the Chunks in this Phrase.



getFont
public Font getFont()(Code)
Gets the font of the first Chunk that appears in this Phrase. a Font



getInstance
final public static Phrase getInstance(String string)(Code)
Gets a special kind of Phrase that changes some characters into corresponding symbols.
Parameters:
  string - a newly constructed Phrase



getInstance
final public static Phrase getInstance(int leading, String string)(Code)
Gets a special kind of Phrase that changes some characters into corresponding symbols.
Parameters:
  leading -
Parameters:
  string - a newly constructed Phrase



getInstance
final public static Phrase getInstance(int leading, String string, Font font)(Code)
Gets a special kind of Phrase that changes some characters into corresponding symbols.
Parameters:
  leading -
Parameters:
  string -
Parameters:
  font - a newly constructed Phrase



getLeading
public float getLeading()(Code)
Gets the leading of this phrase. the linespacing



hasLeading
public boolean hasLeading()(Code)
Checks you if the leading of this phrase is defined. true if the leading is defined



isEmpty
public boolean isEmpty()(Code)
Checks is this Phrase contains no or 1 empty Chunk. false if the Phrasecontains more than one or more non-emptyChunks.



leading
public float leading()(Code)
Gets the leading of this phrase. the linespacingPhrase.getLeading()



leadingDefined
public boolean leadingDefined()(Code)
Checks you if the leading of this phrase is defined. true if the leading is definedPhrase.hasLeading()



process
public boolean process(ElementListener listener)(Code)
Processes the element by adding it (or the different parts) to an ElementListener.
Parameters:
  listener - an ElementListener true if the element was processed successfully



setFont
public void setFont(Font font)(Code)
Sets the main font of this phrase.
Parameters:
  font - the new font



setLeading
public void setLeading(float leading)(Code)
Sets the leading of this phrase.
Parameters:
  leading - the new leading



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



Methods inherited from java.util.ArrayList
public boolean add(E e)(Code)(Java Doc)
public void add(int index, E element)(Code)(Java Doc)
public boolean addAll(Collection<? extends E> c)(Code)(Java Doc)
public boolean addAll(int index, Collection<? extends E> c)(Code)(Java Doc)
public void clear()(Code)(Java Doc)
public Object clone()(Code)(Java Doc)
public boolean contains(Object o)(Code)(Java Doc)
public void ensureCapacity(int minCapacity)(Code)(Java Doc)
public E get(int index)(Code)(Java Doc)
public int indexOf(Object o)(Code)(Java Doc)
public boolean isEmpty()(Code)(Java Doc)
public Iterator<E> iterator()(Code)(Java Doc)
public int lastIndexOf(Object o)(Code)(Java Doc)
public ListIterator<E> listIterator(int index)(Code)(Java Doc)
public ListIterator<E> listIterator()(Code)(Java Doc)
public E remove(int index)(Code)(Java Doc)
public boolean remove(Object o)(Code)(Java Doc)
public boolean removeAll(Collection c)(Code)(Java Doc)
protected void removeRange(int fromIndex, int toIndex)(Code)(Java Doc)
public boolean retainAll(Collection c)(Code)(Java Doc)
public E set(int index, E element)(Code)(Java Doc)
public int size()(Code)(Java Doc)
public List<E> subList(int fromIndex, int toIndex)(Code)(Java Doc)
public Object[] toArray()(Code)(Java Doc)
public T[] toArray(T[] a)(Code)(Java Doc)
public void trimToSize()(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.