*/
package jalview.gui;
-import java.awt.Rectangle;
-import java.io.BufferedReader;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStreamReader;
-import java.io.OutputStreamWriter;
-import java.io.PrintWriter;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.IdentityHashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.Vector;
-import java.util.jar.JarEntry;
-import java.util.jar.JarInputStream;
-import java.util.jar.JarOutputStream;
-
-import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
-import javax.swing.SwingUtilities;
-
-import org.exolab.castor.xml.Marshaller;
-import org.exolab.castor.xml.Unmarshaller;
-
+import jalview.analysis.AlignSeq;
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.datamodel.AlignedCodonFrame;
import jalview.datamodel.StructureViewerModel.StructureData;
import jalview.ext.varna.RnaModel;
import jalview.gui.StructureViewer.ViewerType;
+import jalview.io.AppletFormatAdapter;
import jalview.schemabinding.version2.AlcodMap;
import jalview.schemabinding.version2.AlcodonFrame;
import jalview.schemabinding.version2.Annotation;
import jalview.schemes.UserColourScheme;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
+import jalview.util.Comparison;
+import jalview.util.MapList;
import jalview.util.MessageManager;
import jalview.util.Platform;
import jalview.util.jarInputStreamProvider;
import jalview.ws.params.AutoCalcSetting;
import jalview.ws.params.WsParamSetI;
+import java.awt.Rectangle;
+import java.io.BufferedReader;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.lang.reflect.InvocationTargetException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.StringTokenizer;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import javax.swing.JInternalFrame;
+import javax.swing.JOptionPane;
+import javax.swing.SwingUtilities;
+
+import org.exolab.castor.xml.Marshaller;
+import org.exolab.castor.xml.Unmarshaller;
+
/**
* Write out the current jalview desktop state as a Jalview XML stream.
*
object.setVamsasModel(new jalview.schemabinding.version2.VamsasModel());
object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
- object.setVersion(jalview.bin.Cache.getDefault("VERSION",
+ object.setVersion(Cache.getDefault("VERSION",
"Development Build"));
- jalview.datamodel.AlignmentI jal = av.getAlignment();
+ AlignmentI jal = av.getAlignment();
if (av.hasHiddenRows())
{
{
mp = new Mapping();
- jalview.util.MapList mlst = jmp.getMap();
+ MapList mlst = jmp.getMap();
List<int[]> r = mlst.getFromRanges();
for (int[] range : r)
{
mpc.setDseqFor(jmpid);
if (!seqRefIds.containsKey(mpc.getDseqFor()))
{
- jalview.bin.Cache.log.debug("creatign new DseqFor ID");
+ Cache.log.debug("creatign new DseqFor ID");
seqRefIds.put(mpc.getDseqFor(), ps);
}
else
{
- jalview.bin.Cache.log.debug("reusing DseqFor ID");
+ Cache.log.debug("reusing DseqFor ID");
}
}
mp.setMappingChoice(mpc);
});
} catch (Exception x)
{
-
+ System.err.println("Error loading alignment: " + x.getMessage());
}
}
return af;
/**
* persisted version of annotation row from which to take vis properties
*/
- public jalview.datamodel.AlignmentAnnotation template;
+ public AlignmentAnnotation template;
/**
* original position of the annotation row in the alignment
}
}
}
- jalview.datamodel.AlignmentAnnotation jaa = null;
+ AlignmentAnnotation jaa = null;
if (annotation.getGraph())
{
// if (autoForView || an[i].isAutoCalculated()) {
// hlim=11f;
// }
- jaa = new jalview.datamodel.AlignmentAnnotation(
+ jaa = new AlignmentAnnotation(
annotation.getLabel(), annotation.getDescription(), anot,
llim, hlim, annotation.getGraphType());
}
else
{
- jaa = new jalview.datamodel.AlignmentAnnotation(an[i].getLabel(),
+ jaa = new AlignmentAnnotation(an[i].getLabel(),
an[i].getDescription(), anot);
jaa._linecolour = firstColour;
}
// and make a note of any group association
if (an[i].getGroupRef() != null && an[i].getGroupRef().length() > 0)
{
- List<jalview.datamodel.AlignmentAnnotation> aal = groupAnnotRefs
+ List<AlignmentAnnotation> aal = groupAnnotRefs
.get(an[i].getGroupRef());
if (aal == null)
{
- aal = new ArrayList<jalview.datamodel.AlignmentAnnotation>();
+ aal = new ArrayList<AlignmentAnnotation>();
groupAnnotRefs.put(an[i].getGroupRef(), aal);
}
aal.add(jaa);
String sessionState = ss.getViewerState();
String tempStateFile = copyJarEntry(jprovider, sessionState,
"varna");
- RnaModel rna = new RnaModel(rnaTitle, ann, seq, null, gapped,
- tempStateFile);
- appVarna.addModel(rna, rnaTitle);
+ RnaModel rna = new RnaModel(rnaTitle, ann, seq, null, gapped);
+ appVarna.addModelSession(rna, rnaTitle, tempStateFile);
}
- appVarna.setSelectedIndex(viewer.getSelectedRna());
+ appVarna.setInitialSelection(viewer.getSelectedRna());
}
}
}
String pdbFile = filedat.getFilePath();
SequenceI[] seq = filedat.getSeqList().toArray(new SequenceI[0]);
binding.getSsm().setMapping(seq, null, pdbFile,
- jalview.io.AppletFormatAdapter.FILE);
+ AppletFormatAdapter.FILE);
binding.addSequenceForStructFile(pdbFile, seq);
}
// and add the AlignmentPanel's reference to the view panel
List<String> remains = new ArrayList<String>(visan.keySet());
for (int h = 0; h < hSize; h++)
{
- jalview.datamodel.AlignmentAnnotation jalan = al
+ AlignmentAnnotation jalan = al
.getAlignmentAnnotation()[h];
if (jalan.autoCalculated)
{
srt[s++] = jvar.order;
}
reorder.clear();
- jalview.util.QuickSort.sort(srt, rws);
+ jalview.util.QuickSort.sortInt(srt, rws);
// and re-insert the annotation at its correct position
for (JvAnnotRow jvar : rws)
{
if (sq != dsq)
{
// StringBuffer sb = new StringBuffer();
- String newres = jalview.analysis.AlignSeq.extractGaps(
- jalview.util.Comparison.GapChars, sq.getSequenceAsString());
+ String newres = AlignSeq.extractGaps(
+ Comparison.GapChars, sq.getSequenceAsString());
if (!newres.equalsIgnoreCase(dsq.getSequenceAsString())
&& newres.length() > dsq.getLength())
{
seqRefIds.put(sqid, djs);
}
- jalview.bin.Cache.log.debug("about to recurse on addDBRefs.");
+ Cache.log.debug("about to recurse on addDBRefs.");
addDBRefs(djs, ms);
}
seqRefIds.put(jv2vobj.get(jvobj).toString(), (SequenceI) jvobj);
seqsToIds.put((SequenceI) jvobj, id);
}
- else if (jvobj instanceof jalview.datamodel.AlignmentAnnotation)
+ else if (jvobj instanceof AlignmentAnnotation)
{
String anid;
AlignmentAnnotation jvann = (AlignmentAnnotation) jvobj;