mev-4.0.01/source/org/tigr/microarray/util/swing/ExpressionFileView.java

Code
Comments
Other
Rev Date Author Line
2 26 Feb 07 jari 1 /*
2 26 Feb 07 jari 2 Copyright @ 1999-2003, The Institute for Genomic Research (TIGR).
2 26 Feb 07 jari 3 All rights reserved.
2 26 Feb 07 jari 4 */
2 26 Feb 07 jari 5 /*
2 26 Feb 07 jari 6  * $RCSfile: ExpressionFileView.java,v $
2 26 Feb 07 jari 7  * $Revision: 1.2 $
2 26 Feb 07 jari 8  * $Date: 2006/02/23 20:59:59 $
2 26 Feb 07 jari 9  * $Author: caliente $
2 26 Feb 07 jari 10  * $State: Exp $
2 26 Feb 07 jari 11  */
2 26 Feb 07 jari 12 package org.tigr.microarray.util.swing;
2 26 Feb 07 jari 13
2 26 Feb 07 jari 14 import java.io.File;
2 26 Feb 07 jari 15
2 26 Feb 07 jari 16 import javax.swing.Icon;
2 26 Feb 07 jari 17 import javax.swing.ImageIcon;
2 26 Feb 07 jari 18 import javax.swing.filechooser.FileView;
2 26 Feb 07 jari 19
2 26 Feb 07 jari 20 import org.tigr.util.swing.Utils;
2 26 Feb 07 jari 21
2 26 Feb 07 jari 22 public class ExpressionFileView extends FileView {
2 26 Feb 07 jari 23     Icon ExpressionIcon = new ImageIcon(org.tigr.microarray.util.swing.ExpressionFileView.class.getResource("/org/tigr/images/GeneIcon.gif"));
2 26 Feb 07 jari 24     
2 26 Feb 07 jari 25     public String getName(File f) {
2 26 Feb 07 jari 26   return null; // let the L&F FileView figure this out
2 26 Feb 07 jari 27     }
2 26 Feb 07 jari 28     
2 26 Feb 07 jari 29     public String getDescription(File f) {
2 26 Feb 07 jari 30   return null; // let the L&F FileView figure this out
2 26 Feb 07 jari 31     }
2 26 Feb 07 jari 32     
2 26 Feb 07 jari 33     public Boolean isTraversable(File f) {
2 26 Feb 07 jari 34   return null; // let the L&F FileView figure this out
2 26 Feb 07 jari 35     }
2 26 Feb 07 jari 36     
2 26 Feb 07 jari 37     public String getTypeDescription(File f) {
2 26 Feb 07 jari 38   String extension = Utils.getExtension(f);
2 26 Feb 07 jari 39   String type = null;
2 26 Feb 07 jari 40   
2 26 Feb 07 jari 41   if (extension != null) {
2 26 Feb 07 jari 42       if (extension.equals(Utils.txt)) {
2 26 Feb 07 jari 43     type = "Expression file";
2 26 Feb 07 jari 44       }
2 26 Feb 07 jari 45   }
2 26 Feb 07 jari 46   return type;
2 26 Feb 07 jari 47     }
2 26 Feb 07 jari 48     
2 26 Feb 07 jari 49     public Icon getIcon(File f) {
2 26 Feb 07 jari 50   String extension = Utils.getExtension(f);
2 26 Feb 07 jari 51   Icon icon = null;
2 26 Feb 07 jari 52   if (extension != null) {
2 26 Feb 07 jari 53       if (extension.equals(Utils.txt)) {
2 26 Feb 07 jari 54     icon = ExpressionIcon;
2 26 Feb 07 jari 55       }
2 26 Feb 07 jari 56   }
2 26 Feb 07 jari 57   return icon;
2 26 Feb 07 jari 58     }
2 26 Feb 07 jari 59 }