- if(file!=null)
- {
- System.out.println("Opening file: " + file);
-
- if (!file.startsWith("http://"))
- {
- if (! (new java.io.File(file)).exists())
- {
- System.out.println("Can't find " + file);
- if(headless)
- System.exit(1);
- }
- }
-
- protocol = "File";
-
- if (file.indexOf("http:") > -1 || file.indexOf("file:") >-1)
- {
- protocol = "URL";
- }
-
-
-
- if (file.endsWith(".jar"))
- format = "Jalview";
- else
- format = new jalview.io.IdentifyFile().Identify(file, protocol);
-
-
-
- AlignFrame af = fileLoader.LoadFileWaitTillLoaded(file, protocol, format);
-
- if(af==null)
- {
- System.out.println("error");
- return;
- }
-
- data = aparser.getValue("colour");
- if(data!=null)
- {
- data.replaceAll("%20", " ");
-
- jalview.schemes.ColourSchemeI cs =
- jalview.schemes.ColourSchemeProperty.getColour(af.getViewport().
- getAlignment(), data);
-
- if(cs == null)
- {
- jalview.schemes.UserColourScheme ucs
- = new jalview.schemes.UserColourScheme("white");
- ucs.parseAppletParameter(data);
- cs = ucs;
- }
-
- System.out.println("colour is " + data);
- af.changeColour( cs );
- }
-
-
- // Must maintain ability to use the groups flag
- data = aparser.getValue("groups");
- if (data != null)
- {
- af.parseFeaturesFile(data, protocol);
- System.out.println("Added "+data);
- }
- data = aparser.getValue("features");
- if (data != null)
- {
- af.parseFeaturesFile(data, protocol);
- System.out.println("Added "+data);
- }
-
- data = aparser.getValue("annotations");
- if (data != null)
- {
- af.loadJalviewDataFile(data);
- System.out.println("Added "+data);
- }
-
-
- String imageName = "unnamed.png";
- while (aparser.getSize() > 1)
- {
- format = aparser.nextValue();
- file = aparser.nextValue();
-
- if (format.equalsIgnoreCase("png"))
- {
- af.createPNG(new java.io.File(file));
- imageName = (new java.io.File(file)).getName();
- System.out.println("Creating PNG image: " + file);
- continue;
- }
- else if (format.equalsIgnoreCase("imgMap"))
- {
- af.createImageMap(new java.io.File(file), imageName);
- System.out.println("Creating image map: " + file);
- continue;
- }
- else if (format.equalsIgnoreCase("eps"))
- {
- System.out.println("Creating EPS file: " + file);
- af.createEPS(new java.io.File(file));
- continue;
- }
-
- if (af.saveAlignment(file, format))
- System.out.println("Written alignment in " + format +
- " format to " + file);
- else
- System.out.println("Error writing file " + file + " in " + format +
- " format!!");
-
- }
-
- while (aparser.getSize() > 0)
- {
- System.out.println("Unknown arg: " + aparser.nextValue());
- }
- }
+ if (format.equalsIgnoreCase("png"))
+ {
+ af.createPNG(new java.io.File(file));
+ imageName = (new java.io.File(file)).getName();
+ System.out.println("Creating PNG image: " + file);
+ continue;
+ }
+ else if (format.equalsIgnoreCase("imgMap"))
+ {
+ af.createImageMap(new java.io.File(file), imageName);
+ System.out.println("Creating image map: " + file);
+ continue;
+ }
+ else if (format.equalsIgnoreCase("eps"))
+ {
+ System.out.println("Creating EPS file: " + file);
+ af.createEPS(new java.io.File(file));
+ continue;
+ }