@ Override public void actionPerformed ( ActionEvent e ) { if ( e . getSource ( ) == pcRadio || e . getSource ( ) == customFileRadio || e . getSource ( ) == customURLRadio ) { pcCombo . setEnabled ( pcRadio . isSelected ( ) ) ; modelField . setEnabled ( customFileRadio . isSelected ( ) ) ; loadButton . setEnabled ( customFileRadio . isSelected ( ) ) ; urlField . setEnabled ( customURLRadio . isSelected ( ) ) ; } else if ( e . getSource ( ) == loadButton ) { String current = modelField . getText ( ) ; String initial = current . trim ( ) . length ( ) > 0 ? current : "." ; JFileChooser fc = new JFileChooser ( initial ) ; fc . setFileFilter ( new FileNameExtensionFilter ( "BioPAX file (*.owl)" , "owl" ) ) ; if ( fc . showOpenDialog ( this ) == JFileChooser . APPROVE_OPTION ) { File file = fc . getSelectedFile ( ) ; modelField . setText ( file . getPath ( ) ) ; } } else if ( e . getSource ( ) == patternCombo ) { Miner m = ( Miner ) patternCombo . getSelectedItem ( ) ; descArea . setText ( m . getDescription ( ) ) ; // Update output file name String text = outputField . getText ( ) ; if ( text . contains ( "/" ) ) text = text . substring ( 0 , text . lastIndexOf ( "/" ) + 1 ) ; else text = "" ; text += m . getName ( ) + ".txt" ; outputField . setText ( text ) ; } else if ( e . getSource ( ) == runButton ) { run ( ) ; } checkRunButton ( ) ; }
Performs interactive operations .