001 package ui.renderer; 002 003 import util.*; 004 005 import java.awt.Component; 006 import java.util.*; 007 import javax.swing.*; 008 import javax.swing.event.*; 009 import javax.swing.table.DefaultTableCellRenderer; 010 011 012 public class StarRenderer extends DefaultTableCellRenderer { 013 014 public void StarRenderer() { 015 } 016 017 public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { 018 super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); 019 020 // look up the classes and their corresponding icons and text representations 021 if (value instanceof Star) { 022 Star star = (Star) value; 023 //setText("spectral lines : " + star.getEmissionLines()); 024 setText(""); 025 setIcon(new SpectraIcon(star)); // TODO: Should pass cell dimensions to SpectraIcon constructor 026 } 027 return this; 028 } 029 030 031 //public static final Icon ICON_SPECTRA= getImageIcon("images/spectra.gif"); 032 033 }