com.pdfjet
Class TextColumn

java.lang.Object
  extended by com.pdfjet.TextColumn

public class TextColumn
extends java.lang.Object

Used to create text column objects and draw them on a page. Please see Example_10.


Constructor Summary
TextColumn()
          Create a text column object.
TextColumn(int rotateByDegrees)
          Create a text column object and set the rotation angle.
 
Method Summary
 void addChineseParagraph(Font font, java.lang.String chinese)
          Adds a new paragraph with Chinese text to this text column.
 void addJapaneseParagraph(Font font, java.lang.String japanese)
          Adds a new paragraph with Japanese text to this text column.
 void addParagraph(Paragraph paragraph)
          Adds a new paragraph to this text column.
 Point drawOn(Page page)
          Draws this text column on the specified page.
 Point drawOn(Page page, boolean draw)
          Draws this text column on the specified page if the 'draw' boolean value is 'true'.
 Dimension getSize()
          Returns dimension object containing the width and height of this component.
 void removeLastParagraph()
          Removes the last paragraph added to this text column.
 void setAlignment(int alignment)
          Sets the text alignment.
 void setLineBetweenParagraphs(boolean lineBetweenParagraphs)
          Sets the lineBetweenParagraphs private variable value.
 void setLineSpacing(double spacing)
          Sets the spacing between the lines in this text column.
 void setLineSpacing(float spacing)
          Sets the spacing between the lines in this text column.
 void setLocation(float x, float y)
          Sets the position of this text column on the page.
 void setPosition(double x, double y)
          Sets the position of this text column on the page.
 void setPosition(float x, float y)
          Sets the position of this text column on the page.
 void setSize(double w, double h)
          Sets the size of this text column.
 void setSize(float w, float h)
          Sets the size of this text column.
 void setSpaceBetweenLines(float space_between_lines)
           
 void setSpaceBetweenParagraphs(float space_between_paragraphs)
           
 void setWidth(float w)
          Sets the desired width of this text column.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextColumn

public TextColumn()
Create a text column object.


TextColumn

public TextColumn(int rotateByDegrees)
           throws java.lang.Exception
Create a text column object and set the rotation angle.

Parameters:
rotateByDegrees - the specified rotation angle in degrees.
Throws:
java.lang.Exception
Method Detail

setLineBetweenParagraphs

public void setLineBetweenParagraphs(boolean lineBetweenParagraphs)
Sets the lineBetweenParagraphs private variable value. If the value is set to true - an empty line will be inserted between the current and next paragraphs.

Parameters:
lineBetweenParagraphs - the specified boolean value.

setSpaceBetweenLines

public void setSpaceBetweenLines(float space_between_lines)

setSpaceBetweenParagraphs

public void setSpaceBetweenParagraphs(float space_between_paragraphs)

setPosition

public void setPosition(double x,
                        double y)
Sets the position of this text column on the page.

Parameters:
x - the x coordinate of the top left corner of this text column when drawn on the page.
y - the y coordinate of the top left corner of this text column when drawn on the page.

setPosition

public void setPosition(float x,
                        float y)
Sets the position of this text column on the page.

Parameters:
x - the x coordinate of the top left corner of this text column when drawn on the page.
y - the y coordinate of the top left corner of this text column when drawn on the page.

setLocation

public void setLocation(float x,
                        float y)
Sets the position of this text column on the page.

Parameters:
x - the x coordinate of the top left corner of this text column when drawn on the page.
y - the y coordinate of the top left corner of this text column when drawn on the page.

setSize

public void setSize(double w,
                    double h)
Sets the size of this text column.

Parameters:
w - the width of this text column.
h - the height of this text column.

setSize

public void setSize(float w,
                    float h)
Sets the size of this text column.

Parameters:
w - the width of this text column.
h - the height of this text column.

setWidth

public void setWidth(float w)
Sets the desired width of this text column.

Parameters:
w - the width of this text column.

setAlignment

public void setAlignment(int alignment)
Sets the text alignment.

Parameters:
alignment - the specified alignment code. Supported values: Align.LEFT, Align.RIGHT. Align.CENTER and Align.JUSTIFY

setLineSpacing

public void setLineSpacing(double spacing)
Sets the spacing between the lines in this text column.

Parameters:
spacing - the specified spacing value.

setLineSpacing

public void setLineSpacing(float spacing)
Sets the spacing between the lines in this text column.

Parameters:
spacing - the specified spacing value.

addParagraph

public void addParagraph(Paragraph paragraph)
Adds a new paragraph to this text column.

Parameters:
paragraph - the new paragraph object.

removeLastParagraph

public void removeLastParagraph()
Removes the last paragraph added to this text column.


getSize

public Dimension getSize()
                  throws java.lang.Exception
Returns dimension object containing the width and height of this component. Please see Example_29.

Returns:
dimension object containing the width and height of this component.
Throws:
java.lang.Exception

drawOn

public Point drawOn(Page page)
             throws java.lang.Exception
Draws this text column on the specified page.

Parameters:
page - the page to draw this text column on.
Returns:
the point with x and y coordinates of the location where to draw the next component.
Throws:
java.lang.Exception

drawOn

public Point drawOn(Page page,
                    boolean draw)
             throws java.lang.Exception
Draws this text column on the specified page if the 'draw' boolean value is 'true'.

Parameters:
page - the page to draw this text column on.
draw - the boolean value that specified if the text column should actually be drawn on the page.
Returns:
the point with x and y coordinates of the location where to draw the next component.
Throws:
java.lang.Exception

addChineseParagraph

public void addChineseParagraph(Font font,
                                java.lang.String chinese)
                         throws java.lang.Exception
Adds a new paragraph with Chinese text to this text column.

Parameters:
font - the font used by this paragraph.
chinese - the Chinese text.
Throws:
java.lang.Exception

addJapaneseParagraph

public void addJapaneseParagraph(Font font,
                                 java.lang.String japanese)
                          throws java.lang.Exception
Adds a new paragraph with Japanese text to this text column.

Parameters:
font - the font used by this paragraph.
japanese - the Japanese text.
Throws:
java.lang.Exception