import java.net.MalformedURLException;
import java.net.URL;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Enumeration;
import java.util.HashMap;
import java.util.HashSet;
{
return;
}
+ saveAllFrames(Arrays.asList(frames), jout);
+ }
+ /**
+ * core method for storing state for a set of AlignFrames.
+ *
+ * @param frames
+ * - frames involving all data to be exported (including containing
+ * splitframes)
+ * @param jout
+ * - project output stream
+ */
+ private void saveAllFrames(List<AlignFrame> frames, JarOutputStream jout)
+ {
Hashtable<String, AlignFrame> dsses = new Hashtable<String, AlignFrame>();
/*
List<String> viewIds = new ArrayList<String>();
// REVERSE ORDER
- for (int i = frames.length - 1; i > -1; i--)
+ for (int i = frames.size() - 1; i > -1; i--)
{
- AlignFrame af = frames[i];
+ AlignFrame af = frames.get(i);
// skip ?
if (skipList != null
&& skipList
{
try
{
- int ap = 0;
- int apSize = af.alignPanels.size();
FileOutputStream fos = new FileOutputStream(jarFile);
JarOutputStream jout = new JarOutputStream(fos);
- Hashtable<String, AlignFrame> dsses = new Hashtable<String, AlignFrame>();
- List<String> viewIds = new ArrayList<String>();
+ List<AlignFrame> frames = new ArrayList<AlignFrame>();
- for (AlignmentPanel apanel : af.alignPanels)
{
- String jfileName = apSize == 1 ? fileName : fileName + ap;
- ap++;
- if (!jfileName.endsWith(".xml"))
- {
- jfileName = jfileName + ".xml";
- }
- saveState(apanel, jfileName, jout, viewIds);
- String dssid = getDatasetIdRef(af.getViewport().getAlignment()
- .getDataset());
- if (!dsses.containsKey(dssid))
- {
- dsses.put(dssid, af);
- }
}
- writeDatasetFor(dsses, fileName, jout);
+ frames.add(af);
+ saveAllFrames(frames, jout);
try
{
jout.flush();