From 86b168f1762ac351594a3bb6409774931e705319 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Wed, 17 Jun 2020 13:49:24 +0100 Subject: [PATCH] JAL-3662 JAL-3660 JAL-3561 source formatting --- src/jalview/bin/Jalview.java | 73 +++++++++++++++++++++++------------------- 1 file changed, 40 insertions(+), 33 deletions(-) diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index b8aa928..4f76776 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -981,8 +981,7 @@ public class Jalview implements ApplicationSingletonI * @param aparser * @param format */ - private void createOutputFiles(ArgsParser aparser, - FileFormatI format) + private void createOutputFiles(ArgsParser aparser, FileFormatI format) { AlignFrame af = currentAlignFrame; while (aparser.getSize() >= 2) @@ -1037,37 +1036,45 @@ public class Jalview implements ApplicationSingletonI "Creating image map: " + imageFile.getAbsolutePath()); continue; default: - // fall through - try to parse as an alignment data export format - FileFormatI outFormat=null; - try { - outFormat = FileFormats.getInstance().forName(outputFormat); - } catch (Exception formatP) { - } - if (outFormat==null) { - System.out.println("Couldn't parse "+outputFormat+" as a valid Jalview format string."); - continue; - } - if (!outFormat.isWritable()) - { - System.out.println( - "This version of Jalview does not support alignment export as " - + outputFormat); - continue; - } - // record file as it was passed to Jalview so it is recognisable to the CLI caller - String file; - fname = new File(file=aparser.nextValue()).getAbsolutePath(); - // JBPNote - yuck - really wish we did have a bean returned from this which gave success/fail like before ! - af.saveAlignment(fname, outFormat); - if (!af.isSaveAlignmentSuccessful()) - { - System.out.println("Written alignment in " + outputFormat - + " format to " + file); - continue; - } else { - System.out.println("Error writing file " + file + " in " - + outputFormat + " format!!"); - } + // fall through - try to parse as an alignment data export format + FileFormatI outFormat = null; + try + { + outFormat = FileFormats.getInstance().forName(outputFormat); + } catch (Exception formatP) + { + } + if (outFormat == null) + { + System.out.println("Couldn't parse " + outputFormat + + " as a valid Jalview format string."); + continue; + } + if (!outFormat.isWritable()) + { + System.out.println( + "This version of Jalview does not support alignment export as " + + outputFormat); + continue; + } + // record file as it was passed to Jalview so it is recognisable to the CLI + // caller + String file; + fname = new File(file = aparser.nextValue()).getAbsolutePath(); + // JBPNote - yuck - really wish we did have a bean returned from this which gave + // success/fail like before ! + af.saveAlignment(fname, outFormat); + if (!af.isSaveAlignmentSuccessful()) + { + System.out.println("Written alignment in " + outputFormat + + " format to " + file); + continue; + } + else + { + System.out.println("Error writing file " + file + " in " + + outputFormat + " format!!"); + } } } // ??? Should report - 'ignoring' extra args here... -- 1.7.10.2