Java Doc for Chunk.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.lang.Object
   com.lowagie.text.Chunk

All known Subclasses:   com.lowagie.text.rtf.RtfAddableElement,  com.lowagie.text.rtf.field.RtfField,  com.lowagie.text.rtf.RtfTOC,  com.lowagie.text.rtf.AbstractRtfField,  com.lowagie.text.rtf.RtfTOCEntry,
Chunk
public class Chunk implements Element(Code)
This is the smallest significant part of text that can be added to a document.

Most elements can be divided in one or more Chunks. A chunk is a String with a certain Font. All other layout parameters should be defined in the object to which this chunk of text is added.

Example:

 Chunk chunk = new Chunk("Hello world",
 FontFactory.getFont(FontFactory.COURIER, 20, Font.ITALIC, new Color(255, 0,
 0)));  document.add(chunk);
 


Field Summary
final public static  StringACTION
     Key for Action.
final public static  StringBACKGROUND
     Key for background.
final public static  StringCOLOR
     Key for color.
final public static  StringENCODING
     Key for encoding.
final public static  StringGENERICTAG
     Key for generic tag.
final public static  StringHSCALE
     Key for text horizontal scaling.
final public static  StringHYPHENATION
     Key for hyphenation.
final public static  StringIMAGE
     Key for image.
final public static  StringLOCALDESTINATION
     Key for local destination.
final public static  StringLOCALGOTO
     Key for local goto.
final public static  ChunkNEWLINE
     This is a Chunk containing a newline.
final public static  StringNEWPAGE
     Key for newpage.
final public static  ChunkNEXTPAGE
     This is a Chunk containing a newpage.
final public static  StringOBJECT_REPLACEMENT_CHARACTER
     The character stand in for an image.
final public static  StringPDFANNOTATION
     Key for annotation.
final public static  StringREMOTEGOTO
     Key for remote goto.
final public static  StringSKEW
     Key for text skewing.
final public static  StringSPLITCHARACTER
     Key for split character.
final public static  StringSUBSUPSCRIPT
     Key for sub/superscript.
final public static  StringTEXTRENDERMODE
     Key for text rendering mode.
final public static  StringUNDERLINE
     Key for underline.
protected  HashMapattributes
     Contains some of the attributes for this Chunk.
protected  StringBuffercontent
     This is the content of this chunk of text.
protected  Fontfont
     This is the Font of this chunk of text.

Constructor Summary
public  Chunk()
     Empty constructor.
public  Chunk(Chunk ck)
     A Chunk copy constructor.
public  Chunk(String content, Font font)
     Constructs a chunk of text with a certain content and a certain Font.
public  Chunk(String content)
     Constructs a chunk of text with a certain content, without specifying a Font.
public  Chunk(char c, Font font)
     Constructs a chunk of text with a char and a certain Font.
public  Chunk(char c)
     Constructs a chunk of text with a char, without specifying a Font .
public  Chunk(Image image, float offsetX, float offsetY)
     Constructs a chunk containing an Image.
public  Chunk(Image image, float offsetX, float offsetY, boolean changeLeading)
     Constructs a chunk containing an Image.
public  Chunk(java.util.Properties attributes)
     Returns a Chunk that has been constructed taking in account the value of some attributes .

Method Summary
public static  Object[][]addToArray(Object original, Object item)
     Utility method to extend an array.
public  StringBufferappend(String string)
     appends some text to this Chunk.
public  Stringcontent()
     Returns the content of this Chunk.
public  Fontfont()
     Gets the font of this Chunk.
public  HashMapgetAttributes()
     Gets the attributes for this Chunk.
public  ArrayListgetChunks()
     Gets all the chunks in this element.
public  StringgetContent()
     Returns the content of this Chunk.
public  FontgetFont()
     Gets the font of this Chunk.
public  floatgetHorizontalScaling()
     Gets the horizontal scaling.
public  ImagegetImage()
     Returns the image.
public static  SetgetKeySet(Hashtable table)
    
public  floatgetTextRise()
     Gets the text displacement relatiev to the baseline.
public  floatgetWidthPoint()
     Gets the width of the Chunk in points.
public  booleanhasAttributes()
     Checks the attributes of this Chunk.
public  booleanisEmpty()
     Checks is this Chunk is empty.
public  booleanprocess(ElementListener listener)
     Processes the element by adding it (or the different parts) to an ElementListener.
public  ChunksetAction(PdfAction action)
     Sets an action for this Chunk.
public  ChunksetAnchor(URL url)
     Sets an anchor for this Chunk.
public  ChunksetAnchor(String url)
     Sets an anchor for this Chunk.
public  ChunksetAnnotation(PdfAnnotation annotation)
     Sets a generic annotation to this Chunk.
public  voidsetAttributes(HashMap attributes)
     Sets the attributes all at once.
public  ChunksetBackground(Color color)
     Sets the color of the background Chunk.
public  ChunksetBackground(Color color, float extraLeft, float extraBottom, float extraRight, float extraTop)
     Sets the color and the size of the background Chunk.
public  voidsetFont(Font font)
     Sets the font of this Chunk.
public  ChunksetGenericTag(String text)
     Sets the generic tag Chunk.
public  ChunksetHorizontalScaling(float scale)
     Sets the text horizontal scaling.
public  ChunksetHyphenation(HyphenationEvent hyphenation)
     sets the hyphenation engine to this Chunk.
public  ChunksetLocalDestination(String name)
     Sets a local destination for this Chunk.
public  ChunksetLocalGoto(String name)
     Sets a local goto for this Chunk.
public  ChunksetNewPage()
     Sets a new page tag..
public  ChunksetRemoteGoto(String filename, String name)
     Sets a goto for a remote destination for this Chunk.
public  ChunksetRemoteGoto(String filename, int page)
     Sets a goto for a remote destination for this Chunk.
Parameters:
  filename - the file name of the destination document
Parameters:
  page - the page of the destination to go to.
public  ChunksetSkew(float alpha, float beta)
     Skews the text to simulate italic and other effects.
public  ChunksetSplitCharacter(SplitCharacter splitCharacter)
     Sets the split characters.
public  ChunksetTextRenderMode(int mode, float strokeWidth, Color strokeColor)
     Sets the text rendering mode.
public  ChunksetTextRise(float rise)
     Sets the text displacement relative to the baseline.
public  ChunksetUnderline(float thickness, float yPosition)
     Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically and has always the Chunk width.
public  ChunksetUnderline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int cap)
     Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically and has always the Chunk width.
public  StringtoString()
     Returns the content of this Chunk.
public  inttype()
     Gets the type of the text element.

Field Detail
ACTION
final public static String ACTION(Code)
Key for Action.



BACKGROUND
final public static String BACKGROUND(Code)
Key for background.



COLOR
final public static String COLOR(Code)
Key for color.



ENCODING
final public static String ENCODING(Code)
Key for encoding.



GENERICTAG
final public static String GENERICTAG(Code)
Key for generic tag.



HSCALE
final public static String HSCALE(Code)
Key for text horizontal scaling.



HYPHENATION
final public static String HYPHENATION(Code)
Key for hyphenation.



IMAGE
final public static String IMAGE(Code)
Key for image.



LOCALDESTINATION
final public static String LOCALDESTINATION(Code)
Key for local destination.



LOCALGOTO
final public static String LOCALGOTO(Code)
Key for local goto.



NEWLINE
final public static Chunk NEWLINE(Code)
This is a Chunk containing a newline.



NEWPAGE
final public static String NEWPAGE(Code)
Key for newpage.



NEXTPAGE
final public static Chunk NEXTPAGE(Code)
This is a Chunk containing a newpage.



OBJECT_REPLACEMENT_CHARACTER
final public static String OBJECT_REPLACEMENT_CHARACTER(Code)
The character stand in for an image.



PDFANNOTATION
final public static String PDFANNOTATION(Code)
Key for annotation.



REMOTEGOTO
final public static String REMOTEGOTO(Code)
Key for remote goto.



SKEW
final public static String SKEW(Code)
Key for text skewing.



SPLITCHARACTER
final public static String SPLITCHARACTER(Code)
Key for split character.



SUBSUPSCRIPT
final public static String SUBSUPSCRIPT(Code)
Key for sub/superscript.



TEXTRENDERMODE
final public static String TEXTRENDERMODE(Code)
Key for text rendering mode.



UNDERLINE
final public static String UNDERLINE(Code)
Key for underline.



attributes
protected HashMap attributes(Code)
Contains some of the attributes for this Chunk.



content
protected StringBuffer content(Code)
This is the content of this chunk of text.



font
protected Font font(Code)
This is the Font of this chunk of text.




Constructor Detail
Chunk
public Chunk()(Code)
Empty constructor.



Chunk
public Chunk(Chunk ck)(Code)
A Chunk copy constructor.
Parameters:
  ck - the Chunk to be copied



Chunk
public Chunk(String content, Font font)(Code)
Constructs a chunk of text with a certain content and a certain Font.
Parameters:
  content - the content
Parameters:
  font - the font



Chunk
public Chunk(String content)(Code)
Constructs a chunk of text with a certain content, without specifying a Font.
Parameters:
  content - the content



Chunk
public Chunk(char c, Font font)(Code)
Constructs a chunk of text with a char and a certain Font.
Parameters:
  c - the content
Parameters:
  font - the font



Chunk
public Chunk(char c)(Code)
Constructs a chunk of text with a char, without specifying a Font .
Parameters:
  c - the content



Chunk
public Chunk(Image image, float offsetX, float offsetY)(Code)
Constructs a chunk containing an Image.
Parameters:
  image - the image
Parameters:
  offsetX - the image offset in the x direction
Parameters:
  offsetY - the image offset in the y direction



Chunk
public Chunk(Image image, float offsetX, float offsetY, boolean changeLeading)(Code)
Constructs a chunk containing an Image.
Parameters:
  image - the image
Parameters:
  offsetX - the image offset in the x direction
Parameters:
  offsetY - the image offset in the y direction
Parameters:
  changeLeading - true if the leading has to be adapted to the image



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




Method Detail
addToArray
public static Object[][] addToArray(Object original, Object item)(Code)
Utility method to extend an array.
Parameters:
  original - the original array or null
Parameters:
  item - the item to be added to the array a new array with the item appendedUtilities.addToArray(Object[][]Object[])



append
public StringBuffer append(String string)(Code)
appends some text to this Chunk.
Parameters:
  string - String a StringBuffer



content
public String content()(Code)
Returns the content of this Chunk. a StringChunk.getContent()



font
public Font font()(Code)
Gets the font of this Chunk. a FontChunk.getFont()



getAttributes
public HashMap getAttributes()(Code)
Gets the attributes for this Chunk.

It may be null. the attributes for this Chunk




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



getContent
public String getContent()(Code)
Returns the content of this Chunk. a String



getFont
public Font getFont()(Code)
Gets the font of this Chunk. a Font



getHorizontalScaling
public float getHorizontalScaling()(Code)
Gets the horizontal scaling. a percentage in float



getImage
public Image getImage()(Code)
Returns the image. the image



getKeySet
public static Set getKeySet(Hashtable table)(Code)
Gets the keys of a Hashtable
Parameters:
  table - a Hashtable the keyset of a Hashtable (or an empty set if table is null)Utilities.getKeySet(Hashtable)



getTextRise
public float getTextRise()(Code)
Gets the text displacement relatiev to the baseline. a displacement in points



getWidthPoint
public float getWidthPoint()(Code)
Gets the width of the Chunk in points. a width in points



hasAttributes
public boolean hasAttributes()(Code)
Checks the attributes of this Chunk. false if there aren't any.



isEmpty
public boolean isEmpty()(Code)
Checks is this Chunk is empty. false if the Chunk contains other characters thanspace.



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



setAction
public Chunk setAction(PdfAction action)(Code)
Sets an action for this Chunk.
Parameters:
  action - the action this Chunk



setAnchor
public Chunk setAnchor(URL url)(Code)
Sets an anchor for this Chunk.
Parameters:
  url - the URL to link to this Chunk



setAnchor
public Chunk setAnchor(String url)(Code)
Sets an anchor for this Chunk.
Parameters:
  url - the url to link to this Chunk



setAnnotation
public Chunk setAnnotation(PdfAnnotation annotation)(Code)
Sets a generic annotation to this Chunk.
Parameters:
  annotation - the annotation this Chunk



setAttributes
public void setAttributes(HashMap attributes)(Code)
Sets the attributes all at once.
Parameters:
  attributes - the attributes of a Chunk



setBackground
public Chunk setBackground(Color color)(Code)
Sets the color of the background Chunk.
Parameters:
  color - the color of the background this Chunk



setBackground
public Chunk setBackground(Color color, float extraLeft, float extraBottom, float extraRight, float extraTop)(Code)
Sets the color and the size of the background Chunk.
Parameters:
  color - the color of the background
Parameters:
  extraLeft - increase the size of the rectangle in the left
Parameters:
  extraBottom - increase the size of the rectangle in the bottom
Parameters:
  extraRight - increase the size of the rectangle in the right
Parameters:
  extraTop - increase the size of the rectangle in the top this Chunk



setFont
public void setFont(Font font)(Code)
Sets the font of this Chunk.
Parameters:
  font - a Font



setGenericTag
public Chunk setGenericTag(String text)(Code)
Sets the generic tag Chunk.

The text for this tag can be retrieved with PdfPageEvent.
Parameters:
  text - the text for the tag this Chunk




setHorizontalScaling
public Chunk setHorizontalScaling(float scale)(Code)
Sets the text horizontal scaling. A value of 1 is normal and a value of 0.5f shrinks the text to half it's width.
Parameters:
  scale - the horizontal scaling factor this Chunk



setHyphenation
public Chunk setHyphenation(HyphenationEvent hyphenation)(Code)
sets the hyphenation engine to this Chunk.
Parameters:
  hyphenation - the hyphenation engine this Chunk



setLocalDestination
public Chunk setLocalDestination(String name)(Code)
Sets a local destination for this Chunk.
Parameters:
  name - the name for this destination this Chunk



setLocalGoto
public Chunk setLocalGoto(String name)(Code)
Sets a local goto for this Chunk.

There must be a local destination matching the name.
Parameters:
  name - the name of the destination to go to this Chunk




setNewPage
public Chunk setNewPage()(Code)
Sets a new page tag.. this Chunk



setRemoteGoto
public Chunk setRemoteGoto(String filename, String name)(Code)
Sets a goto for a remote destination for this Chunk.
Parameters:
  filename - the file name of the destination document
Parameters:
  name - the name of the destination to go to this Chunk



setRemoteGoto
public Chunk setRemoteGoto(String filename, int page)(Code)
Sets a goto for a remote destination for this Chunk.
Parameters:
  filename - the file name of the destination document
Parameters:
  page - the page of the destination to go to. First page is 1 this Chunk



setSkew
public Chunk setSkew(float alpha, float beta)(Code)
Skews the text to simulate italic and other effects. Try alpha=0 and beta=12.
Parameters:
  alpha - the first angle in degrees
Parameters:
  beta - the second angle in degrees this Chunk



setSplitCharacter
public Chunk setSplitCharacter(SplitCharacter splitCharacter)(Code)
Sets the split characters.
Parameters:
  splitCharacter - the SplitCharacter interface this Chunk



setTextRenderMode
public Chunk setTextRenderMode(int mode, float strokeWidth, Color strokeColor)(Code)
Sets the text rendering mode. It can outline text, simulate bold and make text invisible.
Parameters:
  mode - the text rendering mode. It can be PdfContentByte.TEXT_RENDER_MODE_FILL,PdfContentByte.TEXT_RENDER_MODE_STROKE,PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE and PdfContentByte.TEXT_RENDER_MODE_INVISIBLE.
Parameters:
  strokeWidth - the stroke line width for the modes PdfContentByte.TEXT_RENDER_MODE_STROKE and PdfContentByte.TEXT_RENDER_MODE_FILL_STROKE.
Parameters:
  strokeColor - the stroke color or null to follow the textcolor this Chunk



setTextRise
public Chunk setTextRise(float rise)(Code)
Sets the text displacement relative to the baseline. Positive values rise the text, negative values lower the text.

It can be used to implement sub/superscript.
Parameters:
  rise - the displacement in points this Chunk




setUnderline
public Chunk setUnderline(float thickness, float yPosition)(Code)
Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically and has always the Chunk width. Multiple call to this method will produce multiple lines.
Parameters:
  thickness - the absolute thickness of the line
Parameters:
  yPosition - the absolute y position relative to the baseline this Chunk



setUnderline
public Chunk setUnderline(Color color, float thickness, float thicknessMul, float yPosition, float yPositionMul, int cap)(Code)
Sets an horizontal line that can be an underline or a strikethrough. Actually, the line can be anywhere vertically and has always the Chunk width. Multiple call to this method will produce multiple lines.
Parameters:
  color - the color of the line or null to follow thetext color
Parameters:
  thickness - the absolute thickness of the line
Parameters:
  thicknessMul - the thickness multiplication factor with the font size
Parameters:
  yPosition - the absolute y position relative to the baseline
Parameters:
  yPositionMul - the position multiplication factor with the font size
Parameters:
  cap - the end line cap. Allowed values arePdfContentByte.LINE_CAP_BUTT, PdfContentByte.LINE_CAP_ROUNDand PdfContentByte.LINE_CAP_PROJECTING_SQUARE this Chunk



toString
public String toString()(Code)
Returns the content of this Chunk. a String



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



Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(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.