package DataLoader; //----------------------------------------------------------------------------------------------- import SBEAMS.*; import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import javax.swing.border.*; import java.util.regex.*; import java.text.DecimalFormat; import java.util.List; import java.util.Hashtable; import java.util.Enumeration; import java.util.Map; import java.util.TreeMap; import java.util.Vector; import java.util.EventListener; import java.util.Date; import java.util.Calendar; import java.util.GregorianCalendar; import java.io.*; import javax.swing.table.TableCellRenderer; import javax.swing.table.TableColumn; import javax.swing.table.TableColumnModel; //----------------------------------------------------------------------------------------------- public class ConditionInfoWizardPanel extends WizardPanel implements ActionListener, KeyListener, MouseListener{ //----------------------------------------------------------------------------------------------- private static DecimalFormat twoDigits = new DecimalFormat("00"); private JComboBox variableNames; private JComboBox unitsNames; private SBEAMSClient sc; private JList conditionList; private JScrollPane variableList; private JScrollPane variableSummary; private VariableTable variableTable; private Hashtable condData; private Hashtable varsAndUnits; private static String VARIABLE_SELECTED = "variable_selected"; private static String UNIT_SELECTED = "unit_selected"; private static String OTHER = "Other..."; private static String ADD = "Add"; private static String POPUP = "Popup"; private static String REMOVE = "Remove Last"; private static String RENAME = "Rename Conditions"; private int currentVariableIndex; private static String schemaFile = "sbeamsIndirect://db/sbeams/tmp/Microarray/dataLoader/experiment.xsd"; //----------------------------------------------------------------------------------------------- public ConditionInfoWizardPanel(WizardContext wc) { setWizardContext(wc); condData = (Hashtable)wizardContext.getAttribute(WIZARD_HASH_CONDITIONS); setLayout(new BorderLayout()); setBorder(new TitledBorder("Step 4. Describe the Variables in this Experiment")); //------- Buttons Panel -------// JPanel allButtonsPanel = new JPanel(new BorderLayout()); JButton renameButton = new JButton (RENAME); renameButton.setActionCommand(RENAME); renameButton.addActionListener(this); allButtonsPanel.add(renameButton, BorderLayout.WEST); JPanel inputPanel = new JPanel(new FlowLayout()); JLabel name = new JLabel ("Variable Name: "); JLabel unitsLabel = new JLabel ("Units: "); final JButton addButton = new JButton (ADD); addButton.setActionCommand(ADD); addButton.setMnemonic(KeyEvent.VK_ENTER); addButton.addActionListener(this); addButton.addKeyListener(this); // variableUnitsField.addKeyListener(this); final JButton removeButton = new JButton(REMOVE); removeButton.setActionCommand(REMOVE); removeButton.addActionListener(this); // Get variables/units defined in the XML document. Vector[] varData = getVariableDataFromExperimentXSD(schemaFile); // Get variables/units that were chosen in the constants file Vector wizConstants = (Vector)wizardContext.getAttribute(WIZARD_CONSTANTS); varsAndUnits = new Hashtable(); if (wizConstants != null) { for (int m=0;m"); Pattern varValue = Pattern.compile(""); Pattern end = Pattern.compile(""); Pattern unitStart = Pattern.compile(""); Pattern unitValue = Pattern.compile(""); Pattern unitEnd = Pattern.compile(""); for (int m=0;m