|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ReportModel
The ReportModel interface specifies the methods of the report will use to interrogate a grid data model.
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. |
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 |
void |
clearUnion(int row,
int column)
Clears the unions of the cell by row and column |
Cell |
createReportCell(int row,
int column)
Creates the Cell by row and column |
void |
delete(GridRect selectionRect)
Removes the selected cells |
void |
endUpdate()
Allows notification of listeners |
int |
findRightColumn(int leftCol)
Searches for the right extreme column of page |
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,
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 |
TableColumnModel |
getColumnModel()
|
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. |
Cell |
getReportCell(int row,
int column)
Returns the Cell by row and column |
ReportPage |
getReportPage()
|
String |
getReportTitle()
|
int |
getRowHeight(int row)
Returns the height of the row |
TableRowModel |
getRowModel()
|
Iterator<Cell> |
getSelectedCells(GridRect rect)
Returns cells that do not have owner |
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. |
boolean |
isCanUpdatePages()
Determines whether page's bounders will be calculated automatically |
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 |
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 |
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 |
removeRows()
Removes all rows from the model. |
void |
removeRows(int count,
int index)
Removes rows' count begining with the index from the model. |
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 b)
Sets the vertical page break after column |
void |
setColumnCount(int count)
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 selectionRect,
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 |
setReportTitle(String reportTitle)
|
void |
setRowBreak(int row,
boolean b)
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> map)
|
void |
setVerticalAlignment(GridRect selectionRect,
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 |
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 interface javax.swing.table.TableModel |
---|
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt |
Method Detail |
---|
int addRows(int count, int index)
count
- rows' countindex
- the row index of the rows to be inserted
void removeRows(int count, int index)
count
- rows' countindex
- index of the first removed rowvoid removeRows()
int addColumns(int count)
count
- columns' count
int addColumns(int count, int index)
count
- columns' countindex
- the column index of the columns to be inserted
void removeColumns(int count, int index)
count
- columns' countindex
- index of the first removed columnvoid setColumnCount(int count)
count
- new columns' countCell getReportCell(int row, int column)
row
- the row's numbercolumn
- the column's number
Cell getOwnerReportCell(int row, int column)
row
- the row's numbercolumn
- the column's number
Cell createReportCell(int row, int column)
row
- the row's numbercolumn
- the column's number
int getOwnerRow(Cell cell, int row, int column)
cell
- the cellrow
- the row's numbercolumn
- the column's number
int getOwnerColumn(Cell cell, int row, int column)
cell
- the cellrow
- the row's numbercolumn
- the column's number
int getColumnWidth(int column)
column
- the column's number
int getRowHeight(int row)
row
- the row's number
void setRowHeight(int row, int rowHeight)
row
- the row's numberrowHeight
- a new row's heightvoid unionCells(int topRow, int leftColumn, int bottomRow, int rightColumn)
topRow
- the number of the top rowleftColumn
- the number of the left columnbottomRow
- the number of the bottom rowrightColumn
- the number of the right columnvoid clearUnion(int row, int column)
row
- the row's numbercolumn
- the column's numbervoid addBorder(int topRow, int leftColumn, int bottomRow, int rightColumn, boolean[] positions, Border line)
topRow
- the number of the top rowleftColumn
- the number of the left columnbottomRow
- the number of the bottom rowrightColumn
- the number of the right columnpositions
- positions - boolean values, where true sets border, otherwise
does nothing. Position's index can be from Border.LINE_LEFT to
Border.LINE_HMIDDLEline
- the borderString getReportTitle()
void setReportTitle(String reportTitle)
reportTitle
- a new report's title.int getDefaultColumnWidth()
void setDefaultColumnWidth(int defaultColumnWidth)
defaultColumnWidth
- a new default column's widthReportPage getReportPage()
boolean isRowSizing()
void setRowSizing(boolean b)
b
- true if report view should allow resizingboolean isColSizing()
void setColSizing(boolean b)
b
- true if report view should allow resizingboolean isRowMoving()
void setRowMoving(boolean b)
b
- true if the report view should allow reordering; otherwise
falseboolean isColMoving()
void setColMoving(boolean b)
b
- true if the report view should allow reordering; otherwise
falseboolean isEditable()
void setEditable(boolean b)
b
- the boolean to be setboolean isStretchPage()
void setStretchPage(boolean stretchPage)
stretchPage
- if true sets printing mode in FIT_WIDTH otherwise in NORMALJTable.PrintMode
boolean isRowBreak(int row)
row
- the row's number
boolean isLastRowInPage(int row)
row
- the row's number
void setRowBreak(int row, boolean b)
row
- the row's numberb
- a boolean value, where true sets the end page and false remove
itboolean isColumnBreak(int column)
column
- the column's number
void setColumnBreak(int column, boolean b)
column
- the column's numberb
- a boolean value, where true sets the page break and false
remove itTableRowModel getRowModel()
TableColumnModel getColumnModel()
Iterator<Cell> getSelectedCells(GridRect rect)
rect
- the region where the cells are selected
CellStyle getStyles(Object index)
index
- the id of the CellStyle
Object addStyle(CellStyle style)
style
- adding style
Rectangle getCellRect(int row, int column, boolean includeSpacing, boolean isLeftToRight)
row
- the row's numbercolumn
- the column's numberincludeSpacing
- if false, return the true cell bounds - computed by
subtracting the intercell spacing from the height and widths
of the column and row modelsisLeftToRight
-
Dimension getCellSize(Cell cell, int row, int column, boolean includeSpacing)
cell
- the Cell for which size is returnsrow
- the row's numbercolumn
- the column's numberincludeSpacing
-
void updateRowHeight(HeighCalculator hCalc, int row, int column)
hCalc
- interface for calculation the cell's heightrow
- the row's numbercolumn
- the column's numberboolean isVisible()
void setVisible(boolean visible)
visible
- if true, shows this report; otherwise, hides this reportboolean isCanUpdatePages()
void setCanUpdatePages(boolean b)
b
- if true, page's bounders will be calculated automaticallyvoid updatePages(int startRow)
startRow
- the first row for calculationvoid updateRowAndPageHeight(HeighCalculator hCalc)
void addPropertyChangeListener(PropertyChangeListener listener)
listener
- the property change listener to be addedvoid removePropertyChangeListener(PropertyChangeListener listener)
listener
- the PropertyChangeListener to be removedvoid setFontName(GridRect selRect, String fontName)
selRect
- coordinates for selected cellsfontName
- the font's namevoid setFontSize(GridRect selRect, int fontSize)
selRect
- coordinates for selected cellsfontSize
- the new font's sizeboolean isFontStyle(int row, int column, int style)
row
- the row's numbercolumn
- the column's numberstyle
- the font's style
void setFontStyle(GridRect selRect, int fontStyle, boolean enable)
selRect
- coordinates of the selected cellsfontStyle
- the font's style The style argument is an integer bitmask that
may be PLAIN, or a bitwise union of BOLD, ITALIC, UNDERLINE,
STRIKETHROUGHenable
- if true, the style is determined, otherwise the style is
removed.void setBackground(GridRect selectionRect, Color color)
selectionRect
- coordinates of the selected cellscolor
- the new background color for the cellsvoid setForeground(GridRect selectionRect, Color color)
selectionRect
- coordinates of the selected cellscolor
- the new foreground color for the cellsvoid setDecimals(GridRect selectionRect, int d)
selectionRect
- coordinates of the selected cellsd
- the decimal position of the numeric value.void setHorizontalAlignment(GridRect selectionRect, int align)
selectionRect
- coordinates of the selected cellsalign
- the new horizontal alignment for the cellsvoid setVerticalAlignment(GridRect selectionRect, int align)
selectionRect
- coordinates of the selected cellsalign
- the new vertical alignment for the cellsvoid delete(GridRect selectionRect)
selectionRect
- coordinates of the selected cellsCellWrap getCellWrap(int row, int column)
row
- the row's numbercolumn
- the column's number
void startUpdate()
CellCoord getCellPosition(Cell cell)
void endUpdate()
boolean isUpdate()
String getToolTipText(int row, int column)
row
- the row's numbercolumn
- the column's number
boolean isShowHeader()
void setShowHeader(boolean b)
boolean isShowRowHeader()
void setShowRowHeader(boolean b)
String getCellText(Cell cell)
void setColumnWidths(int[] widths)
int findRightColumn(int leftCol)
leftCol
- the column with which starts search
void setStyleList(Map<Object,CellStyle> map)
map
- boolean isPrintLeftToRight()
void setPrintLeftToRight(boolean value)
value
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |