git://source.jalview.org
/
jalview.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
f8534ee
)
fixed Jalview project archive bug where alignment view is not written to Jar that...
author
jprocter
<Jim Procter>
Mon, 12 May 2008 07:56:53 +0000
(07:56 +0000)
committer
jprocter
<Jim Procter>
Mon, 12 May 2008 07:56:53 +0000
(07:56 +0000)
src/jalview/gui/Jalview2XML.java
patch
|
blob
|
history
diff --git
a/src/jalview/gui/Jalview2XML.java
b/src/jalview/gui/Jalview2XML.java
index
5c08fb0
..
97dfefd
100755
(executable)
--- a/
src/jalview/gui/Jalview2XML.java
+++ b/
src/jalview/gui/Jalview2XML.java
@@
-228,16
+228,10
@@
public class Jalview2XML
fileName = fileName + ".xml";
}
fileName = fileName + ".xml";
}
- JarEntry entry = new JarEntry(fileName);
- jout.putNextEntry(entry);
- out = new PrintWriter(new OutputStreamWriter(jout, "UTF-8"));
- SaveState(apanel, fileName,
- jout, out);
+ SaveState(apanel, fileName, jout);
}
}
}
}
}
}
- try { out.flush(); } catch (Exception foo) {};
- jout.closeEntry();
try { jout.flush(); } catch (Exception foo) {};
jout.close();
} catch (Exception ex)
try { jout.flush(); } catch (Exception foo) {};
jout.close();
} catch (Exception ex)
@@
-265,13
+259,7
@@
public class Jalview2XML
{
jfileName = jfileName + ".xml";
}
{
jfileName = jfileName + ".xml";
}
- JarEntry entry = new JarEntry(jfileName);
- jout.putNextEntry(entry);
- PrintWriter out = new PrintWriter(new OutputStreamWriter(jout,
- "UTF-8"));
- SaveState(apanel, jfileName, jout, out);
- try { out.flush(); } catch (Exception foo) {};
- jout.closeEntry();
+ SaveState(apanel, jfileName, jout);
}
try { jout.flush(); } catch (Exception foo) {};
}
try { jout.flush(); } catch (Exception foo) {};
@@
-285,16
+273,16
@@
public class Jalview2XML
}
/**
}
/**
- * DOCUMENT ME!
+ * create a JalviewModel from an algnment view and marshall it
+ * to a JarOutputStream
*
*
- * @param af DOCUMENT ME!
- * @param timeStamp DOCUMENT ME!
- * @param fileName DOCUMENT ME!
- * @param jout DOCUMENT ME!
- * @param out DOCUMENT ME!
+ * @param ap panel to create jalview model for
+ * @param fileName name of alignment panel written to output stream
+ * @param jout jar output stream
+ * @param out jar entry name
*/
public JalviewModel SaveState(AlignmentPanel ap, String fileName,
*/
public JalviewModel SaveState(AlignmentPanel ap, String fileName,
- JarOutputStream jout, PrintWriter out)
+ JarOutputStream jout)
{
initSeqRefs();
{
initSeqRefs();
@@
-986,18
+974,24
@@
public class Jalview2XML
object.setJalviewModelSequence(jms);
object.getVamsasModel().addSequenceSet(vamsasSet);
object.setJalviewModelSequence(jms);
object.getVamsasModel().addSequenceSet(vamsasSet);
- if (out != null)
+ if (jout!=null && fileName!=null)
{
//We may not want to write the object to disk,
//eg we can copy the alignViewport to a new view object
//using save and then load
try
{
{
//We may not want to write the object to disk,
//eg we can copy the alignViewport to a new view object
//using save and then load
try
{
- org.exolab.castor.xml.Marshaller marshaller = new org.exolab.castor.xml.Marshaller(out);
+ JarEntry entry = new JarEntry(fileName);
+ jout.putNextEntry(entry);
+ PrintWriter pout = new PrintWriter(new OutputStreamWriter(jout,
+ "UTF-8"));
+ org.exolab.castor.xml.Marshaller marshaller = new org.exolab.castor.xml.Marshaller(pout);
marshaller.marshal(object);
marshaller.marshal(object);
- out.flush();
+ pout.flush();
+ jout.closeEntry();
} catch (Exception ex)
{
} catch (Exception ex)
{
+ // TODO: raise error in GUI if marshalling failed.
ex.printStackTrace();
}
}
ex.printStackTrace();
}
}
@@
-1287,6
+1281,9
@@
public class Jalview2XML
+ ex + "\n");
} catch (Exception ex)
{
+ ex + "\n");
} catch (Exception ex)
{
+ System.err.println("Parsing as Jalview Version 2 file failed.");
+ ex.printStackTrace(System.err);
+
//Is Version 1 Jar file?
try {
af = new Jalview2XML_V1(raiseGUI).LoadJalviewAlign(file);
//Is Version 1 Jar file?
try {
af = new Jalview2XML_V1(raiseGUI).LoadJalviewAlign(file);
@@
-2471,8
+2468,8
@@
public class Jalview2XML
public jalview.gui.AlignmentPanel copyAlignPanel(AlignmentPanel ap,
boolean keepSeqRefs)
{
public jalview.gui.AlignmentPanel copyAlignPanel(AlignmentPanel ap,
boolean keepSeqRefs)
{
- jalview.schemabinding.version2.JalviewModel jm = SaveState(ap, null,
- null, null);
+ jalview.schemabinding.version2.JalviewModel jm =
+ SaveState(ap, null, null);
if (!keepSeqRefs)
{
if (!keepSeqRefs)
{