// Path: src/main/java/no/uib/jsparklines/data/Chromosome.java
// public class Chromosome implements Comparable<Chromosome>, Serializable {
// 
//     /**
//      * The version UID for Serialization/Deserialization compatibility.
//      */
//     static final long serialVersionUID = 2505328876343336528L;
//     /**
//      * The chromosome name.
//      */
//     private String chromosomeName;
//     /**
//      * The chromosome number or X, Y, Z or W.
//      */
//     private Integer chromosomeNumber;
//     /**
//      * Integer value representing the X chromosome.
//      */
//     private final Integer X = Integer.MAX_VALUE - 4;
//     /**
//      * Integer value representing the Y chromosome.
//      */
//     private final Integer Y = Integer.MAX_VALUE - 3;
//     /**
//      * Integer value representing the Z chromosome.
//      */
//     private final Integer Z = Integer.MAX_VALUE - 2;
//     /**
//      * Integer value representing the W chromosome.
//      */
//     private final Integer W = Integer.MAX_VALUE - 1;
//     /**
//      * Integer value representing an unknown chromosome.
//      */
//     public final static Integer UNKNOWN = Integer.MAX_VALUE;
// 
//     /**
//      * Create a new Chromosome.
//      *
//      * @param chromosomeName the name of the chromosome, integer or X, Y, Z, W
//      * is preferred
//      */
//     public Chromosome(String chromosomeName) {
// 
//         this.chromosomeName = chromosomeName;
// 
//         if (chromosomeName == null) {
//             this.chromosomeNumber = UNKNOWN;
//         } else {
//             try {
//                 this.chromosomeNumber = Integer.parseInt(chromosomeName);
//             } catch (NumberFormatException e) {
//                 // see if it is X, Y, Z, or W
//                 if (chromosomeName.equalsIgnoreCase("X")) {
//                     this.chromosomeNumber = X;
//                 } else if (chromosomeName.equalsIgnoreCase("Y")) {
//                     this.chromosomeNumber = Y;
//                 } else if (chromosomeName.equalsIgnoreCase("Z")) {
//                     this.chromosomeNumber = Z;
//                 } else if (chromosomeName.equalsIgnoreCase("W")) {
//                     this.chromosomeNumber = W;
//                 } else {
//                     this.chromosomeNumber = chromosomeName.hashCode();
//                 }
//             }
//         }
//     }
// 
//     /**
//      * Returns the chromosome as a string.
//      *
//      * @return the chromosome as a string
//      */
//     public String toString() {
//         if (chromosomeName == null) {
//             return "";
//         } else {
//             return chromosomeName;
//         }
//     }
// 
//     /**
//      * Compares based on the chromosome numbers. X, Y, Z and W are ordered at
//      * the end, in this order.
//      */
//     public int compareTo(Chromosome o) {
// 
//         if (o == null) {
//             return 1;
//         }
//         if (this.chromosomeNumber == null) {
//             return -1;
//         }
//         if (o.chromosomeNumber == null) {
//             return 1;
//         }
// 
//         return Double.compare(this.chromosomeNumber, o.chromosomeNumber);
//     }
// }


import java.awt.Color;
import java.awt.Component;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import no.uib.jsparklines.data.Chromosome;

    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

        JComponent c = (JComponent) new DefaultTableCellRenderer().getTableCellRendererComponent(table, value,
                isSelected, hasFocus, row, column);

        // respect focus and hightlighting
        setBorder(c.getBorder());
        setOpaque(c.isOpaque());
        setBackground(c.getBackground());

        JLabel valueLabel = new JLabel();
        valueLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        valueLabel.setFont(valueLabel.getFont().deriveFont(valueLabel.getFont().getSize() - 2f));

        // respect focus and hightlighting
        Color bg = c.getBackground();

        valueLabel.setBorder(c.getBorder());
        valueLabel.setOpaque(c.isOpaque());
        valueLabel.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue()));
  
        // update the link color depending on if the row is selected or not
        if (isSelected) {
            valueLabel.setForeground(selectedFontColor);
        } else {
            valueLabel.setForeground(notSelectedFontColor);
        }

// Path: src/main/java/no/uib/jsparklines/data/Chromosome.java
// public class Chromosome implements Comparable<Chromosome>, Serializable {
// 
//     /**
//      * The version UID for Serialization/Deserialization compatibility.
//      */
//     static final long serialVersionUID = 2505328876343336528L;
//     /**
//      * The chromosome name.
//      */
//     private String chromosomeName;
//     /**
//      * The chromosome number or X, Y, Z or W.
//      */
//     private Integer chromosomeNumber;
//     /**
//      * Integer value representing the X chromosome.
//      */
//     private final Integer X = Integer.MAX_VALUE - 4;
//     /**
//      * Integer value representing the Y chromosome.
//      */
//     private final Integer Y = Integer.MAX_VALUE - 3;
//     /**
//      * Integer value representing the Z chromosome.
//      */
//     private final Integer Z = Integer.MAX_VALUE - 2;
//     /**
//      * Integer value representing the W chromosome.
//      */
//     private final Integer W = Integer.MAX_VALUE - 1;
//     /**
//      * Integer value representing an unknown chromosome.
//      */
//     public final static Integer UNKNOWN = Integer.MAX_VALUE;
// 
//     /**
//      * Create a new Chromosome.
//      *
//      * @param chromosomeName the name of the chromosome, integer or X, Y, Z, W
//      * is preferred
//      */
//     public Chromosome(String chromosomeName) {
// 
//         this.chromosomeName = chromosomeName;
// 
//         if (chromosomeName == null) {
//             this.chromosomeNumber = UNKNOWN;
//         } else {
//             try {
//                 this.chromosomeNumber = Integer.parseInt(chromosomeName);
//             } catch (NumberFormatException e) {
//                 // see if it is X, Y, Z, or W
//                 if (chromosomeName.equalsIgnoreCase("X")) {
//                     this.chromosomeNumber = X;
//                 } else if (chromosomeName.equalsIgnoreCase("Y")) {
//                     this.chromosomeNumber = Y;
//                 } else if (chromosomeName.equalsIgnoreCase("Z")) {
//                     this.chromosomeNumber = Z;
//                 } else if (chromosomeName.equalsIgnoreCase("W")) {
//                     this.chromosomeNumber = W;
//                 } else {
//                     this.chromosomeNumber = chromosomeName.hashCode();
//                 }
//             }
//         }
//     }
// 
//     /**
//      * Returns the chromosome as a string.
//      *
//      * @return the chromosome as a string
//      */
//     public String toString() {
//         if (chromosomeName == null) {
//             return "";
//         } else {
//             return chromosomeName;
//         }
//     }
// 
//     /**
//      * Compares based on the chromosome numbers. X, Y, Z and W are ordered at
//      * the end, in this order.
//      */
//     public int compareTo(Chromosome o) {
// 
//         if (o == null) {
//             return 1;
//         }
//         if (this.chromosomeNumber == null) {
//             return -1;
//         }
//         if (o.chromosomeNumber == null) {
//             return 1;
//         }
// 
//         return Double.compare(this.chromosomeNumber, o.chromosomeNumber);
//     }
// }


// Path: src/main/java/no/uib/jsparklines/extra/ChromosomeTableCellRenderer.java
import java.awt.Color;
import java.awt.Component;
import javax.swing.JComponent;
import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;
import javax.swing.table.TableCellRenderer;
import no.uib.jsparklines.data.Chromosome;


    @Override
    public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {

        JComponent c = (JComponent) new DefaultTableCellRenderer().getTableCellRendererComponent(table, value,
                isSelected, hasFocus, row, column);

        // respect focus and hightlighting
        setBorder(c.getBorder());
        setOpaque(c.isOpaque());
        setBackground(c.getBackground());

        JLabel valueLabel = new JLabel();
        valueLabel.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        valueLabel.setFont(valueLabel.getFont().deriveFont(valueLabel.getFont().getSize() - 2f));

        // respect focus and hightlighting
        Color bg = c.getBackground();

        valueLabel.setBorder(c.getBorder());
        valueLabel.setOpaque(c.isOpaque());
        valueLabel.setBackground(new Color(bg.getRed(), bg.getGreen(), bg.getBlue()));
  
        // update the link color depending on if the row is selected or not
        if (isSelected) {
            valueLabel.setForeground(selectedFontColor);
        } else {
            valueLabel.setForeground(notSelectedFontColor);
        }

        if (value != null && value instanceof Chromosome) {