001 package jigcell.compare.compare2; 002 003 import java.awt.Color; 004 import javax.swing.JTable; 005 import javax.swing.table.TableCellRenderer; 006 007 /** 008 * A table renderer that can color the view of a Compare^2. 009 * 010 * <p> 011 * Additionally a public static method is required to be implemented: 012 * </p> 013 * 014 * <ul> 015 * <li> 016 * public static Object getInstances (Compare2); 017 * </li> 018 * </ul> 019 * 020 * <p> 021 * where the first parameter will be the view that should be colored. 022 * </p> 023 * 024 * <p> 025 * This code is licensed under the DARPA BioCOMP Open Source License. See LICENSE for more details. 026 * </p> 027 * 028 * @author Nicholas Allen 029 */ 030 031 public interface IViewColorer extends TableCellRenderer { 032 033 /** 034 * Display comparison rankings 035 */ 036 037 int MODE_RANKINGS = 1; 038 039 /** 040 * Display raw comparison values 041 */ 042 043 int MODE_VALUES = 0; 044 045 /** 046 * Name of the static method to be invoked for view colorers 047 */ 048 049 String METHOD_GENERATE = "getInstances"; 050 051 /** 052 * The color of a cell as it will appear in the table. 053 * 054 * @param table Table to appear in 055 * @param value Data value 056 * @param selected Whether the value is selected 057 * @param focus Whether the value is focused 058 * @param row Value row 059 * @param column Value column 060 */ 061 062 Color getColorForCell (JTable table, Object value, boolean selected, boolean focus, int row, int column); 063 064 /** 065 * The name of this renderer. 066 */ 067 068 String getName (); 069 070 /** 071 * Sets the display mode of this view colorer. 072 * 073 * @param mode Display mode 074 */ 075 076 void setDisplayMode (int mode); 077 }