/* Copyright @ 2003, The Institute for Genomic Research (TIGR). All rights reserved. */ /*************************************************************************** * Author: Jerry Li * Name: GenePixPanel (Version 1.0) * Date: Created: 04/02/2003 and modified: 05/15/2003 * Descp: the interface for GenePix output file as input for the ExpressConveter ***************************************************************************/ package org.tigr.microarray.converter; import java.awt.GridBagLayout; import java.awt.Dimension; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import java.io.File; import java.util.Vector; import java.util.StringTokenizer; import javax.swing.border.BevelBorder; import javax.swing.event.ListSelectionListener; import javax.swing.event.ListSelectionEvent; import javax.swing.JCheckBox; import javax.swing.JFileChooser; import javax.swing.JLabel; import javax.swing.JList; import javax.swing.JPanel; import javax.swing.JRadioButton; import javax.swing.JSplitPane; import javax.swing.JScrollPane; import javax.swing.ListSelectionModel; import org.tigr.util.io.IOUtil; import org.tigr.util.awt.GBA; import org.tigr.util.LongTextChanger; public class GenePixPanel extends ConvertPanel { private JScrollPane gFilesSP; private JCheckBox keepAllCB; private boolean keepAll; private JList gFileList; public GenePixPanel(ExpressConverter ec) { super(ec); keepAll = false; createGUI(); } /*************************************************************************** * Description: * removes a set of files from the selected list. ***************************************************************************/ public void removeFileFromList(){ int addrs[], i, indx; addrs = gFileList.getSelectedIndices(); if(addrs.length > 0){ for(i=0; i 0){ gOutputFileList.setSelectedIndex(0); } gFileNumLB.setText(NUM_FILE + selectedFiles.size()); } } /**************************************************************************** * Description: * set the interface to its original status. **************************************************************************/ public void reset(){ selectedFiles.removeAllElements(); outputFileNames.removeAllElements(); gFileNumLB.setText(NUM_FILE); gFileList.setListData(selectedFiles); gOutputFileList.setListData(outputFileNames); wantSort = true; keepAll = false; outputReady = false; sortCB.setSelected(wantSort); keepAllCB.setSelected(keepAll); parent.activateButton(outputReady, outputReady); } /*************************************************************************** * Description: * places the selected file names to both genepix and output file lists. **************************************************************************/ public void setSelectedFiles(String[] newFiles){ int num, i; String temp = new String(""); num = newFiles.length; for(i=0; iDescription: * alters the interface to meet the requirement for output file type. *

Parameter: *
index -- the selected index of the combobox. ***************************************************************************/ public void adjustGUI(int index){ int numFiles; String tmpName = new String(""); outputType = index; if(outputType == TAV_OUT){ gOutputFileLB.setText(TAV_FILE); keepAllCB.setEnabled(true); this.activeIntensityWay(false); } else { gOutputFileLB.setText(MEV_FILE); keepAllCB.setEnabled(false); this.activeIntensityWay(true); } numFiles = outputFileNames.size(); for(int i=0; iDescription: * changes the number of input and output files based on testing on the * system to see if an exsiting file is to be overwritten. *

Paramters: *
inFiles -- the input files. *
outFiles -- the output files. ***************************************************************************/ public void changeFileList(Vector inFiles, Vector outFiles){ selectedFiles = inFiles; outputFileNames = outFiles; gFileList.setListData(inFiles); gOutputFileList.setListData(outFiles); gFileNumLB.setText(NUM_FILE + selectedFiles.size()); } public Vector getOutputFileNames() { return outputFileNames; } public Vector getSelectedFiles() { return selectedFiles; } public boolean isOutputReady() { return outputReady; } public boolean keepAllInformation() { return keepAll; } /***************************************************************************** * Description: * create a GUI for program ****************************************************************************/ protected void createGUI(){ this.setLayout(new GridBagLayout()); gInputFileLB = new JLabel("GenePix Files:"); gFileList = new JList(); gFileList.setBorder(gLow); actionHandler(gFileList); actionHandler(gOutputFileList); gFilesSP = new JScrollPane(gFileList); keepAllCB = new JCheckBox("Keep All Information in the GenePix Files."); keepAllCB.setToolTipText("Attach all anotation info at the end."); keepAllCB.setSelected(keepAll); keepAllCB.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent ce){ if(keepAllCB.isSelected()){ keepAll = true; } else { keepAll = false; } } }); gba.add(this, gFileSplitPane, 0, 0, 2, 1, 1, 1, GBA.B, GBA.C, 5, 5, 10, 5); gba.add(this, sortCB, 0, 1, 1, 1, 1, 0, GBA.H, GBA.C, 10, 15, 3, 5); gba.add(this, keepAllCB, 0, 2, 1, 1, 1, 0, GBA.H, GBA.C, 3, 15, 3, 5); gba.add(this, gIntenPanel, 1, 1, 1, 2, 1, 0, GBA.H, GBA.W, 10, 0, 3, 5); gba.add(gInputPL, gInputFileLB, 0, 0, 1, 1, 1, 0, GBA.H, GBA.C, 5, 10, 5, 2); gba.add(gInputPL, gFilesSP, 0, 1, 1, 1, 1, 1, GBA.B, GBA.C, 1, 2, 5, 2); } }