jdbreport.model
Class JReportModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by jdbreport.model.JReportModel
All Implemented Interfaces:
Serializable, TableModel, ReportModel
Direct Known Subclasses:
TemplateModel

public class JReportModel
extends AbstractTableModel
implements ReportModel

Version:
2.0 06.09.2011
Author:
Andrey Kholmanskih
See Also:
Serialized Form

Nested Class Summary
static class JReportModel.ReportCellWrap
           
 
Field Summary
static String VERSION
           
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
JReportModel(int rowCount, int columnCount, Map<Object,CellStyle> styleList)
           
JReportModel(Map<Object,CellStyle> listStyle)
           
 
Method Summary
 void addBorder(int topRow, int leftColumn, int bottomRow, int rightColumn, boolean[] positions, Border line)
          Sets the borders at the specified positions for the cells by coordinates
 int addColumns(int count)
          Adds columns' count to the model
 int addColumns(int count, int index)
          Adds columns' count to the index of the model.
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to the listener list.
 void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 int addRows(int count, int index)
          Adds rows' count to the index of the model.
 Object addStyle(CellStyle style)
          Looks for style in the list of styles if doesn't find, adds it to the list otherwise returns the id of the founded style If style's id is null, a new id is appropriated to the style
 int calcRowWidths(StringMetrics metrics, Cell cell, int row, int column)
           
 void clearUnion(int row, int column)
          Clears the unions of the cell by row and column
 TableColumn createDefaultColumn(int column)
           
 Cell createReportCell(int row, int column)
          Creates the Cell by row and column
protected  TableRowModel createRowModel()
          Creates TableRowModel by default
 void delete(GridRect selectionRect)
          Removes the selected cells
 void deleteCell(int row, int column)
           
 void endUpdate()
          Allows notification of listeners
 int findRightColumn(int leftCol)
          Searches for the right extreme column of page
 boolean findStyleID(Object styleId)
          Checks use of style in model
protected  void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
           
protected  void firePropertyChange(String propertyName, int oldValue, int newValue)
           
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
           
 int getCellHeight(Cell cell, int row, int column)
           
 CellCoord getCellPosition(Cell cell)
           
 Rectangle getCellRect(int row, int column, boolean includeSpacing, boolean isLeftToRight)
          Returns a rectangle for the cell that lies at the intersection of row and column.
 Dimension getCellSize(Cell cell, int row, int column)
           
 Dimension getCellSize(Cell cell, int row, int column, boolean includeSpacing)
          Returns a size for the cell that lies at the intersection of row and column.
 String getCellText(Cell cell)
           
 CellWrap getCellWrap(int row, int column)
          Returns the CellWrap object for the cell by row and column
 int getColumnCount()
           
 TableColumnModel getColumnModel()
           
 String getColumnName(int column)
           
 int getColumnWidth(int column)
          Returns the width of the column
 int getDefaultColumnWidth()
           
 int getOwnerColumn(Cell cell, int row, int column)
          Returns the column's number of the cell's owner If there is no owner, the column's number of the cell is returned.
 Cell getOwnerReportCell(int row, int column)
          Returns the Cell's owner by row and column If there is no owner, the Cell returns by itself.
 int getOwnerRow(Cell cell, int row, int column)
          Returns the row's number of the cell's owner If there is no owner, the row's number of the cell is returned.
 PropertyChangeListener[] getPropertyChangeListeners()
           
 PropertyChangeListener[] getPropertyChangeListeners(String propertyName)
           
 Cell getReportCell(int row, int column)
          Returns the Cell by row and column
 ReportPage getReportPage()
           
 String getReportTitle()
           
 int getRowCount()
           
 int getRowHeight(int row)
          Returns the height of the row
 TableRowModel getRowModel()
           
 Iterator<Cell> getSelectedCells(GridRect rect)
          Returns cells that do not have owner
 Map<Object,CellStyle> getStyleList()
           
 CellStyle getStyles(Object index)
          Returns the CellStyle by the index
 String getToolTipText(int row, int column)
          Returns the string to be used as the tooltip for the cell by row and column.
 String getToolTipText(Point point)
           
 Object getValueAt(int rowIndex, int columnIndex)
           
 boolean isBold(int row, int column)
           
 boolean isCanUpdatePages()
          Determines whether page's bounders will be calculated automatically
 boolean isCellEditable(int rowIndex, int columnIndex)
           
 boolean isColMoving()
          Returns true if the user is allowed to rearrange columns by dragging their headers, false otherwise.
 boolean isColSizing()
          Returns true if the user is allowed to resize columns by dragging between their headers,false otherwise.
 boolean isColumnBreak(int column)
          Returns true if the sets vertical page break after column
 boolean isEditable()
          Returns the boolean indicating whether this ReportModel is editable or not.
 boolean isFontStyle(int row, int column, int style)
          Determines whether font's style is in the cell
 boolean isItalic(int row, int column)
           
 boolean isLastRowInPage(int row)
          Returns true if the row is last on page
 boolean isPrintLeftToRight()
          Direction of an output of pages on the printer.
 boolean isRowBreak(int row)
          Returns the flag of the page's break by the row's number
 boolean isRowMoving()
          Returns true if the user is allowed to rearrange rows by dragging their headers, false otherwise.
 boolean isRowSizing()
          Returns true if the user is allowed to resize rows by dragging between their headers,false otherwise.
 boolean isShowHeader()
           
 boolean isShowRowHeader()
           
 boolean isStretchPage()
          Printing mode that scales the output smaller, if necessary, to fit the report's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary.
 boolean isStrikethrough(int row, int column)
           
 boolean isUnderline(int row, int column)
           
 boolean isUpdate()
           
 boolean isVisible()
          Determines whether report should be visible
 void removeColumns(int count, int index)
          Removes columns' count begining with the index from the model.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes a PropertyChangeListener from the listener list.
 void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)
           
 void removeRows()
          Removes all rows from the model.
 void removeRows(int count, int index)
          Removes rows' count begining with the index from the model.
 void replaceStyleID(Object oldStyleId, Object newStyleId)
          Replaces styles
 void setBackground(GridRect selectionRect, Color color)
          Sets background color for the selected cells
 void setCanUpdatePages(boolean b)
          Sets the property that determines whether page's bounders will be calculated automatically
 void setColMoving(boolean b)
          Sets whether the user can drag column headers to reorder columns.
 void setColSizing(boolean b)
          Sets whether the user can resize columns by dragging between headers.
 void setColumnBreak(int column, boolean end)
          Sets the vertical page break after column
 void setColumnCount(int value)
          Sets the columns' count in the model If the columns' count is bigger than parameter, the columns are removed from the model If the columns' count is smaller than parameter, the columns are added to the model
 void setColumnWidths(int[] widths)
           
 void setDecimals(GridRect selectionRect, int d)
          Sets new decimal position of the numeric value for selected cells.
 void setDefaultColumnWidth(int defaultColumnWidth)
          Sets a default column's width
 void setEditable(boolean b)
          Sets the specified boolean to indicate whether or not this ReportModel should be editable.
 void setFontName(GridRect selRect, String fontName)
          Sets the font's name for the cells by the selRect.
 void setFontSize(GridRect selRect, int fontSize)
          Sets the font's size for the cells by the selRect
 void setFontStyle(GridRect selRect, int fontStyle, boolean enable)
          Sets the font's style for the cells by coordinates selRect
 void setForeground(GridRect selectionRect, Color color)
          Sets foreground color for the selected cells
 void setHorizontalAlignment(GridRect selRect, int align)
          Sets the horizontal alignment for the selected cells The horizontal alignment is a constant that may be LEFT, RIGHT, CENTER or JUSTIFY
 void setPrintLeftToRight(boolean value)
          Direction of an output of pages on the printer.
 void setReportPage(ReportPage reportPage)
           
 void setReportTitle(String reportTitle)
           
 void setRowBreak(int row, boolean end)
          Sets the horizontal page break after row
 void setRowHeight(int row, int rowHeight)
          Sets the row's height by row
 void setRowMoving(boolean b)
          Sets whether the user can drag row headers to reorder rows.
 void setRowSizing(boolean b)
          Sets whether the user can resize rows by dragging between headers.
 void setShowHeader(boolean b)
           
 void setShowRowHeader(boolean b)
           
 void setStretchPage(boolean stretchPage)
          Printing mode that scales the output smaller, if necessary, to fit the report's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary.
 void setStyleList(Map<Object,CellStyle> list)
           
 void setValueAt(Object aValue, int rowIndex, int columnIndex)
           
 void setVerticalAlignment(GridRect selRect, int align)
          Sets the vertical alignment for the selected cells The vertical alignment is a constant that may be TOP, BOTTOM or CENTER
 void setVisible(boolean visible)
          Shows or hides report depending on the value of parameter visible.
 void startUpdate()
          Bans notification of listeners
 void unionCells(int topRow, int leftColumn, int bottomRow, int rightColumn)
          Unions the cells by coordinates
 void updateCarryRows(HeighCalculator hCalc, int row, int column)
           
 void updatePages(int startRow)
          Calculates pages' size
 void updateRowAndPageHeight(HeighCalculator hCalc)
           
 void updateRowHeight(HeighCalculator hCalc, int row, int column)
          Sets row's height by the content of the cell
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, removeTableModelListener
 

Field Detail

VERSION

public static final String VERSION
See Also:
Constant Field Values
Constructor Detail

JReportModel

public JReportModel(int rowCount,
                    int columnCount,
                    Map<Object,CellStyle> styleList)

JReportModel

public JReportModel(Map<Object,CellStyle> listStyle)
Method Detail

createRowModel

protected TableRowModel createRowModel()
Creates TableRowModel by default

Returns:
TableRowModel

addRows

public int addRows(int count,
                   int index)
Description copied from interface: ReportModel
Adds rows' count to the index of the model. The new rows will contain null values. Notification of the row being added will be generated.

Specified by:
addRows in interface ReportModel
Parameters:
count - rows' count
index - the row index of the rows to be inserted
Returns:
rows' count in the model

removeRows

public void removeRows(int count,
                       int index)
Description copied from interface: ReportModel
Removes rows' count begining with the index from the model.

Specified by:
removeRows in interface ReportModel
Parameters:
count - rows' count
index - index of the first removed row

addColumns

public int addColumns(int count)
Description copied from interface: ReportModel
Adds columns' count to the model

Specified by:
addColumns in interface ReportModel
Parameters:
count - columns' count
Returns:
the columns' count in the model

addColumns

public int addColumns(int count,
                      int index)
Description copied from interface: ReportModel
Adds columns' count to the index of the model. The new columns will contain null values. Notification of the column being added will be generated.

Specified by:
addColumns in interface ReportModel
Parameters:
count - columns' count
index - the column index of the columns to be inserted
Returns:
columns' count in the model

removeColumns

public void removeColumns(int count,
                          int index)
Description copied from interface: ReportModel
Removes columns' count begining with the index from the model.

Specified by:
removeColumns in interface ReportModel
Parameters:
count - columns' count
index - index of the first removed column

getColumnCount

public int getColumnCount()
Specified by:
getColumnCount in interface TableModel

createDefaultColumn

public TableColumn createDefaultColumn(int column)

setColumnCount

public void setColumnCount(int value)
Description copied from interface: ReportModel
Sets the columns' count in the model If the columns' count is bigger than parameter, the columns are removed from the model If the columns' count is smaller than parameter, the columns are added to the model

Specified by:
setColumnCount in interface ReportModel
Parameters:
value - new columns' count

getRowCount

public int getRowCount()
Specified by:
getRowCount in interface TableModel

getColumnName

public String getColumnName(int column)
Specified by:
getColumnName in interface TableModel
Overrides:
getColumnName in class AbstractTableModel

isCellEditable

public boolean isCellEditable(int rowIndex,
                              int columnIndex)
Specified by:
isCellEditable in interface TableModel
Overrides:
isCellEditable in class AbstractTableModel

getValueAt

public Object getValueAt(int rowIndex,
                         int columnIndex)
Specified by:
getValueAt in interface TableModel

setValueAt

public void setValueAt(Object aValue,
                       int rowIndex,
                       int columnIndex)
Specified by:
setValueAt in interface TableModel
Overrides:
setValueAt in class AbstractTableModel

getReportCell

public Cell getReportCell(int row,
                          int column)
Description copied from interface: ReportModel
Returns the Cell by row and column

Specified by:
getReportCell in interface ReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the Cell

getOwnerReportCell

public Cell getOwnerReportCell(int row,
                               int column)
Description copied from interface: ReportModel
Returns the Cell's owner by row and column If there is no owner, the Cell returns by itself.

Specified by:
getOwnerReportCell in interface ReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the Cell

createReportCell

public Cell createReportCell(int row,
                             int column)
Description copied from interface: ReportModel
Creates the Cell by row and column

Specified by:
createReportCell in interface ReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the Cell

getOwnerRow

public int getOwnerRow(Cell cell,
                       int row,
                       int column)
Description copied from interface: ReportModel
Returns the row's number of the cell's owner If there is no owner, the row's number of the cell is returned.

Specified by:
getOwnerRow in interface ReportModel
Parameters:
cell - the cell
row - the row's number
column - the column's number
Returns:
the row's number

getOwnerColumn

public int getOwnerColumn(Cell cell,
                          int row,
                          int column)
Description copied from interface: ReportModel
Returns the column's number of the cell's owner If there is no owner, the column's number of the cell is returned.

Specified by:
getOwnerColumn in interface ReportModel
Parameters:
cell - the cell
row - the row's number
column - the column's number
Returns:
the owner column's number

getCellSize

public Dimension getCellSize(Cell cell,
                             int row,
                             int column)

getCellSize

public Dimension getCellSize(Cell cell,
                             int row,
                             int column,
                             boolean includeSpacing)
Description copied from interface: ReportModel
Returns a size for the cell that lies at the intersection of row and column. If the cell's are spaned, size is returned for all the spaned cells

Specified by:
getCellSize in interface ReportModel
Parameters:
cell - the Cell for which size is returns
row - the row's number
column - the column's number
Returns:
the cell's size

getCellHeight

public int getCellHeight(Cell cell,
                         int row,
                         int column)

getRowModel

public TableRowModel getRowModel()
Specified by:
getRowModel in interface ReportModel
Returns:
TableRowModel

removeRows

public void removeRows()
Description copied from interface: ReportModel
Removes all rows from the model.

Specified by:
removeRows in interface ReportModel

getColumnWidth

public int getColumnWidth(int column)
Description copied from interface: ReportModel
Returns the width of the column

Specified by:
getColumnWidth in interface ReportModel
Parameters:
column - the column's number
Returns:
the column's width

getRowHeight

public int getRowHeight(int row)
Description copied from interface: ReportModel
Returns the height of the row

Specified by:
getRowHeight in interface ReportModel
Parameters:
row - the row's number
Returns:
the row's height

setRowHeight

public void setRowHeight(int row,
                         int rowHeight)
Description copied from interface: ReportModel
Sets the row's height by row

Specified by:
setRowHeight in interface ReportModel
Parameters:
row - the row's number
rowHeight - a new row's height

getColumnModel

public TableColumnModel getColumnModel()
Specified by:
getColumnModel in interface ReportModel
Returns:
TableColumnModel

unionCells

public void unionCells(int topRow,
                       int leftColumn,
                       int bottomRow,
                       int rightColumn)
Description copied from interface: ReportModel
Unions the cells by coordinates

Specified by:
unionCells in interface ReportModel
Parameters:
topRow - the number of the top row
leftColumn - the number of the left column
bottomRow - the number of the bottom row
rightColumn - the number of the right column

clearUnion

public void clearUnion(int row,
                       int column)
Description copied from interface: ReportModel
Clears the unions of the cell by row and column

Specified by:
clearUnion in interface ReportModel
Parameters:
row - the row's number
column - the column's number

getStyles

public CellStyle getStyles(Object index)
Description copied from interface: ReportModel
Returns the CellStyle by the index

Specified by:
getStyles in interface ReportModel
Parameters:
index - the id of the CellStyle
Returns:
the CellStyle

addStyle

public Object addStyle(CellStyle style)
Description copied from interface: ReportModel
Looks for style in the list of styles if doesn't find, adds it to the list otherwise returns the id of the founded style If style's id is null, a new id is appropriated to the style

Specified by:
addStyle in interface ReportModel
Parameters:
style - adding style
Returns:
the style's id

addBorder

public void addBorder(int topRow,
                      int leftColumn,
                      int bottomRow,
                      int rightColumn,
                      boolean[] positions,
                      Border line)
Description copied from interface: ReportModel
Sets the borders at the specified positions for the cells by coordinates

Specified by:
addBorder in interface ReportModel
Parameters:
topRow - the number of the top row
leftColumn - the number of the left column
bottomRow - the number of the bottom row
rightColumn - the number of the right column
positions - positions - boolean values, where true sets border, otherwise does nothing. Position's index can be from Border.LINE_LEFT to Border.LINE_HMIDDLE
line - the border

setHorizontalAlignment

public void setHorizontalAlignment(GridRect selRect,
                                   int align)
Description copied from interface: ReportModel
Sets the horizontal alignment for the selected cells The horizontal alignment is a constant that may be LEFT, RIGHT, CENTER or JUSTIFY

Specified by:
setHorizontalAlignment in interface ReportModel
Parameters:
selRect - coordinates of the selected cells
align - the new horizontal alignment for the cells

setVerticalAlignment

public void setVerticalAlignment(GridRect selRect,
                                 int align)
Description copied from interface: ReportModel
Sets the vertical alignment for the selected cells The vertical alignment is a constant that may be TOP, BOTTOM or CENTER

Specified by:
setVerticalAlignment in interface ReportModel
Parameters:
selRect - coordinates of the selected cells
align - the new vertical alignment for the cells

setFontName

public void setFontName(GridRect selRect,
                        String fontName)
Description copied from interface: ReportModel
Sets the font's name for the cells by the selRect.

Specified by:
setFontName in interface ReportModel
Parameters:
selRect - coordinates for selected cells
fontName - the font's name

setFontSize

public void setFontSize(GridRect selRect,
                        int fontSize)
Description copied from interface: ReportModel
Sets the font's size for the cells by the selRect

Specified by:
setFontSize in interface ReportModel
Parameters:
selRect - coordinates for selected cells
fontSize - the new font's size

setFontStyle

public void setFontStyle(GridRect selRect,
                         int fontStyle,
                         boolean enable)
Description copied from interface: ReportModel
Sets the font's style for the cells by coordinates selRect

Specified by:
setFontStyle in interface ReportModel
Parameters:
selRect - coordinates of the selected cells
fontStyle - the font's style The style argument is an integer bitmask that may be PLAIN, or a bitwise union of BOLD, ITALIC, UNDERLINE, STRIKETHROUGH
enable - if true, the style is determined, otherwise the style is removed.

isBold

public boolean isBold(int row,
                      int column)

isItalic

public boolean isItalic(int row,
                        int column)

isUnderline

public boolean isUnderline(int row,
                           int column)

isStrikethrough

public boolean isStrikethrough(int row,
                               int column)

isFontStyle

public boolean isFontStyle(int row,
                           int column,
                           int style)
Description copied from interface: ReportModel
Determines whether font's style is in the cell

Specified by:
isFontStyle in interface ReportModel
Parameters:
row - the row's number
column - the column's number
style - the font's style
Returns:
true, if font's style in the cell is determined

setBackground

public void setBackground(GridRect selectionRect,
                          Color color)
Description copied from interface: ReportModel
Sets background color for the selected cells

Specified by:
setBackground in interface ReportModel
Parameters:
selectionRect - coordinates of the selected cells
color - the new background color for the cells

setForeground

public void setForeground(GridRect selectionRect,
                          Color color)
Description copied from interface: ReportModel
Sets foreground color for the selected cells

Specified by:
setForeground in interface ReportModel
Parameters:
selectionRect - coordinates of the selected cells
color - the new foreground color for the cells

setDecimals

public void setDecimals(GridRect selectionRect,
                        int d)
Description copied from interface: ReportModel
Sets new decimal position of the numeric value for selected cells.

Specified by:
setDecimals in interface ReportModel
Parameters:
selectionRect - coordinates of the selected cells
d - the decimal position of the numeric value.

setReportTitle

public void setReportTitle(String reportTitle)
Specified by:
setReportTitle in interface ReportModel
Parameters:
reportTitle - a new report's title.

getReportTitle

public String getReportTitle()
Specified by:
getReportTitle in interface ReportModel
Returns:
the report's title.

setStyleList

public void setStyleList(Map<Object,CellStyle> list)
Specified by:
setStyleList in interface ReportModel

getStyleList

public Map<Object,CellStyle> getStyleList()

setDefaultColumnWidth

public void setDefaultColumnWidth(int defaultColumnWidth)
Description copied from interface: ReportModel
Sets a default column's width

Specified by:
setDefaultColumnWidth in interface ReportModel
Parameters:
defaultColumnWidth - a new default column's width

getDefaultColumnWidth

public int getDefaultColumnWidth()
Specified by:
getDefaultColumnWidth in interface ReportModel
Returns:
the default column's width

setReportPage

public void setReportPage(ReportPage reportPage)
Parameters:
reportPage - The reportPage to set.

getReportPage

public ReportPage getReportPage()
Specified by:
getReportPage in interface ReportModel
Returns:
the reportPage.

setRowSizing

public void setRowSizing(boolean b)
Description copied from interface: ReportModel
Sets whether the user can resize rows by dragging between headers.

Specified by:
setRowSizing in interface ReportModel
Parameters:
b - true if report view should allow resizing

isRowSizing

public boolean isRowSizing()
Description copied from interface: ReportModel
Returns true if the user is allowed to resize rows by dragging between their headers,false otherwise. The default is true. You can resize rows programmatically regardless of this setting.

Specified by:
isRowSizing in interface ReportModel
Returns:
true if rows can resizing

setColSizing

public void setColSizing(boolean b)
Description copied from interface: ReportModel
Sets whether the user can resize columns by dragging between headers.

Specified by:
setColSizing in interface ReportModel
Parameters:
b - true if report view should allow resizing

isColSizing

public boolean isColSizing()
Description copied from interface: ReportModel
Returns true if the user is allowed to resize columns by dragging between their headers,false otherwise. The default is true. You can resize columns programmatically regardless of this setting.

Specified by:
isColSizing in interface ReportModel
Returns:
true if columns can resizing

setRowMoving

public void setRowMoving(boolean b)
Description copied from interface: ReportModel
Sets whether the user can drag row headers to reorder rows.

Specified by:
setRowMoving in interface ReportModel
Parameters:
b - true if the report view should allow reordering; otherwise false

isRowMoving

public boolean isRowMoving()
Description copied from interface: ReportModel
Returns true if the user is allowed to rearrange rows by dragging their headers, false otherwise. The default is true. You can rearrange rows programmatically regardless of this setting.

Specified by:
isRowMoving in interface ReportModel
Returns:
the rowMoving property

setColMoving

public void setColMoving(boolean b)
Description copied from interface: ReportModel
Sets whether the user can drag column headers to reorder columns.

Specified by:
setColMoving in interface ReportModel
Parameters:
b - true if the report view should allow reordering; otherwise false

isColMoving

public boolean isColMoving()
Description copied from interface: ReportModel
Returns true if the user is allowed to rearrange columns by dragging their headers, false otherwise. The default is true. You can rearrange columns programmatically regardless of this setting.

Specified by:
isColMoving in interface ReportModel
Returns:
the colMoving property

setEditable

public void setEditable(boolean b)
Description copied from interface: ReportModel
Sets the specified boolean to indicate whether or not this ReportModel should be editable.

Specified by:
setEditable in interface ReportModel
Parameters:
b - the boolean to be set

isEditable

public boolean isEditable()
Description copied from interface: ReportModel
Returns the boolean indicating whether this ReportModel is editable or not.

Specified by:
isEditable in interface ReportModel
Returns:
the boolean value

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: ReportModel
Adds a PropertyChangeListener to the listener list. The listener is registered for all bound properties of this class

Specified by:
addPropertyChangeListener in interface ReportModel
Parameters:
listener - the property change listener to be added

removePropertyChangeListener

public void removePropertyChangeListener(PropertyChangeListener listener)
Description copied from interface: ReportModel
Removes a PropertyChangeListener from the listener list. This method should be used to remove PropertyChangeListeners that were registered for all bound properties of this class. If listener is null, no exception is thrown and no action is performed.

Specified by:
removePropertyChangeListener in interface ReportModel
Parameters:
listener - the PropertyChangeListener to be removed

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners()

addPropertyChangeListener

public void addPropertyChangeListener(String propertyName,
                                      PropertyChangeListener listener)

removePropertyChangeListener

public void removePropertyChangeListener(String propertyName,
                                         PropertyChangeListener listener)

getPropertyChangeListeners

public PropertyChangeListener[] getPropertyChangeListeners(String propertyName)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  boolean oldValue,
                                  boolean newValue)

firePropertyChange

protected void firePropertyChange(String propertyName,
                                  int oldValue,
                                  int newValue)

findStyleID

public boolean findStyleID(Object styleId)
Checks use of style in model

Parameters:
styleId - the identifier of style
Returns:
true if style is used

replaceStyleID

public void replaceStyleID(Object oldStyleId,
                           Object newStyleId)
Replaces styles

Parameters:
oldStyleId - old style's id
newStyleId - new style's id

setStretchPage

public void setStretchPage(boolean stretchPage)
Description copied from interface: ReportModel
Printing mode that scales the output smaller, if necessary, to fit the report's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary.

Specified by:
setStretchPage in interface ReportModel
Parameters:
stretchPage - if true sets printing mode in FIT_WIDTH otherwise in NORMAL
See Also:
JTable.PrintMode

isStretchPage

public boolean isStretchPage()
Description copied from interface: ReportModel
Printing mode that scales the output smaller, if necessary, to fit the report's entire width (and thereby all columns) on each page; Rows are spread across multiple pages as necessary.

Specified by:
isStretchPage in interface ReportModel
Returns:
if true sets printing mode in FIT_WIDTH otherwise in NORMAL.

isRowBreak

public boolean isRowBreak(int row)
Description copied from interface: ReportModel
Returns the flag of the page's break by the row's number

Specified by:
isRowBreak in interface ReportModel
Parameters:
row - the row's number
Returns:
the flag of the page's end

setRowBreak

public void setRowBreak(int row,
                        boolean end)
Description copied from interface: ReportModel
Sets the horizontal page break after row

Specified by:
setRowBreak in interface ReportModel
Parameters:
row - the row's number
end - a boolean value, where true sets the end page and false remove it

isColumnBreak

public boolean isColumnBreak(int column)
Description copied from interface: ReportModel
Returns true if the sets vertical page break after column

Specified by:
isColumnBreak in interface ReportModel
Parameters:
column - the column's number
Returns:
columnBreak property

setColumnBreak

public void setColumnBreak(int column,
                           boolean end)
Description copied from interface: ReportModel
Sets the vertical page break after column

Specified by:
setColumnBreak in interface ReportModel
Parameters:
column - the column's number
end - a boolean value, where true sets the page break and false remove it

getSelectedCells

public Iterator<Cell> getSelectedCells(GridRect rect)
Description copied from interface: ReportModel
Returns cells that do not have owner

Specified by:
getSelectedCells in interface ReportModel
Parameters:
rect - the region where the cells are selected
Returns:
iterator

getCellWrap

public CellWrap getCellWrap(int row,
                            int column)
Description copied from interface: ReportModel
Returns the CellWrap object for the cell by row and column

Specified by:
getCellWrap in interface ReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the CellWrap object

getToolTipText

public String getToolTipText(Point point)

getToolTipText

public String getToolTipText(int row,
                             int column)
Description copied from interface: ReportModel
Returns the string to be used as the tooltip for the cell by row and column.

Specified by:
getToolTipText in interface ReportModel
Parameters:
row - the row's number
column - the column's number
Returns:
the tooltip string

deleteCell

public void deleteCell(int row,
                       int column)

delete

public void delete(GridRect selectionRect)
Description copied from interface: ReportModel
Removes the selected cells

Specified by:
delete in interface ReportModel
Parameters:
selectionRect - coordinates of the selected cells

getCellRect

public Rectangle getCellRect(int row,
                             int column,
                             boolean includeSpacing,
                             boolean isLeftToRight)
Description copied from interface: ReportModel
Returns a rectangle for the cell that lies at the intersection of row and column. If the cell's are spaned, rectangle is returned for all the spaned cells

Specified by:
getCellRect in interface ReportModel
Parameters:
row - the row's number
column - the column's number
includeSpacing - if false, return the true cell bounds - computed by subtracting the intercell spacing from the height and widths of the column and row models
Returns:
the rectangle containing the cell at location row,column

updateCarryRows

public void updateCarryRows(HeighCalculator hCalc,
                            int row,
                            int column)

updateRowHeight

public void updateRowHeight(HeighCalculator hCalc,
                            int row,
                            int column)
Description copied from interface: ReportModel
Sets row's height by the content of the cell

Specified by:
updateRowHeight in interface ReportModel
Parameters:
hCalc - interface for calculation the cell's height
row - the row's number
column - the column's number

isVisible

public boolean isVisible()
Description copied from interface: ReportModel
Determines whether report should be visible

Specified by:
isVisible in interface ReportModel
Returns:
true if the report is visible, false otherwise

setVisible

public void setVisible(boolean visible)
Description copied from interface: ReportModel
Shows or hides report depending on the value of parameter visible.

Specified by:
setVisible in interface ReportModel
Parameters:
visible - if true, shows this report; otherwise, hides this report

isCanUpdatePages

public boolean isCanUpdatePages()
Description copied from interface: ReportModel
Determines whether page's bounders will be calculated automatically

Specified by:
isCanUpdatePages in interface ReportModel
Returns:
canUpdatePages property

setCanUpdatePages

public void setCanUpdatePages(boolean b)
Description copied from interface: ReportModel
Sets the property that determines whether page's bounders will be calculated automatically

Specified by:
setCanUpdatePages in interface ReportModel
Parameters:
b - if true, page's bounders will be calculated automatically

updatePages

public void updatePages(int startRow)
Description copied from interface: ReportModel
Calculates pages' size

Specified by:
updatePages in interface ReportModel
Parameters:
startRow - the first row for calculation

getCellPosition

public CellCoord getCellPosition(Cell cell)
Specified by:
getCellPosition in interface ReportModel

startUpdate

public void startUpdate()
Description copied from interface: ReportModel
Bans notification of listeners

Specified by:
startUpdate in interface ReportModel

endUpdate

public void endUpdate()
Description copied from interface: ReportModel
Allows notification of listeners

Specified by:
endUpdate in interface ReportModel

isUpdate

public boolean isUpdate()
Specified by:
isUpdate in interface ReportModel
Returns:
if true, all notification are locked

calcRowWidths

public int calcRowWidths(StringMetrics metrics,
                         Cell cell,
                         int row,
                         int column)

isShowHeader

public boolean isShowHeader()
Specified by:
isShowHeader in interface ReportModel

isShowRowHeader

public boolean isShowRowHeader()
Specified by:
isShowRowHeader in interface ReportModel

setShowHeader

public void setShowHeader(boolean b)
Specified by:
setShowHeader in interface ReportModel

setShowRowHeader

public void setShowRowHeader(boolean b)
Specified by:
setShowRowHeader in interface ReportModel

getCellText

public String getCellText(Cell cell)
Specified by:
getCellText in interface ReportModel

setColumnWidths

public void setColumnWidths(int[] widths)
Specified by:
setColumnWidths in interface ReportModel

updateRowAndPageHeight

public void updateRowAndPageHeight(HeighCalculator hCalc)
Specified by:
updateRowAndPageHeight in interface ReportModel

findRightColumn

public int findRightColumn(int leftCol)
Description copied from interface: ReportModel
Searches for the right extreme column of page

Specified by:
findRightColumn in interface ReportModel
Parameters:
leftCol - the column with which starts search
Returns:
column number

isLastRowInPage

public boolean isLastRowInPage(int row)
Description copied from interface: ReportModel
Returns true if the row is last on page

Specified by:
isLastRowInPage in interface ReportModel
Parameters:
row - the row's number
Returns:
true if the row is last on page

isPrintLeftToRight

public boolean isPrintLeftToRight()
Description copied from interface: ReportModel
Direction of an output of pages on the printer. If true that pages are printed from left to right, from top to down, differently pages are printed from top to down, from left to right.

Specified by:
isPrintLeftToRight in interface ReportModel
Returns:
if true that pages are printed from left to right, otherwise from top to down

setPrintLeftToRight

public void setPrintLeftToRight(boolean value)
Description copied from interface: ReportModel
Direction of an output of pages on the printer. If true that pages are printed from left to right, from top to down, differently pages are printed from top to down, from left to right.

Specified by:
setPrintLeftToRight in interface ReportModel