mev-4.0.01/source/org/tigr/microarray/mev/cgh/CGHGuiObj/AlgorithmResultsViewers/NumberOfAlterationsViewers/NumberOfDeletionsAmpilficationsDataModel.java

Code
Comments
Other
Rev Date Author Line
2 26 Feb 07 jari 1 /*
2 26 Feb 07 jari 2  * NumberOfDeletionsAmpilficationsDataModel.java
2 26 Feb 07 jari 3  *
2 26 Feb 07 jari 4  * Created on June 15, 2003, 6:49 AM
2 26 Feb 07 jari 5  */
2 26 Feb 07 jari 6
2 26 Feb 07 jari 7 package org.tigr.microarray.mev.cgh.CGHGuiObj.AlgorithmResultsViewers.NumberOfAlterationsViewers;
2 26 Feb 07 jari 8
2 26 Feb 07 jari 9 import org.tigr.microarray.mev.cgh.CGHDataObj.AlterationRegion;
2 26 Feb 07 jari 10 import org.tigr.microarray.mev.cgh.CGHDataObj.ICGHDataRegion;
2 26 Feb 07 jari 11
2 26 Feb 07 jari 12 /**
2 26 Feb 07 jari 13  *
2 26 Feb 07 jari 14  * @author  Adam Margolin
2 26 Feb 07 jari 15  * @author Raktim Sinha
2 26 Feb 07 jari 16  */
2 26 Feb 07 jari 17
2 26 Feb 07 jari 18 public class NumberOfDeletionsAmpilficationsDataModel extends NumberOfAlterationsDataModel{
2 26 Feb 07 jari 19
2 26 Feb 07 jari 20     /** Creates a new instance of NumberOfAlterationsDataModel */
2 26 Feb 07 jari 21     public NumberOfDeletionsAmpilficationsDataModel () {
2 26 Feb 07 jari 22     }
2 26 Feb 07 jari 23
2 26 Feb 07 jari 24     /** Getter for property alterationRegions.
2 26 Feb 07 jari 25      * @return Value of property alterationRegions.
2 26 Feb 07 jari 26      */
2 26 Feb 07 jari 27     public AlterationRegion[] getAlterationRegions() {
2 26 Feb 07 jari 28         return this.alterationRegions;
2 26 Feb 07 jari 29     }
2 26 Feb 07 jari 30
2 26 Feb 07 jari 31     /** Setter for property alterationRegions.
2 26 Feb 07 jari 32      * @param alterationRegions New value of property alterationRegions.
2 26 Feb 07 jari 33      */
2 26 Feb 07 jari 34     public void setAlterationRegions(AlterationRegion[] alterationRegions) {
2 26 Feb 07 jari 35         this.alterationRegions = alterationRegions;
2 26 Feb 07 jari 36     }
2 26 Feb 07 jari 37
2 26 Feb 07 jari 38     public int getColumnCount() {
2 26 Feb 07 jari 39         return 8;
2 26 Feb 07 jari 40     }
2 26 Feb 07 jari 41
2 26 Feb 07 jari 42     public int getRowCount() {
2 26 Feb 07 jari 43         return alterationRegions.length;
2 26 Feb 07 jari 44     }
2 26 Feb 07 jari 45
2 26 Feb 07 jari 46     public Object getValueAt(int row, int col) {
2 26 Feb 07 jari 47         switch(col){
2 26 Feb 07 jari 48             case 0:
2 26 Feb 07 jari 49                 return alterationRegions[row].getDataRegion().getName();
2 26 Feb 07 jari 50             case 1:
2 26 Feb 07 jari 51                 return new Integer(alterationRegions[row].getDataRegion().getChromosomeIndex() + 1);
2 26 Feb 07 jari 52             case 2:
2 26 Feb 07 jari 53                 return new Integer(alterationRegions[row].getDataRegion().getStart());
2 26 Feb 07 jari 54             case 3:
2 26 Feb 07 jari 55                 return new Integer(alterationRegions[row].getDataRegion().getStop());
2 26 Feb 07 jari 56             case 4:
2 26 Feb 07 jari 57                 return new Integer(alterationRegions[row].getNumDeletions());
2 26 Feb 07 jari 58             case 5:
2 26 Feb 07 jari 59                 return new Float(alterationRegions[row].getPercentDeleted());
2 26 Feb 07 jari 60             case 6:
2 26 Feb 07 jari 61                 return new Integer(alterationRegions[row].getNumAmplifications());
2 26 Feb 07 jari 62             case 7:
2 26 Feb 07 jari 63                 return new Float(alterationRegions[row].getPercentAmplified());
2 26 Feb 07 jari 64         }
2 26 Feb 07 jari 65         return null;
2 26 Feb 07 jari 66     }
2 26 Feb 07 jari 67
2 26 Feb 07 jari 68     public String getColumnName(int column){
2 26 Feb 07 jari 69         switch(column){
2 26 Feb 07 jari 70             case 0:
2 26 Feb 07 jari 71                 return "Name";
2 26 Feb 07 jari 72             case 1:
2 26 Feb 07 jari 73                 return "Chrom";
2 26 Feb 07 jari 74             case 2:
2 26 Feb 07 jari 75                 return "Start";
2 26 Feb 07 jari 76             case 3:
2 26 Feb 07 jari 77                 return "Stop";
2 26 Feb 07 jari 78             case 4:
2 26 Feb 07 jari 79                 return "# Deletions";
2 26 Feb 07 jari 80             case 5:
2 26 Feb 07 jari 81                 return "% Deleted";
2 26 Feb 07 jari 82             case 6:
2 26 Feb 07 jari 83                 return "# Amplfications";
2 26 Feb 07 jari 84             case 7:
2 26 Feb 07 jari 85                 return "% Amplified";
2 26 Feb 07 jari 86         }
2 26 Feb 07 jari 87         return null;
2 26 Feb 07 jari 88     }
2 26 Feb 07 jari 89     /*
2 26 Feb 07 jari 90     public String getColumnName(int col){
2 26 Feb 07 jari 91         return results.getHeaderAt(col);
2 26 Feb 07 jari 92     }
2 26 Feb 07 jari 93      */
2 26 Feb 07 jari 94     public Class getColumnClass(int c) {
2 26 Feb 07 jari 95         if(getValueAt(0, c) == null){
2 26 Feb 07 jari 96           return String.class;
2 26 Feb 07 jari 97         }else{
2 26 Feb 07 jari 98             return getValueAt(0, c).getClass();
2 26 Feb 07 jari 99         }
2 26 Feb 07 jari 100     }
2 26 Feb 07 jari 101
2 26 Feb 07 jari 102     public ICGHDataRegion getDataRegionAt(int index){
2 26 Feb 07 jari 103         return alterationRegions[index].getDataRegion();
2 26 Feb 07 jari 104     }
2 26 Feb 07 jari 105 }