|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectca.sqlpower.wabit.report.resultset.ReportPositionRenderer
public class ReportPositionRenderer
This class renders the result set. A new renderer should be created each time a new layout is required.
| Field Summary | |
|---|---|
static int |
BORDER_LINE_SIZE
This is extra padding added on to cells where extra space is desired for border/separator lines. |
| Constructor Summary | |
|---|---|
ReportPositionRenderer(java.awt.Font headerFont,
java.awt.Font bodyFont,
ResultSetRenderer.BorderStyles borderType,
int availableWidth,
java.lang.String nullString)
|
|
| Method Summary | |
|---|---|
java.util.List<java.util.List<ResultSetCell>> |
createResultSetLayout(java.awt.Graphics2D g,
java.sql.ResultSet rs,
java.util.List<ColumnInfo> columnInfoList,
ContentBox contentBox,
boolean isPrintingGrandTotals)
This method does all of the layout of each section of a result set. |
java.awt.Insets |
getPadding(ColumnInfo ci)
This method will return the insets of each cell based on the border type being used. |
java.util.List<ResultSetCell> |
renderColumnHeader(java.awt.Graphics2D g,
java.util.List<ColumnInfo> colInfo,
int yPosition)
Creates new ResultSetCells for each column header. |
java.util.List<ResultSetCell> |
renderRow(java.awt.Graphics2D g,
java.sql.ResultSet rs,
java.util.List<ColumnInfo> columnInformation,
int yPosition,
boolean showGroupsAsRepeat)
This renders the current row of the result set given based on the graphics and the column information. |
ResultSetCell |
renderSectionHeader(java.awt.Graphics2D g,
java.util.List<java.lang.Object> sectionHeader,
java.util.List<ColumnInfo> colInfo,
int yPosition)
This renders each section header above the column headers. |
java.util.List<ResultSetCell> |
renderTotals(java.awt.Graphics2D g,
java.util.List<java.math.BigDecimal> totalsRow,
java.util.List<ColumnInfo> colInfo,
boolean isGrandTotal,
java.lang.String breakText,
int breakTextPosition,
int yPosition)
This method will render the totals of a section. |
java.lang.String |
replaceNull(java.lang.String string)
This will replace null values with the designated null string. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int BORDER_LINE_SIZE
| Constructor Detail |
|---|
public ReportPositionRenderer(java.awt.Font headerFont,
java.awt.Font bodyFont,
ResultSetRenderer.BorderStyles borderType,
int availableWidth,
java.lang.String nullString)
| Method Detail |
|---|
public java.util.List<java.util.List<ResultSetCell>> createResultSetLayout(java.awt.Graphics2D g,
java.sql.ResultSet rs,
java.util.List<ColumnInfo> columnInfoList,
ContentBox contentBox,
boolean isPrintingGrandTotals)
throws java.sql.SQLException
g - This should be a graphics object that is the same as the
graphics the result set will be rendered into. If this
graphics object is different the components may be laid out in
a way that will have text clipped by the bounding
ContentBox.rs - This result set will be iterated over to lay out the result
set. If the result set pointer should not be changed a copy of
the result set, using a CachedRowSet or calling createShared
on a CachedRowSet should be passed instead. The result
set should also be sorted by the columns defined as breaks to
avoid sections that are identified by the same section.
java.sql.SQLException
public java.util.List<ResultSetCell> renderRow(java.awt.Graphics2D g,
java.sql.ResultSet rs,
java.util.List<ColumnInfo> columnInformation,
int yPosition,
boolean showGroupsAsRepeat)
throws java.sql.SQLException
g - The graphics to use to determine dimension information.rs - The result set whose current row will be used to create
ResultSetCells. The cursor will not be modified in
this result set. The row the cursor is at will be the row
rendered.columnInformation - This defines properties of the columns in the result set. This
will define formatting, spacing, alignment, and other values
specific to each column.showGroupsAsRepeat - If true cells that would be blank as they are repeated values
will appear but marked as a continued value.
java.sql.SQLException
public ResultSetCell renderSectionHeader(java.awt.Graphics2D g,
java.util.List<java.lang.Object> sectionHeader,
java.util.List<ColumnInfo> colInfo,
int yPosition)
g - Used to define dimension information when defining sizes of
the ResultSetCell.sectionHeader - These objects define a unique section. Each column in the
result set should have an entry in this list. If the column is
not part of the section header the value should be null.
Otherwise the value should be a unique entry in the result set
and will be displayed in the header.colInfo - The column information describing the columns of the result
set.
public java.util.List<ResultSetCell> renderColumnHeader(java.awt.Graphics2D g,
java.util.List<ColumnInfo> colInfo,
int yPosition)
ResultSetCells for each column header.
public java.util.List<ResultSetCell> renderTotals(java.awt.Graphics2D g,
java.util.List<java.math.BigDecimal> totalsRow,
java.util.List<ColumnInfo> colInfo,
boolean isGrandTotal,
java.lang.String breakText,
int breakTextPosition,
int yPosition)
g - Used to define size dimensions of the ResultSetCell.totalsRow - A list of totals for each column. If the column has no totals
the entry in the list should be null.colInfo - A list of column information for each column in the result
set.public java.lang.String replaceNull(java.lang.String string)
public java.awt.Insets getPadding(ColumnInfo ci)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||