JAL-1551 format and tidy
authorJim Procter <jprocter@dundee.ac.uk>
Thu, 30 Oct 2014 15:21:31 +0000 (15:21 +0000)
committerJim Procter <jprocter@dundee.ac.uk>
Thu, 30 Oct 2014 15:21:31 +0000 (15:21 +0000)
src/MCview/PDBfile.java
src/jalview/appletgui/AlignFrame.java
src/jalview/bin/JalviewLite.java
src/jalview/ext/jmol/PDBFileWithJmol.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/Jalview2XML_V1.java
src/jalview/io/FileLoader.java
src/jalview/structure/StructureSelectionManager.java

index a99f172..7d2ceac 100755 (executable)
@@ -33,11 +33,12 @@ import java.awt.Color;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Hashtable;
+import java.util.List;
 import java.util.Vector;
 
 public class PDBfile extends jalview.io.AlignFile
 {
-  public Vector chains;
+  public Vector<PDBChain> chains;
 
   public String id;
 
@@ -181,15 +182,15 @@ public class PDBfile extends jalview.io.AlignFile
       }
       for (int i = 0; i < chains.size(); i++)
       {
-        SequenceI dataset = ((PDBChain) chains.elementAt(i)).sequence;
+        SequenceI dataset = chains.elementAt(i).sequence;
         dataset.setName(id + "|" + dataset.getName());
         PDBEntry entry = new PDBEntry();
         entry.setId(id);
         entry.setProperty(new Hashtable());
-        if (((PDBChain) chains.elementAt(i)).id != null)
+        if (chains.elementAt(i).id != null)
         {
           entry.getProperty().put("CHAIN",
-                  ((PDBChain) chains.elementAt(i)).id);
+                  chains.elementAt(i).id);
         }
         if (inFile != null)
         {
@@ -406,7 +407,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      ((PDBChain) chains.elementAt(i)).makeResidueList();
+      chains.elementAt(i).makeResidueList();
     }
   }
 
@@ -414,7 +415,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      ((PDBChain) chains.elementAt(i)).makeCaBondList();
+      chains.elementAt(i).makeCaBondList();
     }
   }
 
@@ -422,9 +423,9 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      if (((PDBChain) chains.elementAt(i)).id.equals(id))
+      if (chains.elementAt(i).id.equals(id))
       {
-        return (PDBChain) chains.elementAt(i);
+        return chains.elementAt(i);
       }
     }
 
@@ -435,7 +436,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      ((PDBChain) chains.elementAt(i)).setChargeColours();
+      chains.elementAt(i).setChargeColours();
     }
   }
 
@@ -443,7 +444,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      ((PDBChain) chains.elementAt(i)).setChainColours(cs);
+      chains.elementAt(i).setChainColours(cs);
     }
   }
 
@@ -451,7 +452,7 @@ public class PDBfile extends jalview.io.AlignFile
   {
     for (int i = 0; i < chains.size(); i++)
     {
-      ((PDBChain) chains.elementAt(i)).setChainColours(Color.getHSBColor(
+      chains.elementAt(i).setChainColours(Color.getHSBColor(
               1.0f / i, .4f, 1.0f));
     }
   }
index f267858..8449a53 100644 (file)
@@ -21,7 +21,6 @@
 package jalview.appletgui;
 
 import jalview.analysis.AlignmentSorter;
-import jalview.analysis.Conservation;
 import jalview.api.AlignViewControllerGuiI;
 import jalview.api.AlignViewControllerI;
 import jalview.api.SequenceStructureBinding;
@@ -56,7 +55,6 @@ import jalview.schemes.PIDColourScheme;
 import jalview.schemes.PurinePyrimidineColourScheme;
 import jalview.schemes.RNAHelicesColourChooser;
 import jalview.schemes.RNAInteractionColourScheme;
-import jalview.schemes.ResidueProperties;
 import jalview.schemes.StrandColourScheme;
 import jalview.schemes.TCoffeeColourScheme;
 import jalview.schemes.TaylorColourScheme;
@@ -324,7 +322,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
                     .getKeyCode() >= KeyEvent.VK_NUMPAD0 && evt
                     .getKeyCode() <= KeyEvent.VK_NUMPAD9))
             && Character.isDigit(evt.getKeyChar()))
+    {
       alignPanel.seqPanel.numberPressed(evt.getKeyChar());
+    }
 
     switch (evt.getKeyCode())
     {
@@ -385,16 +385,24 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
 
     case KeyEvent.VK_LEFT:
       if (evt.isAltDown() || !viewport.cursorMode)
+      {
         slideSequences(false, alignPanel.seqPanel.getKeyboardNo1());
+      }
       else
+      {
         alignPanel.seqPanel.moveCursor(-1, 0);
+      }
       break;
 
     case KeyEvent.VK_RIGHT:
       if (evt.isAltDown() || !viewport.cursorMode)
+      {
         slideSequences(true, alignPanel.seqPanel.getKeyboardNo1());
+      }
       else
+      {
         alignPanel.seqPanel.moveCursor(1, 0);
+      }
       break;
 
     case KeyEvent.VK_SPACE:
@@ -1257,7 +1265,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     else
     {
       if (features == null)
+      {
         features = "";
+      }
     }
 
     return features;
@@ -1573,7 +1583,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     for (int i = 0; i < viewport.getAlignment().getHeight(); i++)
     {
       if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))
+      {
         invertGroup.addElement(viewport.getAlignment().getSequenceAt(i));
+      }
     }
 
     SequenceI[] seqs1 = sg.toArray(new SequenceI[sg.size()]);
@@ -1581,30 +1593,44 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     SequenceI[] seqs2 = invertGroup.toArray(new SequenceI[invertGroup
             .size()]);
     for (int i = 0; i < invertGroup.size(); i++)
+    {
       seqs2[i] = invertGroup.elementAt(i);
+    }
 
     SlideSequencesCommand ssc;
     if (right)
+    {
       ssc = new SlideSequencesCommand("Slide Sequences", seqs2, seqs1,
               size, viewport.getGapCharacter());
+    }
     else
+    {
       ssc = new SlideSequencesCommand("Slide Sequences", seqs1, seqs2,
               size, viewport.getGapCharacter());
+    }
 
     int groupAdjustment = 0;
     if (ssc.getGapsInsertedBegin() && right)
     {
       if (viewport.cursorMode)
+      {
         alignPanel.seqPanel.moveCursor(size, 0);
+      }
       else
+      {
         groupAdjustment = size;
+      }
     }
     else if (!ssc.getGapsInsertedBegin() && !right)
     {
       if (viewport.cursorMode)
+      {
         alignPanel.seqPanel.moveCursor(-size, 0);
+      }
       else
+      {
         groupAdjustment = -size;
+      }
     }
 
     if (groupAdjustment != 0)
@@ -1625,7 +1651,9 @@ public class AlignFrame extends EmbmenuFrame implements ActionListener,
     }
 
     if (!appendHistoryItem)
+    {
       addHistoryItem(ssc);
+    }
 
     repaint();
   }
index ef1e16e..d3f03be 100644 (file)
@@ -2076,10 +2076,12 @@ public class JalviewLite extends Applet implements
             {
               String sequence = applet.getParameter("PDBSEQ");
               if (sequence != null)
+              {
                 seqs = new SequenceI[]
                 { matcher == null ? (Sequence) newAlignFrame
                         .getAlignViewport().getAlignment()
                         .findName(sequence) : matcher.findIdMatch(sequence) };
+              }
 
             }
             else
@@ -2323,7 +2325,9 @@ public class JalviewLite extends Applet implements
     // note separator local variable intentionally masks object field
     int seplen = separator.length();
     if (list == null || list.equals("") || list.equals(separator))
+    {
       return null;
+    }
     java.util.Vector jv = new Vector();
     int cp = 0, pos;
     while ((pos = list.indexOf(separator, cp)) > cp)
index 847453f..159955a 100644 (file)
  */
 package jalview.ext.jmol;
 
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.PDBEntry;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceI;
+import jalview.io.AlignFile;
+import jalview.io.FileParse;
+import jalview.util.MessageManager;
+
 import java.io.IOException;
 import java.util.Hashtable;
 import java.util.Map;
@@ -35,15 +44,6 @@ import org.jmol.modelsetbio.BioPolymer;
 import org.jmol.viewer.Viewer;
 import org.openscience.jmol.app.JmolApp;
 
-import jalview.datamodel.AlignmentAnnotation;
-import jalview.datamodel.Annotation;
-import jalview.datamodel.PDBEntry;
-import jalview.datamodel.Sequence;
-import jalview.datamodel.SequenceI;
-import jalview.io.AlignFile;
-import jalview.io.FileParse;
-import jalview.util.MessageManager;
-
 /**
  * Import and process PDB files with Jmol
  * 
@@ -307,11 +307,16 @@ public class PDBFileWithJmol extends AlignFile implements
     case MEASURE:
       String mystatus = (String) data[3];
       if (mystatus.indexOf("Picked") >= 0
-              || mystatus.indexOf("Sequence") >= 0) // picking mode
+              || mystatus.indexOf("Sequence") >= 0)
+      {
+        // Picking mode
         sendConsoleMessage(strInfo);
+      }
       else if (mystatus.indexOf("Completed") >= 0)
+      {
         sendConsoleEcho(strInfo.substring(strInfo.lastIndexOf(",") + 2,
                 strInfo.length() - 1));
+      }
       break;
     case MESSAGE:
       sendConsoleMessage(data == null ? null : strInfo);
index d9c0c6a..6b4aa1f 100644 (file)
@@ -377,7 +377,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
                         .getKeyCode() >= KeyEvent.VK_NUMPAD0 && evt
                         .getKeyCode() <= KeyEvent.VK_NUMPAD9))
                 && Character.isDigit(evt.getKeyChar()))
+        {
           alignPanel.seqPanel.numberPressed(evt.getKeyChar());
+        }
 
         switch (evt.getKeyCode())
         {
@@ -389,32 +391,48 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
 
         case KeyEvent.VK_DOWN:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             moveSelectedSequences(false);
+          }
           if (viewport.cursorMode)
+          {
             alignPanel.seqPanel.moveCursor(0, 1);
+          }
           break;
 
         case KeyEvent.VK_UP:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             moveSelectedSequences(true);
+          }
           if (viewport.cursorMode)
+          {
             alignPanel.seqPanel.moveCursor(0, -1);
+          }
 
           break;
 
         case KeyEvent.VK_LEFT:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             slideSequences(false, alignPanel.seqPanel.getKeyboardNo1());
+          }
           else
+          {
             alignPanel.seqPanel.moveCursor(-1, 0);
+          }
 
           break;
 
         case KeyEvent.VK_RIGHT:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             slideSequences(true, alignPanel.seqPanel.getKeyboardNo1());
+          }
           else
+          {
             alignPanel.seqPanel.moveCursor(1, 0);
+          }
           break;
 
         case KeyEvent.VK_SPACE:
@@ -551,14 +569,18 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
         {
         case KeyEvent.VK_LEFT:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             viewport.firePropertyChange("alignment", null, viewport
                     .getAlignment().getSequences());
+          }
           break;
 
         case KeyEvent.VK_RIGHT:
           if (evt.isAltDown() || !viewport.cursorMode)
+          {
             viewport.firePropertyChange("alignment", null, viewport
                     .getAlignment().getSequences());
+          }
           break;
         }
       }
@@ -1458,7 +1480,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
   protected void undoMenuItem_actionPerformed(ActionEvent e)
   {
     if (viewport.historyList.empty())
+    {
       return;
+    }
     CommandI command = (CommandI) viewport.historyList.pop();
     viewport.redoList.push(command);
     command.undoCommand(getViewAlignments());
@@ -1611,37 +1635,53 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     for (int i = 0; i < viewport.getAlignment().getHeight(); i++)
     {
       if (!sg.contains(viewport.getAlignment().getSequenceAt(i)))
+      {
         invertGroup.add(viewport.getAlignment().getSequenceAt(i));
+      }
     }
 
     SequenceI[] seqs1 = sg.toArray(new SequenceI[0]);
 
     SequenceI[] seqs2 = new SequenceI[invertGroup.size()];
     for (int i = 0; i < invertGroup.size(); i++)
+    {
       seqs2[i] = (SequenceI) invertGroup.elementAt(i);
+    }
 
     SlideSequencesCommand ssc;
     if (right)
+    {
       ssc = new SlideSequencesCommand("Slide Sequences", seqs2, seqs1,
               size, viewport.getGapCharacter());
+    }
     else
+    {
       ssc = new SlideSequencesCommand("Slide Sequences", seqs1, seqs2,
               size, viewport.getGapCharacter());
+    }
 
     int groupAdjustment = 0;
     if (ssc.getGapsInsertedBegin() && right)
     {
       if (viewport.cursorMode)
+      {
         alignPanel.seqPanel.moveCursor(size, 0);
+      }
       else
+      {
         groupAdjustment = size;
+      }
     }
     else if (!ssc.getGapsInsertedBegin() && !right)
     {
       if (viewport.cursorMode)
+      {
         alignPanel.seqPanel.moveCursor(-size, 0);
+      }
       else
+      {
         groupAdjustment = -size;
+      }
     }
 
     if (groupAdjustment != 0)
@@ -1662,7 +1702,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
     }
 
     if (!appendHistoryItem)
+    {
       addHistoryItem(ssc);
+    }
 
     repaint();
   }
@@ -1997,7 +2039,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
           {
             AlignmentAnnotation sann[] = sequences[i].getAnnotation();
             if (sann == null)
+            {
               continue;
+            }
             for (int avnum = 0; avnum < alview.length; avnum++)
             {
               if (alview[avnum] != alignment)
@@ -4643,7 +4687,9 @@ public class AlignFrame extends GAlignFrame implements DropTargetListener,
               if (ds.getSequences() == null
                       || !ds.getSequences().contains(
                               sprods[s].getDatasetSequence()))
+              {
                 ds.addSequence(sprods[s].getDatasetSequence());
+              }
               sprods[s].updatePDBIds();
             }
             Alignment al = new Alignment(sprods);
index 105209f..a19e1db 100644 (file)
  */
 package jalview.gui;
 
-import java.awt.Rectangle;
-import java.io.*;
-import java.lang.reflect.InvocationTargetException;
-import java.net.*;
-import java.util.*;
-import java.util.Map.Entry;
-import java.util.jar.*;
-
-import javax.swing.*;
-
-import org.exolab.castor.xml.*;
-
 import jalview.api.structures.JalviewStructureDisplayI;
 import jalview.bin.Cache;
 import jalview.datamodel.Alignment;
 import jalview.datamodel.AlignmentAnnotation;
 import jalview.datamodel.AlignmentI;
 import jalview.datamodel.SequenceI;
-import jalview.schemabinding.version2.*;
-import jalview.schemes.*;
+import jalview.schemabinding.version2.AlcodMap;
+import jalview.schemabinding.version2.Alcodon;
+import jalview.schemabinding.version2.AlcodonFrame;
+import jalview.schemabinding.version2.Annotation;
+import jalview.schemabinding.version2.AnnotationColours;
+import jalview.schemabinding.version2.AnnotationElement;
+import jalview.schemabinding.version2.CalcIdParam;
+import jalview.schemabinding.version2.DBRef;
+import jalview.schemabinding.version2.Features;
+import jalview.schemabinding.version2.Group;
+import jalview.schemabinding.version2.HiddenColumns;
+import jalview.schemabinding.version2.JGroup;
+import jalview.schemabinding.version2.JSeq;
+import jalview.schemabinding.version2.JalviewModel;
+import jalview.schemabinding.version2.JalviewModelSequence;
+import jalview.schemabinding.version2.MapListFrom;
+import jalview.schemabinding.version2.MapListTo;
+import jalview.schemabinding.version2.Mapping;
+import jalview.schemabinding.version2.MappingChoice;
+import jalview.schemabinding.version2.OtherData;
+import jalview.schemabinding.version2.PdbentryItem;
+import jalview.schemabinding.version2.Pdbids;
+import jalview.schemabinding.version2.Property;
+import jalview.schemabinding.version2.Sequence;
+import jalview.schemabinding.version2.SequenceSet;
+import jalview.schemabinding.version2.SequenceSetProperties;
+import jalview.schemabinding.version2.Setting;
+import jalview.schemabinding.version2.StructureState;
+import jalview.schemabinding.version2.ThresholdLine;
+import jalview.schemabinding.version2.Tree;
+import jalview.schemabinding.version2.UserColours;
+import jalview.schemabinding.version2.Viewport;
+import jalview.schemes.AnnotationColourGradient;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.GraduatedColor;
+import jalview.schemes.ResidueColourScheme;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 import jalview.util.Platform;
 import jalview.util.jarInputStreamProvider;
@@ -51,6 +76,41 @@ import jalview.ws.params.ArgumentI;
 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.HashSet;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.List;
+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.Unmarshaller;
+
 /**
  * Write out the current jalview desktop state as a Jalview XML stream.
  * 
@@ -678,7 +738,9 @@ public class Jalview2XML
                                 .startsWith(
                                         jmol.jmb.pdbentry[peid].getId()
                                                 .toLowerCase())))
+                {
                   continue;
+                }
                 if (matchedFile == null)
                 {
                   matchedFile = jmol.jmb.pdbentry[peid].getFile();
@@ -1371,18 +1433,26 @@ public class Jalview2XML
 
           ae = new AnnotationElement();
           if (aa[i].annotations[a].description != null)
+          {
             ae.setDescription(aa[i].annotations[a].description);
+          }
           if (aa[i].annotations[a].displayCharacter != null)
+          {
             ae.setDisplayCharacter(aa[i].annotations[a].displayCharacter);
+          }
 
           if (!Float.isNaN(aa[i].annotations[a].value))
+          {
             ae.setValue(aa[i].annotations[a].value);
+          }
 
           ae.setPosition(a);
           if (aa[i].annotations[a].secondaryStructure != ' '
                   && aa[i].annotations[a].secondaryStructure != '\0')
+          {
             ae.setSecondaryStructure(aa[i].annotations[a].secondaryStructure
                     + "");
+          }
 
           if (aa[i].annotations[a].colour != null
                   && aa[i].annotations[a].colour != java.awt.Color.black)
@@ -2046,7 +2116,7 @@ public class Jalview2XML
     errorMessage = null;
   }
 
-  Hashtable alreadyLoadedPDB;
+  Hashtable<String, String> alreadyLoadedPDB;
 
   /**
    * when set, local views will be updated from view stored in JalviewXML
@@ -2058,10 +2128,14 @@ public class Jalview2XML
   String loadPDBFile(jarInputStreamProvider jprovider, String pdbId)
   {
     if (alreadyLoadedPDB == null)
+    {
       alreadyLoadedPDB = new Hashtable();
+    }
 
     if (alreadyLoadedPDB.containsKey(pdbId))
+    {
       return alreadyLoadedPDB.get(pdbId).toString();
+    }
 
     try
     {
@@ -2409,7 +2483,9 @@ public class Jalview2XML
           // in principle Visible should always be true for annotation displayed
           // in multiple views
           if (an[i].hasVisible())
+          {
             jda.visible = an[i].getVisible();
+          }
 
           al.addAnnotation(jda);
 
@@ -2428,7 +2504,9 @@ public class Jalview2XML
             anpos = ae[aa].getPosition();
 
             if (anpos >= anot.length)
+            {
               continue;
+            }
 
             anot[anpos] = new jalview.datamodel.Annotation(
 
@@ -2522,10 +2600,14 @@ public class Jalview2XML
           jaa.setScore(an[i].getScore());
         }
         if (an[i].hasVisible())
+        {
           jaa.visible = an[i].getVisible();
+        }
 
         if (an[i].hasCentreColLabels())
+        {
           jaa.centreColLabels = an[i].getCentreColLabels();
+        }
 
         if (an[i].hasScaleColLabels())
         {
@@ -2547,7 +2629,6 @@ public class Jalview2XML
           jaa.belowAlignment = an[i].isBelowAlignment();
         }
         jaa.setCalcId(an[i].getCalcId());
-
         if (jaa.autoCalculated)
         {
           autoAlan.add(new JvAnnotRow(i, jaa));
@@ -3544,12 +3625,16 @@ public class Jalview2XML
         }
         renderOrder[fs] = setting.getType();
         if (setting.hasOrder())
+        {
           af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setOrder(
                   setting.getType(), setting.getOrder());
+        }
         else
+        {
           af.alignPanel.seqPanel.seqCanvas.getFeatureRenderer().setOrder(
                   setting.getType(),
                   fs / jms.getFeatureSettings().getSettingCount());
+        }
         if (setting.getDisplay())
         {
           af.viewport.featuresDisplayed.put(setting.getType(), new Integer(
@@ -4392,7 +4477,9 @@ public class Jalview2XML
         }
       }
       else
+      {
         Cache.log.debug("Ignoring " + jvobj.getClass() + " (ID = " + id);
+      }
     }
   }
 
index 946181c..b426914 100755 (executable)
  */
 package jalview.gui;
 
-import java.io.*;
-import java.util.*;
-import java.util.jar.*;
-
-import javax.swing.*;
-
-import org.exolab.castor.xml.*;
-import jalview.binding.*;
-import jalview.schemes.*;
+import jalview.binding.Annotation;
+import jalview.binding.AnnotationElement;
+import jalview.binding.Features;
+import jalview.binding.JGroup;
+import jalview.binding.JSeq;
+import jalview.binding.JalviewModel;
+import jalview.binding.JalviewModelSequence;
+import jalview.binding.Pdbids;
+import jalview.binding.Sequence;
+import jalview.binding.SequenceSet;
+import jalview.binding.Setting;
+import jalview.binding.Tree;
+import jalview.binding.UserColours;
+import jalview.binding.Viewport;
+import jalview.schemes.ColourSchemeI;
+import jalview.schemes.ColourSchemeProperty;
+import jalview.schemes.ResidueProperties;
+import jalview.structure.StructureSelectionManager;
 import jalview.util.MessageManager;
 import jalview.util.jarInputStreamProvider;
 
+import java.io.InputStreamReader;
+import java.util.Hashtable;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+
+import javax.swing.JOptionPane;
+
+import org.exolab.castor.xml.IDResolver;
+
 /**
  * DOCUMENT ME!
  * 
@@ -120,7 +139,7 @@ public class Jalview2XML_V1
           InputStreamReader in = new InputStreamReader(jin, "UTF-8");
           JalviewModel object = new JalviewModel();
 
-          object = (JalviewModel) object.unmarshal(in);
+          object = object.unmarshal(in);
 
           af = LoadFromObject(object, file);
           entryCount++;
@@ -315,7 +334,7 @@ public class Jalview2XML_V1
 
         for (int s = 0; s < ids.length; s++)
         {
-          seqs.addElement((jalview.datamodel.SequenceI) seqids
+          seqs.addElement(seqids
                   .elementAt(ids[s]));
         }
 
index 0f94efa..1d9655b 100755 (executable)
@@ -319,7 +319,6 @@ public class FileLoader implements Runnable
             }
             viewport.firePropertyChange("alignment", null, viewport
                     .getAlignment().getSequences());
-
           }
           else
           {
@@ -331,7 +330,9 @@ public class FileLoader implements Runnable
                     { title }));
 
             if (!protocol.equals(AppletFormatAdapter.PASTE))
+            {
               alignFrame.setFileName(file, format);
+            }
             if (raiseGUI)
             {
               // add the window to the GUI
index 4d94b2d..58bba48 100644 (file)
@@ -253,7 +253,7 @@ public class StructureSelectionManager
       boolean first = true;
       for (int i = 0; i < pdb.chains.size(); i++)
       {
-        PDBChain chain = ((PDBChain) pdb.chains.elementAt(i));
+        PDBChain chain = (pdb.chains.elementAt(i));
         if (targetChain.length() > 0 && !targetChain.equals(chain.id)
                 && !infChain)
         {
@@ -262,8 +262,8 @@ public class StructureSelectionManager
         // TODO: correctly determine sequence type for mixed na/peptide
         // structures
         AlignSeq as = new AlignSeq(sequence[s],
-                ((PDBChain) pdb.chains.elementAt(i)).sequence,
-                ((PDBChain) pdb.chains.elementAt(i)).isNa ? AlignSeq.DNA
+                pdb.chains.elementAt(i).sequence,
+                pdb.chains.elementAt(i).isNa ? AlignSeq.DNA
                         : AlignSeq.PEP);
         as.calcScoreMatrix();
         as.traceAlignment();