|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lowagie.text.pdf.MultiColumnText
Formats content into one or more columns bounded by a
rectangle. The columns may be simple rectangles or
more complicated shapes. Add all of the columns before
adding content. A MultiColumnText object may be added to
a document using Document.add
.
Nested Class Summary | |
private class |
MultiColumnText.ColumnDef
Inner class used to define a column |
Field Summary | |
static float |
AUTOMATIC
special constant for automatic calculation of height |
private ArrayList |
columnDefs
Array of ColumnDef objects used to define the columns |
private ColumnText |
columnText
ColumnText object used to do all the real work. |
private float |
desiredHeight
total desiredHeight of columns. |
private boolean |
overflow
true if all the text could not be written out due to height restriction |
private float |
pageBottom
used to store the y position of the bottom of the page |
private boolean |
simple
true if all columns are simple (rectangular) |
private float |
top
Top of the columns - y position on starting page. |
private float |
totalHeight
total height of element written out so far |
Fields inherited from interface com.lowagie.text.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, CCITT_BLACKIS1, CCITT_ENCODEDBYTEALIGN, CCITT_ENDOFBLOCK, CCITT_ENDOFLINE, CCITTG3_1D, CCITTG3_2D, CCITTG4, CELL, CHAPTER, CHUNK, CREATIONDATE, CREATOR, GRAPHIC, HEADER, IMGRAW, IMGTEMPLATE, JPEG, KEYWORDS, LIST, LISTITEM, MULTI_COLUMN_TEXT, PARAGRAPH, PHRASE, PRODUCER, PTABLE, RECTANGLE, ROW, SECTION, SUBJECT, TABLE, TITLE |
Constructor Summary | |
MultiColumnText()
Default constructor. |
|
MultiColumnText(float height)
Construct a MultiColumnText container of the specified height. |
Method Summary | |
void |
addColumn(float[] left,
float[] right)
Add a new column. |
void |
addElement(Element element)
Add an element to be rendered in a column. |
void |
addRegularColumns(float left,
float right,
float gutterWidth,
int numColumns)
Add the specified number of evenly spaced rectangular columns. |
void |
addSimpleColumn(float left,
float right)
Add a simple rectangular column with specified left and right x position boundaries. |
ArrayList |
getChunks()
Returns null - not used |
private float |
getColumnBottom()
Calculates the appropriate y position for the bottom of the columns on this page. |
private float |
getHeight(float[] left,
float[] right)
Figure out the height of a column from the border extents |
boolean |
isOverflow()
Indicates that all of the text did not fit in the specified height |
boolean |
process(ElementListener listener)
Processes the element by adding it to an ElementListener . |
int |
type()
Gets the type of the text element. |
void |
useColumnParams(ColumnText sourceColumn)
Copy the parameters from the specified ColumnText to use when rendering. |
float |
write(PdfContentByte canvas,
PdfDocument document,
float documentY)
Write out the columns. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.lowagie.text.Element |
toString |
Field Detail |
public static final float AUTOMATIC
private float desiredHeight
AUTOMATIC
, this means fill pages until done.
This may be larger than one page
private float totalHeight
private boolean overflow
private float top
AUTOMATIC
, it means current y position when added to document
private float pageBottom
private ColumnText columnText
private ArrayList columnDefs
ColumnDef
objects used to define the columns
private boolean simple
Constructor Detail |
public MultiColumnText()
AUTOMATIC
.
Columns will repeat on each page as necessary to accomodate content length.
public MultiColumnText(float height)
AUTOMATIC
, fill complete pages until done.
If a specific height is used, it may span one or more pages.
height
- Method Detail |
public boolean isOverflow()
public void useColumnParams(ColumnText sourceColumn)
setArabicOptions
must be set in this way.
sourceColumn
- public void addColumn(float[] left, float[] right)
left
- limits for left columnright
- limits for right columnpublic void addSimpleColumn(float left, float right)
left
- left boundaryright
- right boundarypublic void addRegularColumns(float left, float right, float gutterWidth, int numColumns)
left
- left boundary of first columnright
- right boundary of last columngutterWidth
- width of gutter spacing between columnsnumColumns
- number of columns to addpublic void addElement(Element element) throws DocumentException
Phrase
or a Chunk
if the columns are
not all simple. This is an underlying restriction in
ColumnText
element
- element to add
DocumentException
- if element can't be addedpublic float write(PdfContentByte canvas, PdfDocument document, float documentY) throws DocumentException
isOverflow()
to see if all text was written.
canvas
- PdfContentByte to write withdocument
- document to write to (only used to get page limit info)documentY
- starting y position to begin writing at
DocumentException
private float getHeight(float[] left, float[] right)
left
- left borderright
- right border
public boolean process(ElementListener listener)
ElementListener
.
process
in interface Element
listener
- an ElementListener
true
if the element was processed successfullypublic int type()
type
in interface Element
public ArrayList getChunks()
getChunks
in interface Element
private float getColumnBottom()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |