X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fbin%2FJalview.java;h=e184db7936bb9ed02579b74b30c8dbddea2d1b35;hb=e826e3b91cf0c0e00227f967c608e994861eca94;hp=bca50510d7308144a564c67b877179b1b2d1e934;hpb=da53a3eaf1e5c06ff6a2506b7b603086293a887e;p=jalview.git diff --git a/src/jalview/bin/Jalview.java b/src/jalview/bin/Jalview.java index bca5051..e184db7 100755 --- a/src/jalview/bin/Jalview.java +++ b/src/jalview/bin/Jalview.java @@ -1,6 +1,6 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) - * Copyright (C) 2014 The Jalview Authors + * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$) + * Copyright (C) $$Year-Rel$$ The Jalview Authors * * This file is part of Jalview. * @@ -22,6 +22,8 @@ package jalview.bin; import jalview.gui.AlignFrame; import jalview.gui.Desktop; +import jalview.io.BioJsHTMLOutput; +import jalview.io.HtmlSvgOutput; import jalview.util.MessageManager; import jalview.util.Platform; import jalview.ws.jws2.Jws2Discoverer; @@ -44,11 +46,12 @@ import java.security.CodeSource; import java.security.PermissionCollection; import java.security.Permissions; import java.security.Policy; -import java.util.Hashtable; +import java.util.HashMap; import java.util.Map; import java.util.Vector; import javax.swing.UIManager; +import javax.swing.UnsupportedLookAndFeelException; /** * Main class for Jalview Application
@@ -79,11 +82,6 @@ public class Jalview } /** - * Put protein=true for get a protein example - */ - private static boolean protein = false; - - /** * main class for Jalview application * * @param args @@ -96,12 +94,6 @@ public class Jalview System.out.println(System.getProperty("os.arch") + " " + System.getProperty("os.name") + " " + System.getProperty("os.version")); - if (new Platform().isAMac()) - { - System.setProperty("com.apple.mrj.application.apple.menu.about.name", - "Jalview"); - System.setProperty("apple.laf.useScreenMenuBar", "true"); - } ArgsParser aparser = new ArgsParser(args); boolean headless = false; @@ -177,6 +169,21 @@ public class Jalview } catch (Exception ex) { } + if (new Platform().isAMac()) + { + System.setProperty("com.apple.mrj.application.apple.menu.about.name", + "Jalview"); + System.setProperty("apple.laf.useScreenMenuBar", "true"); + try + { + UIManager.setLookAndFeel(ch.randelshofer.quaqua.QuaquaManager + .getLookAndFeel()); + } catch (UnsupportedLookAndFeelException e) + { + // TODO Auto-generated catch block + e.printStackTrace(); + } + } if (!headless) { @@ -218,6 +225,9 @@ public class Jalview desktop.checkForNews(); } + BioJsHTMLOutput bjs = new BioJsHTMLOutput(null, null); + bjs.updateBioJS(); + String file = null, protocol = null, format = null, data = null; jalview.io.FileLoader fileLoader = new jalview.io.FileLoader(); Vector getFeatures = null; // vector of das source nicknames to fetch @@ -402,6 +412,10 @@ public class Jalview { af.getViewport().setSortByTree(true); } + if (aparser.contains("no-annotation")) + { + af.getViewport().setShowAnnotation(false); + } if (aparser.contains("nosortbytree")) { af.getViewport().setSortByTree(false); @@ -489,6 +503,14 @@ public class Jalview System.out.println("Creating SVG image: " + file); continue; } + else if (format.equalsIgnoreCase("html")) + { + File imageFile = new java.io.File(file); + imageName = imageFile.getName(); + new HtmlSvgOutput(new java.io.File(file), af.alignPanel); + System.out.println("Creating HTML image: " + file); + continue; + } else if (format.equalsIgnoreCase("imgMap")) { af.createImageMap(new java.io.File(file), imageName); @@ -527,8 +549,7 @@ public class Jalview // //////////////////// if (!headless && file == null && vamsasImport == null - && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true) - && protein == true) + && jalview.bin.Cache.getDefault("SHOW_STARTUP_FILE", true)) { file = jalview.bin.Cache.getDefault( "STARTUP_FILE", @@ -621,6 +642,8 @@ public class Jalview + "-blc FILE\tCreate alignment file FILE in BLC format.\n" + "-jalview FILE\tCreate alignment file FILE in Jalview format.\n" + "-png FILE\tCreate PNG image FILE from alignment.\n" + + "-svg FILE\tCreate SVG image FILE from alignment.\n" + + "-html FILE\tCreate HTML file from alignment.\n" + "-imgMap FILE\tCreate HTML file FILE with image map of PNG image.\n" + "-eps FILE\tCreate EPS file FILE from alignment.\n" + "-questionnaire URL\tQueries the given URL for information about any Jalview user questionnaires.\n" @@ -784,7 +807,7 @@ public class Jalview * = new Binding(); binding.setVariable("input", "world"); * gse.run("hello.groovy", binding); */ - Class[] bspec; + Class[] bspec; Object[] binding; int blen = ((jalviewContext[0] == null) ? 0 : 1) + ((jalviewContext[1] == null) ? 0 : 1); @@ -794,7 +817,7 @@ public class Jalview binding = new Object[blen * 2]; blen = 0; ClassLoader cl = null; - Map vbinding = new Hashtable(); + Map vbinding = new HashMap(); for (int jc = 0; jc < jalviewContext.length; jc++) { if (jalviewContext[jc] != null) @@ -811,8 +834,8 @@ public class Jalview blen++; } } - Class gbindingc = cl.loadClass("groovy.lang.Binding"); - Constructor gbcons; + Class gbindingc = cl.loadClass("groovy.lang.Binding"); + Constructor gbcons; Object gbinding; try { @@ -822,15 +845,15 @@ public class Jalview { // old style binding config - using series of string/object values to // setVariable. - gbcons = gbindingc.getConstructor(null); - gbinding = gbcons.newInstance(null); + gbcons = gbindingc.getConstructor(); + gbinding = gbcons.newInstance(); java.lang.reflect.Method setvar = gbindingc.getMethod( "setVariable", bspec); setvar.invoke(gbinding, binding); } - ; - Class gsec = cl.loadClass("groovy.util.GroovyScriptEngine"); - Constructor gseccons = gsec.getConstructor(new Class[] + + Class gsec = cl.loadClass("groovy.util.GroovyScriptEngine"); + Constructor gseccons = gsec.getConstructor(new Class[] { URL[].class }); // String[].class }); Object gse = gseccons.newInstance(new Object[] { new URL[] @@ -930,7 +953,7 @@ public class Jalview private static FeatureFetcher startFeatureFetching(final Vector dasSources) { FeatureFetcher ff = new FeatureFetcher(); - AlignFrame afs[] = Desktop.getAlignframes(); + AlignFrame afs[] = Desktop.getAlignFrames(); if (afs == null || afs.length == 0) { return null;