X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fbin%2FJalview.java;h=f59c37f16cae5d38c3848d231c4e168a08e9f57c;hb=4dd96dd41cb37178a6dc0298ce08c8bfcdfab715;hp=a67c5fddd29e96a9854b6172079a7957ea6b151e;hpb=5cf94f83009efb72e7206393db4ba5b6ddd41936;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index a67c5fd..f59c37f 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -20,6 +20,7 @@ */ package jalview.bin; +import jalview.api.AlignCalcWorkerI; import jalview.api.AlignFrameI; import jalview.api.AlignViewportI; import jalview.api.JalviewApp; @@ -145,6 +146,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi private boolean noCalculation, noMenuBar, noStatus; + private boolean noAnnotation; + public boolean getStartCalculations() { return !noCalculation; @@ -160,6 +163,10 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi return !noStatus; } + public boolean getShowAnnotation() + { + return !noAnnotation; + } public static AlignFrame getCurrentAlignFrame() { @@ -279,7 +286,11 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi { boolean isJS = Platform.isJS(); - if (!isJS) + if (isJS) + { + Platform.setAppClass(this); + } + else { System.setSecurityManager(null); } @@ -294,6 +305,15 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi String usrPropsFile = aparser.getValue(ArgsParser.PROPS); Cache.loadProperties(usrPropsFile); + + if (aparser.contains(ArgsParser.NODISPLAY) + || aparser.contains(ArgsParser.NOGUI) + || aparser.contains(ArgsParser.HEADLESS) + || "true".equals(System.getProperty("java.awt.headless"))) + { + headless = true; + } + if (isJS) { isJavaAppletTag = aparser.isApplet(); @@ -325,13 +345,7 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi showUsage(); System.exit(0); } - if (aparser.contains(ArgsParser.NODISPLAY) - || aparser.contains(ArgsParser.NOGUI) - || aparser.contains(ArgsParser.HEADLESS) - || "true".equals(System.getProperty("java.awt.headless"))) - { - headless = true; - } + // anything else! @@ -387,7 +401,13 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi try { - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + if (!isJS && Platform.isWin()) + { + UIManager.setLookAndFeel( + headless ? "javax.swing.plaf.metal.MetalLookAndFeel" + : UIManager.getSystemLookAndFeelClassName()); +// UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName()); + } } catch (Exception ex) { System.err.println("Unexpected Look and Feel Exception"); @@ -630,14 +650,6 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi // TODO ? } - if (aparser.contains(ArgsParser.SHOWOVERVIEW)) - { - jalview.bin.Cache.setPropertyNoSave(Preferences.SHOW_OVERVIEW, - "true"); - - System.out.println("CMD [showoverview] executed successfully!"); - } - if (aparser.contains(ArgsParser.NOMENUBAR)) { noMenuBar = true; @@ -650,6 +662,12 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi System.out.println("CMD [nostatus] executed successfully!"); } + if (aparser.contains(ArgsParser.NOANNOTATION) + || aparser.contains(ArgsParser.NOANNOTATION2)) + { + noAnnotation = true; + System.out.println("CMD no-annotation executed successfully!"); + } if (aparser.contains(ArgsParser.NOCALCULATION)) { noCalculation = true; @@ -741,6 +759,13 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi System.out.println( "CMD [-annotations " + data + "] executed successfully!"); } + + if (aparser.contains(ArgsParser.SHOWOVERVIEW)) + { + af.overviewMenuItem_actionPerformed(null); + System.out.println("CMD [showoverview] executed successfully!"); + } + // set or clear the sortbytree flag. if (aparser.contains(ArgsParser.SORTBYTREE)) { @@ -750,18 +775,30 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi System.out.println("CMD [-sortbytree] executed successfully!"); } } - + boolean doUpdateAnnotation = false; - - if (aparser.contains(ArgsParser.NOANNOTATION) - || aparser.contains(ArgsParser.NOANNOTATION2)) + /** + * we do this earlier in JalviewJS because of a complication with + * SHOWOVERVIEW + * + * For now, just fixing this in JalviewJS. + * + * + * @j2sIgnore + * + */ { - af.getViewport().setShowAnnotation(false); - if (!af.getViewport().isShowAnnotation()) + if (aparser.contains(ArgsParser.NOANNOTATION) + || aparser.contains(ArgsParser.NOANNOTATION2)) { - doUpdateAnnotation = true; - System.out.println("CMD no-annotation executed successfully!"); + af.getViewport().setShowAnnotation(false); + if (!af.getViewport().isShowAnnotation()) + { + doUpdateAnnotation = true; + System.out + .println("CMD no-annotation executed successfully!"); + } } } if (aparser.contains(ArgsParser.NOSORTBYTREE)) @@ -821,11 +858,11 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi + "] executed successfully!"); groovyscript = null; } - checkOutputFile(aparser, af, format); - while (aparser.getSize() > 0) - { - System.out.println("Unknown arg: " + aparser.nextValue()); - } + } + checkOutputFile(aparser, af, format); + while (aparser.getSize() > 0) + { + System.out.println("Unknown arg: " + aparser.nextValue()); } } } @@ -1015,6 +1052,8 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi // biojsmsa filename String outputFormat = aparser.nextValue(); String file = aparser.nextValue(); + System.out.println("format " + outputFormat); + if (outputFormat.equalsIgnoreCase("png")) { af.createPNG(new File(file)); @@ -2016,5 +2055,17 @@ public class Jalview implements ApplicationSingletonI, JalviewJSApi } + @Override + public void showOverview() + { + currentAlignFrame.overviewMenuItem_actionPerformed(null); + } + + public void notifyWorker(AlignCalcWorkerI worker, String status) + { + // System.out.println("Jalview worker " + worker.getClass().getSimpleName() + // + " " + status); + } } +