net.sf.statcvs.renderer
Class HTMLTableCellRenderer

java.lang.Object
  |
  +--net.sf.statcvs.renderer.HTMLTableCellRenderer
All Implemented Interfaces:
TableCellRenderer

public class HTMLTableCellRenderer
extends java.lang.Object
implements TableCellRenderer

Helper class for rendering different types of table cells and table heads to HTML

Version:
$Id: HTMLTableCellRenderer.java,v 1.1 2003/06/22 19:24:26 cyganiak Exp $
Author:
Richard Cyganiak

Constructor Summary
HTMLTableCellRenderer()
           
 
Method Summary
 java.lang.String getColumnHead()
          Return the results of the last renderCell call
 java.lang.String getRowHead()
          Return the results of the last renderCell call as a row head
 java.lang.String getTableCell()
          Return the results of the last renderCell call as an ordinary table cell
 void renderAuthorCell(Author author)
          Render a cell containing an author to HTML
 void renderCell(java.lang.String content)
          Render a generic table cell to HTML
 void renderDirectoryCell(Directory directory)
          Render a cell containing a directory to HTML
 void renderEmptyCell()
          Render an empty cell to HTML
 void renderFileCell(CvsFile file, boolean withIcon)
          Render a cell containing a file to HTML
 void renderIntegerCell(int value)
          Render an integer cell to HTML
 void renderIntegerCell(int value, int total)
          Render an integer cell to HTML, showing both the integer value and a percentage of a total
 void renderPercentageCell(double ratio)
          Render a percentage cell to HTML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLTableCellRenderer

public HTMLTableCellRenderer()
Method Detail

renderCell

public void renderCell(java.lang.String content)
Render a generic table cell to HTML

Specified by:
renderCell in interface TableCellRenderer
Parameters:
content - the cell's content

renderEmptyCell

public void renderEmptyCell()
Render an empty cell to HTML

Specified by:
renderEmptyCell in interface TableCellRenderer

renderIntegerCell

public void renderIntegerCell(int value)
Render an integer cell to HTML

Specified by:
renderIntegerCell in interface TableCellRenderer
Parameters:
value - the cell's content

renderIntegerCell

public void renderIntegerCell(int value,
                              int total)
Render an integer cell to HTML, showing both the integer value and a percentage of a total

Specified by:
renderIntegerCell in interface TableCellRenderer
Parameters:
value - the cell's content
total - the total, worth 100%

renderPercentageCell

public void renderPercentageCell(double ratio)
Render a percentage cell to HTML

Specified by:
renderPercentageCell in interface TableCellRenderer
Parameters:
ratio - the cell's content

renderAuthorCell

public void renderAuthorCell(Author author)
Render a cell containing an author to HTML

Specified by:
renderAuthorCell in interface TableCellRenderer
Parameters:
author - the author

renderDirectoryCell

public void renderDirectoryCell(Directory directory)
Render a cell containing a directory to HTML

Specified by:
renderDirectoryCell in interface TableCellRenderer
Parameters:
directory - the directory

renderFileCell

public void renderFileCell(CvsFile file,
                           boolean withIcon)
Render a cell containing a file to HTML

Specified by:
renderFileCell in interface TableCellRenderer
Parameters:
file - the file
withIcon - display an icon in front of the filename?

getColumnHead

public java.lang.String getColumnHead()
Return the results of the last renderCell call

Returns:
HTML

getRowHead

public java.lang.String getRowHead()
Return the results of the last renderCell call as a row head

Returns:
HTML

getTableCell

public java.lang.String getTableCell()
Return the results of the last renderCell call as an ordinary table cell

Returns:
HTML