1616import java .sql .Timestamp ;
1717import java .util .ArrayList ;
1818import java .util .Date ;
19- import java .util .StringTokenizer ;
2019
2120import javax .swing .ButtonGroup ;
2221import javax .swing .JButton ;
2322import javax .swing .JCheckBox ;
24- import javax .swing .JComponent ;
2523import javax .swing .JFileChooser ;
2624import javax .swing .JFrame ;
2725import javax .swing .JLabel ;
@@ -95,7 +93,7 @@ public class ScaleMatrixWindow extends JFrame implements ActionListener, Propert
9593 */
9694 class Task extends SwingWorker <Void , Void > {
9795 @ Override
98- public Void doInBackground () {
96+ public Void doInBackground () throws IOException {
9997 try {
10098 if (TABFiles .size () < 1 ) {
10199 JOptionPane .showMessageDialog (null , "No Files Loaded!!!" );
@@ -106,13 +104,25 @@ public Void doInBackground() {
106104 } else {
107105 // Check that all scaling numbers are valid
108106 boolean ALLNUM = true ;
109- for (int x = 0 ; x < TABFiles .size (); x ++) {
107+ if (rdbtnUniformScaling .isSelected ()) {
108+ System .out .println ("Uniform scaling factor check..." );
110109 try {
111- Double .parseDouble (expTable . getValueAt ( x , 1 ). toString ());
110+ Double .parseDouble (txtUniform . getText ());
112111 } catch (NumberFormatException e ) {
113- JOptionPane .showMessageDialog (null , TABFiles . get ( x ). getName () + " possesses an invalid scaling factor!!!" );
112+ JOptionPane .showMessageDialog (null , "Uniform scaling value an invalid scaling factor (" + txtUniform . getText () + ") !!!" );
114113 ALLNUM = false ;
115114 }
115+ } else {
116+ System .out .println ("File-sspecific scaling factor check..." );
117+ for (int x = 0 ; x < TABFiles .size (); x ++) {
118+ System .out .println (x );
119+ try {
120+ Double .parseDouble (expTable .getValueAt (x , 1 ).toString ());
121+ } catch (NumberFormatException e ) {
122+ JOptionPane .showMessageDialog (null , TABFiles .get (x ).getName () + " possesses an invalid scaling factor (" + expTable .getValueAt (x , 1 ) + ") !!!" );
123+ ALLNUM = false ;
124+ }
125+ }
116126 }
117127 // Loop through matrix files with valid scaling factors
118128 if (ALLNUM ) {
@@ -138,7 +148,7 @@ public Void doInBackground() {
138148 SCALE = Double .parseDouble (expTable .getValueAt (x , 1 ).toString ());
139149 }
140150 // Initialize LogItem
141- String command = ScaleMatrixCLI .getCLIcommand (XTAB , OUT_FILEPATH , SCALE , Integer .parseInt (txtRow .getText ()), Integer .parseInt (txtCol .getText ()));
151+ String command = ScaleMatrixCLI .getCLIcommand (XTAB , OUT_FILEPATH , SCALE , Integer .parseInt (txtRow .getText ()), Integer .parseInt (txtCol .getText ()), chckbxGzipOutput . isSelected () );
142152 LogItem new_li = new LogItem (command );
143153 firePropertyChange ("log" , old_li , new_li );
144154 // Execute script
@@ -209,8 +219,7 @@ public boolean isCellEditable(int row, int column) {
209219 }
210220 };
211221 JTable tableScale = new JTable (expTable );
212- // Allow for the selection of multiple OR individual cells across either rows or
213- // columns
222+ // Allow for the selection of multiple OR individual cells across either rows or columns
214223 tableScale .setCellSelectionEnabled (true );
215224 tableScale .setColumnSelectionAllowed (true );
216225 tableScale .setRowSelectionAllowed (true );
0 commit comments