1 /* 2 StatCvs - CVS statistics generation 3 Copyright (C) 2002 Lukasz Pekacki <lukasz@pekacki.de> 4 http://statcvs.sf.net/ 5 6 This library is free software; you can redistribute it and/or 7 modify it under the terms of the GNU Lesser General Public 8 License as published by the Free Software Foundation; either 9 version 2.1 of the License, or (at your option) any later version. 10 11 This library is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 Lesser General Public License for more details. 15 16 You should have received a copy of the GNU Lesser General Public 17 License along with this library; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 20 $RCSfile: TableCellRenderer.java,v $ 21 $Date: 2008/04/02 11:22:15 $ 22 */ 23 package net.sf.statcvs.renderer; 24 25 import net.sf.statcvs.model.Author; 26 import net.sf.statcvs.model.Directory; 27 import net.sf.statcvs.model.VersionedFile; 28 import net.sf.statcvs.output.WebRepositoryIntegration; 29 30 /** 31 * Interface for a class that turns {@link net.sf.statcvs.reportmodel.Column}s 32 * into their representation for some output format, for example a HTML 33 * <td> or an XML element. 34 * 35 * @author Richard Cyganiak <rcyg@gmx.de> 36 * @version $Id: TableCellRenderer.java,v 1.11 2008/04/02 11:22:15 benoitx Exp $ 37 */ 38 public interface TableCellRenderer { 39 40 /** 41 * Render a generic table cell 42 * @param content the cell's content 43 */ 44 void renderCell(String content); 45 46 /** 47 * Render an empty cell 48 */ 49 void renderEmptyCell(); 50 51 /** 52 * Render an integer cell 53 * @param value the cell's content 54 */ 55 void renderIntegerCell(int value); 56 57 /** 58 * Render an integer cell, showing both the integer value and 59 * a percentage of a total 60 * @param value the cell's content 61 * @param total the total, worth 100% 62 */ 63 void renderIntegerCell(int value, int total); 64 65 /** 66 * Render a percentage cell 67 * @param ratio the cell's content 68 */ 69 void renderPercentageCell(double ratio); 70 71 /** 72 * Render a cell containing an author 73 * @param author the author 74 */ 75 76 void renderAuthorCell(Author author); 77 78 /** 79 * Render a cell containing an author Id 80 * @param author the author 81 */ 82 83 void renderAuthorIdCell(Author author); 84 85 /** 86 * Render a cell containing a directory 87 * @param directory the directory 88 */ 89 void renderDirectoryCell(Directory directory); 90 91 /** 92 * Render a cell containing a file 93 * @param file the file 94 * @param withIcon display an icon in front of the filename? 95 * @param webRepository for creating links; might be <tt>null</tt> 96 */ 97 void renderFileCell(VersionedFile file, boolean withIcon, WebRepositoryIntegration webRepository); 98 99 /** 100 * Render a cell containing a link. 101 */ 102 void renderLinkCell(String url, String label); 103 }