<classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/plugin17"/>
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.USER_LIBRARY/Plugin.jar"/>
<classpathentry kind="output" path="classes"/>
</classpath>
*/
package jalview.bin;
-import java.awt.FlowLayout;
-import java.awt.Frame;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.BufferedReader;
import java.security.PermissionCollection;
import java.security.Permissions;
import java.security.Policy;
-import java.util.*;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Vector;
-import javax.swing.*;
-
-import jalview.gui.*;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
+import javax.swing.UIManager;
/**
* Main class for Jalview Application <br>
{
FeatureFetcher ff = startFeatureFetching(getFeatures);
if (ff != null)
+ {
while (!ff.allFinished() || af.operationInProgress())
{
// wait around until fetching is finished.
}
}
+ }
getFeatures = null; // have retrieved features - forget them now.
}
if (groovyscript != null)
System.out.println("Creating PNG image: " + file);
continue;
}
+ else if (format.equalsIgnoreCase("svg"))
+ {
+ File imageFile = new java.io.File(file);
+ imageName = imageFile.getName();
+ af.createSVG(imageFile);
+ System.out.println("Creating SVG image: " + file);
+ continue;
+ }
else if (format.equalsIgnoreCase("imgMap"))
{
af.createImageMap(new java.io.File(file), imageName);
JSONObject sequence = sequenceIter.next();
String sequcenceString = sequence.get("seq").toString();
Sequence seq = new Sequence(sequence.get("name").toString(),
- sequcenceString, 0, sequcenceString.length());
+ sequcenceString, Integer.valueOf(sequence.get("start")
+ .toString()), Integer.valueOf(sequence.get("end")
+ .toString()));
JSONArray jsonSeqArray = (JSONArray) sequence.get("features");
- SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(jsonSeqArray);
+ SequenceFeature[] retrievedSeqFeatures = getJalviewSequenceFeatures(
+ jsonSeqArray, seq);
if (retrievedSeqFeatures != null)
{
seq.setSequenceFeatures(retrievedSeqFeatures);
}
public SequenceFeature[] getJalviewSequenceFeatures(
- JSONArray jsonSeqFeatures)
+ JSONArray jsonSeqFeatures, Sequence seq)
{
SequenceFeature[] seqFeatures = null;
int count = 0;
Long begin = (Long) jsonFeature.get("xStart");
Long end = (Long) jsonFeature.get("xEnd");
String type = (String) jsonFeature.get("text");
-
// String color = (String) jsonFeature.get("fillColor");
- sequenceFeature.setBegin(begin.intValue());
- sequenceFeature.setEnd(end.intValue());
+ sequenceFeature.setBegin(seq.findPosition(begin.intValue()));
+ sequenceFeature.setEnd(seq.findPosition(end.intValue()) - 1);
sequenceFeature.setType(type);
seqFeatures[count++] = sequenceFeature;
}