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

Quick Search    Search Deep

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

java.lang.Object
  extended byorg.ujac.print.BaseDocumentTag
      extended byorg.ujac.print.tag.BaseElementTag
          extended byorg.ujac.print.tag.ImageTag
              extended byorg.ujac.print.tag.ChartTag
All Implemented Interfaces:
org.ujac.print.ParameterHolder, TagAttributes

public class ChartTag
extends ImageTag
implements org.ujac.print.ParameterHolder

Name: ChartTag
Description: A class handling 'chart' items.
Log: $Log: ChartTag.java,v $
Log: Revision 1.15 2003/12/15 00:24:02 lauerc
Log: Removed unneccessary method getSegmentLabelsIterator.
Log:
Log: Revision 1.14 2003/12/02 21:35:23 lauerc
Log: Fixed font handling.
Log:
Log: Revision 1.13 2003/11/28 00:04:36 lauerc
Log: Added support for boolean attribute draw-foreground, which rules whether
Log: the image is drawn directly (false) or later at end of the page (true) to make
Log: it be drawn in the foreground.
Log:
Log: Revision 1.12 2003/11/27 01:22:25 lauerc
Log: This class is derived from ImageTag now to ensure more common handling regading size and positioning.
Log:
Log: Revision 1.11 2003/11/25 23:48:30 lauerc
Log: Fixed horizontal alignment when relatively positioned.
Log:
Log: Revision 1.10 2003/11/25 06:57:02 lauerc
Log: Improved relative positioning: You can place Chartsimages everywhere in the document now (tables, phrases etc.).
Log: Using document handler to place absolutely positioned charts at the end of the page now.
Log:
Log: Revision 1.9 2003/11/23 23:17:58 lauerc
Log: Fixed font handling.
Log: Title attribute is optional now.
Log:
Log: Revision 1.8 2003/11/23 17:02:29 lauerc
Log: Fixed position calculation at method closeItem.
Log: At method getValuesIterator: in case the sequence evaluates to
Log: a String, trying to evaluate the evaluated text as a expression.
Log:
Log: Revision 1.7 2003/11/23 03:03:35 lauerc
Log: Fixed javadoc comments.
Log:
Log: Revision 1.6 2003/11/21 00:57:42 lauerc
Log: Made almost all attribute values behave dynamic using the Expression interpreter.
Log:
Log: Revision 1.5 2003/11/14 13:36:43 lauerc
Log: Fixed bug in accessing table values at method getChartValues.
Log:
Log: Revision 1.4 2003/11/01 12:05:19 lauerc
Log: Added copyright notice.
Log:
Log: Revision 1.3 2003/10/08 22:59:07 lauerc
Log: Enhanced chart attribute handling.
Log:
Log: Revision 1.2 2003/10/07 23:46:33 lauerc
Log: Redesigned chart parameter handling.
Log:
Log: Revision 1.1 2003/09/29 21:15:03 lauerc
Log: Renamed classes from XyzItem to XyzTag.
Log:
Log: Revision 1.18 2003/09/27 12:05:00 lauerc
Log: Changed title position.
Log:
Log: Revision 1.17 2003/09/25 23:37:47 lauerc
Log: Removed attributes value-unit and display-values in favour of the more flexible attribute description-pattern.
Log:
Log: Revision 1.16 2003/09/22 16:45:26 lauerc
Log: Disposing graphics context after chart rendering at method closeItem,
Log: this is important to make future operations to direct pdf content work correctly.
Log:
Log: Revision 1.15 2003/09/21 12:07:34 lauerc
Log: Added support for attributes 'display-values', 'value-unit' and 'value-format'.
Log:
Log: Revision 1.14 2003/09/21 10:52:20 lauerc
Log: Added support for padding attributes.
Log:
Log: Revision 1.13 2003/09/20 19:53:07 lauerc
Log: Added suport for attributes for fonts and chart descriptions.
Log:
Log: Revision 1.12 2003/09/16 22:29:56 lauerc
Log: Reorganized imports.
Log:
Log: Revision 1.11 2003/09/16 22:22:55 lauerc
Log: Adapted new chart architecture.
Log:
Log: Revision 1.10 2003/07/30 00:47:15 lauerc
Log: Removed unneccessary imports.
Log:
Log: Revision 1.9 2003/07/30 00:46:06 lauerc
Log: Fixed computing of the document position.
Log:
Log: Revision 1.8 2003/07/29 07:30:25 lauerc
Log: Initial support for relative positioning.
Log:
Log: Revision 1.7 2003/07/18 06:26:02 lauerc
Log: Content handling re-designed.
Log:
Log: Revision 1.6 2003/07/09 21:59:51 lauerc
Log: Implemented the getDescription method.
Log:
Log: Revision 1.5 2003/07/07 06:56:26 lauerc
Log: Changed visibility of method initialize to public.
Log:
Log: Revision 1.4 2003/06/18 06:03:19 lauerc
Log: Added support for attribute type.
Log:
Log: Revision 1.3 2003/06/15 23:22:41 lauerc
Log: Added support for font at TextChartItem.
Log: Added support for borderWidth attribute at Chart instance.
Log:
Log: Revision 1.2 2003/06/15 13:04:25 lauerc
Log: Initial support for chart data, currently only 2D line charts are supported with global page positioning.
Log:
Log: Revision 1.1 2003/05/26 06:52:33 lauerc
Log: Initial revision.
Log:

Version:
$Revision: 1.15 $

Nested Class Summary
 
Nested classes inherited from class org.ujac.print.tag.ImageTag
ImageTag.ImagePageEventHandler
 
Field Summary
private  org.ujac.chart.Chart chart
          The chart instance.
private  java.util.Map chartAttributeDefinitions
          The map of supported chart attributes.
private  org.ujac.chart.ChartAttributes chartAttributes
          The chart attributes.
private static java.lang.Class[] iteratorAttributes
          The iterator method's attribute declaration.
private static java.lang.Object[] iteratorParameters
          The iterator method's parameter list.
private  com.lowagie.text.pdf.FontMapper mapper
          The font mapper.
static java.lang.String NAME
          The item's name.
private  float padding
          The overall padding.
private  float paddingBottom
          The bottom padding.
private  float paddingLeft
          The left padding.
private  float paddingRight
          The right padding.
private  float paddingTop
          The top padding.
private  java.lang.Object segmentFieldAttr
          The segment label field to use (required when the segment-labels attribute evaluates to a table).
private  java.lang.Object segmentLabelsAttr
          The segment labels.
private static org.ujac.print.AttributeDefinition[] supportedAttributes
          The item's supported attributes.
private  java.lang.String titleAttr
          The title attribute.
private  java.lang.String titleFontAttr
          The title font attribute.
private  java.lang.String type
          The type.
private  java.lang.Object valueFieldsAttr
          The value fields to use (required when the values attribute evaluates to a table).
private  java.lang.Object valuesAttr
          The chart values to use.
 
Fields inherited from class org.ujac.print.tag.ImageTag
 
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
ChartTag()
           
 
Method Summary
protected  java.awt.Font awtFontFromDocumentFont(com.lowagie.text.pdf.FontMapper fontMapper, org.ujac.print.DocumentFont font)
          Converts the given iText font into a AWT font.
private  int chartAttributeTypeToParameterType(org.ujac.chart.ChartAttributeDefinition chartAttributeDef)
          Maps a chart attribute type to the according parameter type.
private  java.util.List getChartValues()
          Gets the chart values.
 java.lang.String getDescription()
          Gets a brief description for the item.
protected  com.lowagie.text.Image getImage()
          Gets the image to insert into the document.
 java.lang.String getName()
          Gets the item's name.
 org.ujac.print.ParameterDefinition getParameterDefinition(java.lang.String name)
          Gets the definition of the given parameter.
private  java.util.List getSegmentLabels()
          Gets the segment labels.
 org.ujac.print.AttributeDefinition[] getSupportedAttributes()
          Gets the list of supported attributes.
 org.ujac.print.ChildDefinition[] getSupportedChilds()
          Gets the list of supported childs.
private  java.util.Iterator getValuesIterator()
          Gets the iterator by which to obtain the values for the chart.
 void initialize()
          Initializes the item.
 void openItem()
          Opens the item.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets a parameter.
 
Methods inherited from class org.ujac.print.tag.ImageTag
closeItem, getHeight, getWidth, getX, getY
 
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.


iteratorAttributes

private static final java.lang.Class[] iteratorAttributes
The iterator method's attribute declaration.


iteratorParameters

private static final java.lang.Object[] iteratorParameters
The iterator method's parameter list.


titleAttr

private java.lang.String titleAttr
The title attribute.


titleFontAttr

private java.lang.String titleFontAttr
The title font attribute.


type

private java.lang.String type
The type.


padding

private float padding
The overall padding.


paddingLeft

private float paddingLeft
The left padding.


paddingRight

private float paddingRight
The right padding.


paddingTop

private float paddingTop
The top padding.


paddingBottom

private float paddingBottom
The bottom padding.


valuesAttr

private java.lang.Object valuesAttr
The chart values to use.


valueFieldsAttr

private java.lang.Object valueFieldsAttr
The value fields to use (required when the values attribute evaluates to a table).


segmentLabelsAttr

private java.lang.Object segmentLabelsAttr
The segment labels.


segmentFieldAttr

private java.lang.Object segmentFieldAttr
The segment label field to use (required when the segment-labels attribute evaluates to a table).


chartAttributeDefinitions

private java.util.Map chartAttributeDefinitions
The map of supported chart attributes.


chart

private org.ujac.chart.Chart chart
The chart instance.


chartAttributes

private org.ujac.chart.ChartAttributes chartAttributes
The chart attributes.


mapper

private com.lowagie.text.pdf.FontMapper mapper
The font mapper.

Constructor Detail

ChartTag

public ChartTag()
Method Detail

getName

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

Overrides:
getName in class ImageTag

getDescription

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

Overrides:
getDescription in class ImageTag

getSupportedAttributes

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

Overrides:
getSupportedAttributes in class ImageTag

getSupportedChilds

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

Overrides:
getSupportedChilds in class ImageTag

initialize

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

Overrides:
initialize in class ImageTag

openItem

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

Overrides:
openItem in class ImageTag

chartAttributeTypeToParameterType

private int chartAttributeTypeToParameterType(org.ujac.chart.ChartAttributeDefinition chartAttributeDef)
                                       throws org.ujac.print.DocumentHandlerException
Maps a chart attribute type to the according parameter type.


getImage

protected com.lowagie.text.Image getImage()
                                   throws org.ujac.print.DocumentHandlerException
Gets the image to insert into the document.

Overrides:
getImage in class ImageTag

getChartValues

private java.util.List getChartValues()
                               throws org.ujac.print.DocumentHandlerException
Gets the chart values.


getSegmentLabels

private java.util.List getSegmentLabels()
                                 throws org.ujac.print.DocumentHandlerException
Gets the segment labels.


awtFontFromDocumentFont

protected java.awt.Font awtFontFromDocumentFont(com.lowagie.text.pdf.FontMapper fontMapper,
                                                org.ujac.print.DocumentFont font)
Converts the given iText font into a AWT font.


getValuesIterator

private java.util.Iterator getValuesIterator()
                                      throws org.ujac.print.DocumentHandlerException,
                                             org.ujac.print.TagAttributeException
Gets the iterator by which to obtain the values for the chart.


setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
                  throws org.ujac.print.DocumentHandlerException
Description copied from interface: org.ujac.print.ParameterHolder
Sets a parameter.

Specified by:
setParameter in interface org.ujac.print.ParameterHolder

getParameterDefinition

public org.ujac.print.ParameterDefinition getParameterDefinition(java.lang.String name)
Description copied from interface: org.ujac.print.ParameterHolder
Gets the definition of the given parameter.

Specified by:
getParameterDefinition in interface org.ujac.print.ParameterHolder