Package captureplugin.tabs

Source Code of captureplugin.tabs.DeviceTableCellRenderer

/*
* CapturePlugin by Andreas Hessel (Vidrec@gmx.de), Bodo Tasche
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*
* CVS information:
*  $RCSfile$
*   $Source$
*     $Date: 2009-09-04 11:15:55 +0200 (Fri, 04 Sep 2009) $
*   $Author: bananeweizen $
* $Revision: 5953 $
*/
package captureplugin.tabs;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import captureplugin.drivers.DeviceIf;


/**
* Renders a Device
*
* @author bodum
*/
public class DeviceTableCellRenderer extends DefaultTableCellRenderer {

    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
        JLabel label = (JLabel) super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
       
        if (value instanceof DeviceIf) {
            DeviceIf device = (DeviceIf)value;
            String str = device.getName() + " (" + device.getDriver().getDriverName()
          + ")";
            label.setText(str);
        }
       
        return label;
    }

}
TOP

Related Classes of captureplugin.tabs.DeviceTableCellRenderer

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.