public void openConfig ( String path ) { Properties properties = new Properties ( ) ; try { properties . load ( new FileInputStream ( path ) ) ; } catch ( IOException ex ) { JOptionPane . showMessageDialog ( this , "Problems reading the properties file" , "Error" , JOptionPane . ERROR_MESSAGE ) ; } // read datasets this . jTextFieldProcess . setText ( properties . getProperty ( "processors" ) ) ; this . jTextFieldTask . setText ( properties . getProperty ( "task" ) ) ; try { this . currentTask = ( MainTask ) ClassOption . cliStringToObject ( this . jTextFieldTask . getText ( ) , MainTask . class , null ) ; } catch ( Exception ex ) { Logger . getLogger ( TaskManagerTabPanel . class . getName ( ) ) . log ( Level . SEVERE , null , ex ) ; } this . jTextFieldDir . setText ( properties . getProperty ( "ResultsDir" ) ) ; this . resultsPath = this . jTextFieldDir . getText ( ) ; String [ ] streamShortNames = properties . getProperty ( "streamShortNames" ) . split ( "," ) ; String [ ] streamCommand = properties . getProperty ( "streamCommand" ) . split ( "," ) ; String [ ] algShortNames = properties . getProperty ( "algorithmShortNames" ) . split ( "," ) ; String [ ] algorithmCommand = properties . getProperty ( "algorithmCommand" ) . split ( "," ) ; cleanTables ( ) ; for ( int i = 0 ; i < streamShortNames . length ; i ++ ) { this . streamModel . addRow ( new Object [ ] { streamCommand [ i ] , streamShortNames [ i ] } ) ; } for ( int i = 0 ; i < algShortNames . length ; i ++ ) { this . algoritmModel . addRow ( new Object [ ] { algorithmCommand [ i ] , algShortNames [ i ] } ) ; } }
Opens a previously saved configuration