View Javadoc

1   package org.wcb.common;
2   
3   import javax.swing.*;
4   import javax.swing.table.TableCellRenderer;
5   import java.awt.*;
6   
7   /***
8    * Copyright (C) 2003  Walter Bogaardt
9    *
10   * This library is free software; you can redistribute it and/or
11   * modify it under the terms of the GNU Lesser General Public
12   * License as published by the Free Software Foundation; either
13   * version 2 of the License, or (at your option) any later version.
14   *
15   * This library is distributed in the hope that it will be useful,
16   * but WITHOUT ANY WARRANTY; without even the implied warranty of
17   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
18   * Lesser General Public License for more details.
19   *
20   * You should have received a copy of the GNU Lesser General Public
21   * License along with this library; if not, write to the Free Software
22   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
23   *
24   *  Project:   Home Automation Interface
25   *
26   *  Abstract:  User Interface options dialog box
27   *  Filename:  $Id: FontRender.java,v 1.2 2003/12/30 22:15:59 wbogaardt Exp $
28   *
29   * *  $Log: FontRender.java,v $
30   * *  Revision 1.2  2003/12/30 22:15:59  wbogaardt
31   * *  added javadoc comments
32   * *
33   */
34  public class FontRender extends JLabel implements TableCellRenderer {
35  
36      public FontRender() {
37          super();
38      }
39  
40      public Component getTableCellRendererComponent(
41              JTable table, Object font,
42              boolean isSelected, boolean hasFocus,
43              int row, int column) {
44          Font fontType = (Font)font;
45          this.setFont(fontType);
46          this.setText(fontType.getFamily());
47          return this;
48      }
49  }