Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.ujac.print.tag
Class PdfTableTag  view PdfTableTag download PdfTableTag.java

java.lang.Object
  extended byorg.ujac.print.BaseDocumentTag
      extended byorg.ujac.print.tag.BaseElementTag
          extended byorg.ujac.print.tag.PdfTableTag
All Implemented Interfaces:
PdfCellAttributeHolder, org.ujac.print.PdfCellContainer, TagAttributes

public class PdfTableTag
extends BaseElementTag
implements org.ujac.print.PdfCellContainer, PdfCellAttributeHolder

Name: PdfTableTag
Description: An item handling PDF tables.

Log: $Log: PdfTableTag.java,v $
Log: Revision 1.4 2003/11/23 03:14:37 lauerc
Log: Cleaned up code.
Log: Added method getCellAlignmentAttribute.
Log:
Log: Revision 1.3 2003/11/21 00:57:42 lauerc
Log: Made almost all attribute values behave dynamic using the Expression interpreter.
Log:
Log: Revision 1.2 2003/11/01 12:05:19 lauerc
Log: Added copyright notice.
Log:
Log: Revision 1.1 2003/09/29 21:15:03 lauerc
Log: Renamed classes from XyzItem to XyzTag.
Log:
Log: Revision 1.19 2003/09/03 18:43:34 lauerc
Log: Fixed handling of header rows at method splitTable.
Log:
Log: Revision 1.18 2003/07/18 06:26:02 lauerc
Log: Content handling re-designed.
Log:
Log: Revision 1.17 2003/07/15 21:43:36 lauerc
Log: Removed suppression of first header from openItem method.
Log:
Log: Revision 1.16 2003/07/14 18:58:37 lauerc
Log: Implemented interface PdfCellAttributeHolder.
Log: Added attribute declarations for defining defaults for nested cells.
Log:
Log: Revision 1.15 2003/07/09 22:02:54 lauerc
Log: Implemented the getDescription method.
Log:
Log: Revision 1.14 2003/07/07 06:58:21 lauerc
Log: Changed visibility of method initialize to public.
Log:
Log: Revision 1.13 2003/05/20 21:23:32 lauerc
Log: Enhanced child declaration: Just added the base type of a group of items (e.g. BaseFontTag).
Log: This provides automatic support of new classes which extend specific supported items.
Log:
Log: Revision 1.12 2003/05/18 11:31:26 lauerc
Log: Checking if an attribute is required or not is based on attribute definitions now (see getSupportedAttributes).
Log:
Log: Revision 1.11 2003/05/07 22:39:07 lauerc
Log: Implemented keep-header stuff.
Log:
Log: Revision 1.10 2003/04/29 23:03:24 lauerc
Log: Resetting cell counter (numCells) at method openItem.
Log:
Log: Revision 1.9 2003/04/29 20:33:02 lauerc
Log: Added item to the argument list of the addElement method of ElementContainer interface.
Log: Added item to the argument list of the addChunk method of PhraseHolder interface.
Log:
Log: Revision 1.8 2003/04/29 19:42:58 lauerc
Log: Checking for valid condition to avoid output when surronding condition evaluates to false.
Log:
Log: Revision 1.7 2003/04/26 16:33:05 lauerc
Log: Added method splitTable.
Log:
Log: Revision 1.6 2003/04/25 16:23:11 lauerc
Log: Fixed bug in iterating the numCells counter variable at method addCell.
Log:
Log: Revision 1.5 2003/04/01 22:57:22 lauerc
Log: Improved exception handling, fixed attribute declarations.
Log:
Log: Revision 1.4 2003/03/31 22:29:05 lauerc
Log: Implemented meta information serving methods (getSupportedAttributes, getSupportedChilds).
Log:
Log: Revision 1.3 2003/03/31 19:31:38 lauerc
Log: Determining item attributes in initialize method.
Log:
Log: Revision 1.2 2003/03/30 13:30:30 lauerc
Log: Externalized attribute names to interface TagAttributes.
Log:
Log: Revision 1.1 2003/03/28 08:59:45 lauerc
Log: Initial revision.
Log:

Version:
$Revision: 1.4 $

Field Summary
private  PdfCellAttributeHolder cellAttributeHolder
          The latest surrounding cell attribute holder.
private  int columns
          The number of table columns.
private  int hAlign
          The horizontal alignment of the table.
private  java.util.List headerItems
          The header item list.
private  org.ujac.print.BaseDocumentTag latestChild
          The latest child item.
static java.lang.String NAME
          The item's name.
private  int numCells
          The number of cells.
private static org.ujac.print.AttributeDefinition[] supportedAttributes
          The item's supported attributes.
private static org.ujac.print.ChildDefinition[] supportedChilds
          The item's supported childs.
private  com.lowagie.text.pdf.PdfPTable table
          The iText table.
private  float width
          The width of the whole table.
private  float[] widths
          The widths of the table columns.
private  java.lang.String widthsAttr
          The widths attribute.
 
Fields inherited from class org.ujac.print.tag.BaseElementTag
elementContainer
 
Fields inherited from class org.ujac.print.BaseDocumentTag
attributes, condition, content, DEFAULT_FONT, DEFAULT_FONT_COLOR, DEFAULT_FONT_FAMILY, DEFAULT_FONT_SIZE, DEFAULT_FONT_STYLE, depth, documentHandler, parentItem, previousItem, supportedAttributeMap, tagFactory
 
Fields inherited from interface org.ujac.print.tag.TagAttributes
ATTR_AUTHOR, ATTR_BACKGROUND_COLOR, ATTR_BAR_COLOR, ATTR_BAR_HEIGHT, ATTR_BAR_WIDTH, ATTR_BASELINE, ATTR_BORDER_COLOR, ATTR_BORDER_STYLE, ATTR_BORDER_WIDTH, ATTR_COLOR, ATTR_COLSPAN, ATTR_COLUMNS, ATTR_CONDITION, ATTR_COUNT, ATTR_CREATION_DATE, ATTR_CREATOR, ATTR_DEFAULT_VALUE, ATTR_DESCRIPTION_FONT, ATTR_DESCRIPTION_PATTERN, ATTR_DESCRIPTIONS, ATTR_DRAW_FOREGROUND, ATTR_FAMILY, ATTR_FONT_DEF, ATTR_FORMAT, ATTR_GENERATE_CHECKSUM, ATTR_GROUP_NAME, ATTR_HEIGHT, ATTR_HORIZONTAL_ALIGNMENT, ATTR_KEEP_HEADER, ATTR_KEYWORDS, ATTR_LEADING, ATTR_LETTERED, ATTR_LIST, ATTR_LOOP_VARIABLE, ATTR_MARGIN_BOTTOM, ATTR_MARGIN_LEFT, ATTR_MARGIN_RIGHT, ATTR_MARGIN_TOP, ATTR_NAME, ATTR_NEW_PAGE, ATTR_NO_WRAP, ATTR_NUMBER, ATTR_NUMBERED, ATTR_OPTIONAL, ATTR_PADDING, ATTR_PADDING_BOTTOM, ATTR_PADDING_LEFT, ATTR_PADDING_RIGHT, ATTR_PADDING_TOP, ATTR_PERCENT_FORMAT, ATTR_PRINT_HEADER, ATTR_REFERENCE, ATTR_ROTATE, ATTR_SEQUENCE, ATTR_SIZE, ATTR_SOURCE, ATTR_START_STOP_TEXT, ATTR_STYLE, ATTR_SUBJECT, ATTR_SYMBOL_INDENT, ATTR_TEXT_COLOR, ATTR_TEXTWRAP, ATTR_TITLE, ATTR_TITLE_FONT, ATTR_TYPE, ATTR_UNDERLYING, ATTR_VALUE, ATTR_VALUE_FORMAT, ATTR_VALUES, ATTR_VERTICAL_ALIGNMENT, ATTR_WIDTH, ATTR_WIDTHS, ATTR_X, ATTR_Y
 
Constructor Summary
PdfTableTag()
           
 
Method Summary
 void addCell(org.ujac.print.BaseDocumentTag item, com.lowagie.text.pdf.PdfPCell cell)
          Adds a cell to the table.
 void addHeaderCell(org.ujac.print.BaseDocumentTag item, com.lowagie.text.pdf.PdfPCell cell)
          Adds a header cell to the table.
 void closeItem()
          Closes the item.
 int getCellAlignmentAttribute(java.lang.String name)
          Gets the alignment value for the given attribute's name.
 java.lang.String getCellAttribute(java.lang.String name)
          Gets the value for the given attribute's name.
 int getCellBorderAttribute(java.lang.String name)
          Gets the border value for the given attribute's name.
 java.awt.Color getCellColorAttribute(java.lang.String name)
          Gets the color value for the given attribute's name.
 float getCellFloatAttribute(java.lang.String name)
          Gets the float value for the given attribute's name.
 int getCellIntegerAttribute(java.lang.String name)
          Gets the integer value for the given attribute's name.
 java.lang.String getDescription()
          Gets a brief description for the item.
 java.lang.String getName()
          Gets the item's name.
 int getNumColumns()
          Gets the number of table columns.
 org.ujac.print.AttributeDefinition[] getSupportedAttributes()
          Gets the list of supported attributes.
 org.ujac.print.ChildDefinition[] getSupportedChilds()
          Gets the list of supported childs.
 com.lowagie.text.pdf.PdfPTable getTable()
          Gets the iText table.
 void initialize()
          Initializes the item.
 void openItem()
          Opens the item.
 void openItem(boolean resetData)
          Opens the item.
 void splitTable(boolean newPage, boolean keepHeader)
          Splits the page.
 
Methods inherited from class org.ujac.print.BaseDocumentTag
addChunk, addChunk, addChunk, addContent, addContent, addToLatestCellContainer, addToLatestElementContainer, addToLatestPdfCellContainer, colorFromString, createFont, flushContent, getAttribute, getAttribute, getAttributeDefinition, getAttributes, getBooleanAttribute, getBooleanAttribute, getBorderAttribute, getBorderAttribute, getColorAttribute, getColorAttribute, getContent, getDepth, getDocumentHandler, getExamples, getFloatAttribute, getFloatAttribute, getFont, getHorizontalAlignmentAttribute, getHorizontalAlignmentAttribute, getIntegerAttribute, getIntegerAttribute, getParentItem, getPhraseHeight, getPhraseWidth, getPreviousItem, getSupportedChildTags, getTagFactory, getTrimmedContent, getVerticalAlignmentAttribute, getVerticalAlignmentAttribute, hasContent, isAttributeDefined, isAttributeSupported, isEmptyContent, isIgnoreFlush, isItemClosed, isItemOpened, isValid, isVirtualContainer, locator, resetContent, rotatePhrase, setAttributes, setDepth, setDocumentHandler, setItemClosed, setItemOpened, setParentItem, setPreviousItem, setTagFactory, trimContentTail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

public static final java.lang.String NAME
The item's name.

See Also:
Constant Field Values

supportedAttributes

private static final org.ujac.print.AttributeDefinition[] supportedAttributes
The item's supported attributes.


supportedChilds

private static final org.ujac.print.ChildDefinition[] supportedChilds
The item's supported childs.


cellAttributeHolder

private PdfCellAttributeHolder cellAttributeHolder
The latest surrounding cell attribute holder.


table

private com.lowagie.text.pdf.PdfPTable table
The iText table.


numCells

private int numCells
The number of cells.


columns

private int columns
The number of table columns.


width

private float width
The width of the whole table.


widthsAttr

private java.lang.String widthsAttr
The widths attribute.


widths

private float[] widths
The widths of the table columns.


hAlign

private int hAlign
The horizontal alignment of the table.


latestChild

private org.ujac.print.BaseDocumentTag latestChild
The latest child item.


headerItems

private java.util.List headerItems
The header item list.

Constructor Detail

PdfTableTag

public PdfTableTag()
Method Detail

getName

public java.lang.String getName()
Gets the item's name.


getDescription

public java.lang.String getDescription()
Gets a brief description for the item.


getSupportedAttributes

public org.ujac.print.AttributeDefinition[] getSupportedAttributes()
Gets the list of supported attributes.


getSupportedChilds

public org.ujac.print.ChildDefinition[] getSupportedChilds()
Gets the list of supported childs.


getNumColumns

public int getNumColumns()
Gets the number of table columns.


initialize

public void initialize()
                throws org.ujac.print.DocumentHandlerException
Initializes the item.

Overrides:
initialize in class BaseElementTag

openItem

public void openItem()
              throws org.ujac.print.DocumentHandlerException
Opens the item.


openItem

public void openItem(boolean resetData)
              throws org.ujac.print.DocumentHandlerException
Opens the item.


closeItem

public void closeItem()
               throws org.ujac.print.DocumentHandlerException
Closes the item.


addCell

public void addCell(org.ujac.print.BaseDocumentTag item,
                    com.lowagie.text.pdf.PdfPCell cell)
             throws org.ujac.print.DocumentHandlerException
Adds a cell to the table.

Specified by:
addCell in interface org.ujac.print.PdfCellContainer

addHeaderCell

public void addHeaderCell(org.ujac.print.BaseDocumentTag item,
                          com.lowagie.text.pdf.PdfPCell cell)
                   throws org.ujac.print.DocumentHandlerException
Adds a header cell to the table.


getTable

public com.lowagie.text.pdf.PdfPTable getTable()
Gets the iText table.


splitTable

public void splitTable(boolean newPage,
                       boolean keepHeader)
                throws org.ujac.print.DocumentHandlerException
Splits the page.


getCellAttribute

public java.lang.String getCellAttribute(java.lang.String name)
                                  throws org.ujac.print.TagAttributeException
Gets the value for the given attribute's name.

Specified by:
getCellAttribute in interface PdfCellAttributeHolder

getCellFloatAttribute

public float getCellFloatAttribute(java.lang.String name)
                            throws org.ujac.print.TagAttributeException
Gets the float value for the given attribute's name.

Specified by:
getCellFloatAttribute in interface PdfCellAttributeHolder

getCellIntegerAttribute

public int getCellIntegerAttribute(java.lang.String name)
                            throws org.ujac.print.TagAttributeException
Gets the integer value for the given attribute's name.

Specified by:
getCellIntegerAttribute in interface PdfCellAttributeHolder

getCellColorAttribute

public java.awt.Color getCellColorAttribute(java.lang.String name)
                                     throws org.ujac.print.TagAttributeException
Gets the color value for the given attribute's name.

Specified by:
getCellColorAttribute in interface PdfCellAttributeHolder

getCellBorderAttribute

public int getCellBorderAttribute(java.lang.String name)
                           throws org.ujac.print.TagAttributeException
Gets the border value for the given attribute's name.

Specified by:
getCellBorderAttribute in interface PdfCellAttributeHolder

getCellAlignmentAttribute

public int getCellAlignmentAttribute(java.lang.String name)
                              throws org.ujac.print.TagAttributeException
Gets the alignment value for the given attribute's name.

Specified by:
getCellAlignmentAttribute in interface PdfCellAttributeHolder