Merge branch 'develop' into features/JAL-2446NCList
[jalview.git] / src / jalview / gui / AlignViewport.java
index 835371f..c22a37d 100644 (file)
@@ -71,8 +71,8 @@ import javax.swing.JInternalFrame;
  * @author $author$
  * @version $Revision: 1.141 $
  */
-public class AlignViewport extends AlignmentViewport implements
-        SelectionSource
+public class AlignViewport extends AlignmentViewport
+        implements SelectionSource
 {
   Font font;
 
@@ -129,8 +129,8 @@ public class AlignViewport extends AlignmentViewport implements
     // TODO remove these once 2.4.VAMSAS release finished
     if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null)
     {
-      Cache.log.debug("Setting viewport's sequence set id : "
-              + sequenceSetID);
+      Cache.log.debug(
+              "Setting viewport's sequence set id : " + sequenceSetID);
     }
     if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null)
     {
@@ -191,8 +191,8 @@ public class AlignViewport extends AlignmentViewport implements
     // TODO remove these once 2.4.VAMSAS release finished
     if (Cache.log != null && Cache.log.isDebugEnabled() && seqsetid != null)
     {
-      Cache.log.debug("Setting viewport's sequence set id : "
-              + sequenceSetID);
+      Cache.log.debug(
+              "Setting viewport's sequence set id : " + sequenceSetID);
     }
     if (Cache.log != null && Cache.log.isDebugEnabled() && viewId != null)
     {
@@ -225,17 +225,17 @@ public class AlignViewport extends AlignmentViewport implements
     setShowDBRefs(Cache.getDefault("SHOW_DBREFS_TOOLTIP", true));
     viewStyle.setSeqNameItalics(Cache.getDefault("ID_ITALICS", true));
     viewStyle.setWrapAlignment(Cache.getDefault("WRAP_ALIGNMENT", false));
-    viewStyle.setShowUnconserved(Cache
-            .getDefault("SHOW_UNCONSERVED", false));
+    viewStyle.setShowUnconserved(
+            Cache.getDefault("SHOW_UNCONSERVED", false));
     sortByTree = Cache.getDefault("SORT_BY_TREE", false);
     followSelection = Cache.getDefault("FOLLOW_SELECTIONS", true);
-    sortAnnotationsBy = SequenceAnnotationOrder.valueOf(Cache.getDefault(
-            Preferences.SORT_ANNOTATIONS,
-            SequenceAnnotationOrder.NONE.name()));
-    showAutocalculatedAbove = Cache.getDefault(
-            Preferences.SHOW_AUTOCALC_ABOVE, false);
-    viewStyle.setScaleProteinAsCdna(Cache.getDefault(
-            Preferences.SCALE_PROTEIN_TO_CDNA, true));
+    sortAnnotationsBy = SequenceAnnotationOrder
+            .valueOf(Cache.getDefault(Preferences.SORT_ANNOTATIONS,
+                    SequenceAnnotationOrder.NONE.name()));
+    showAutocalculatedAbove = Cache
+            .getDefault(Preferences.SHOW_AUTOCALC_ABOVE, false);
+    viewStyle.setScaleProteinAsCdna(
+            Cache.getDefault(Preferences.SCALE_PROTEIN_TO_CDNA, true));
   }
 
   void init()
@@ -284,7 +284,8 @@ public class AlignViewport extends AlignmentViewport implements
       showOccupancy = Cache.getDefault(Preferences.SHOW_OCCUPANCY, true);
     }
     initAutoAnnotation();
-    String colourProperty = alignment.isNucleotide() ? Preferences.DEFAULT_COLOUR_NUC
+    String colourProperty = alignment.isNucleotide()
+            ? Preferences.DEFAULT_COLOUR_NUC
             : Preferences.DEFAULT_COLOUR_PROT;
     String schemeName = Cache.getProperty(colourProperty);
     if (schemeName == null)
@@ -293,8 +294,8 @@ public class AlignViewport extends AlignmentViewport implements
       schemeName = Cache.getDefault(Preferences.DEFAULT_COLOUR,
               ResidueColourScheme.NONE);
     }
-    ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
-            alignment, schemeName);
+    ColourSchemeI colourScheme = ColourSchemeProperty
+            .getColourScheme(alignment, schemeName);
     residueShading = new ResidueShader(colourScheme);
 
     if (colourScheme instanceof UserColourScheme)
@@ -556,8 +557,8 @@ public class AlignViewport extends AlignmentViewport implements
   public void sendSelection()
   {
     jalview.structure.StructureSelectionManager
-            .getStructureSelectionManager(Desktop.instance).sendSelection(
-                    new SequenceGroup(getSelectionGroup()),
+            .getStructureSelectionManager(Desktop.instance)
+            .sendSelection(new SequenceGroup(getSelectionGroup()),
                     new ColumnSelection(getColumnSelection()),
                     new HiddenColumns(getAlignment().getHiddenColumns()),
                     this);
@@ -573,8 +574,8 @@ public class AlignViewport extends AlignmentViewport implements
    */
   public AlignmentPanel getAlignPanel()
   {
-    AlignmentPanel[] aps = PaintRefresher.getAssociatedPanels(this
-            .getSequenceSetId());
+    AlignmentPanel[] aps = PaintRefresher
+            .getAssociatedPanels(this.getSequenceSetId());
     for (int p = 0; aps != null && p < aps.length; p++)
     {
       if (aps[p].av == this)
@@ -633,8 +634,7 @@ public class AlignViewport extends AlignmentViewport implements
                     && pdb.getChainCode() != null)
             {
               if (pdbRefEntry.getChainCode().equalsIgnoreCase(
-                      pdb.getChainCode())
-                      && !choosenSeqs.contains(sq))
+                      pdb.getChainCode()) && !choosenSeqs.contains(sq))
               {
                 choosenSeqs.add(sq);
                 continue;
@@ -709,7 +709,8 @@ public class AlignViewport extends AlignmentViewport implements
    * <ul>
    * <li>compute the equivalent edit on the mapped sequences</li>
    * <li>apply the mapped edit</li>
-   * <li>'apply' the source edit to the working copy of the source sequences</li>
+   * <li>'apply' the source edit to the working copy of the source
+   * sequences</li>
    * </ul>
    * 
    * @param command
@@ -830,8 +831,7 @@ public class AlignViewport extends AlignmentViewport implements
    */
   protected boolean openLinkedAlignment(AlignmentI al, String title)
   {
-    String[] options = new String[] {
-        MessageManager.getString("action.no"),
+    String[] options = new String[] { MessageManager.getString("action.no"),
         MessageManager.getString("label.split_window"),
         MessageManager.getString("label.new_window"), };
     final String question = JvSwingUtils.wrapTooltip(true,
@@ -873,8 +873,9 @@ public class AlignViewport extends AlignmentViewport implements
     AlignFrame newAlignFrame = new AlignFrame(al, AlignFrame.DEFAULT_WIDTH,
             AlignFrame.DEFAULT_HEIGHT);
     newAlignFrame.setTitle(title);
-    newAlignFrame.statusBar.setText(MessageManager.formatMessage(
-            "label.successfully_loaded_file", new Object[] { title }));
+    newAlignFrame.statusBar.setText(MessageManager
+            .formatMessage("label.successfully_loaded_file", new Object[]
+            { title }));
 
     // TODO if we want this (e.g. to enable reload of the alignment from file),
     // we will need to add parameters to the stack.
@@ -891,8 +892,8 @@ public class AlignViewport extends AlignmentViewport implements
 
     try
     {
-      newAlignFrame.setMaximum(jalview.bin.Cache.getDefault(
-              "SHOW_FULLSCREEN", false));
+      newAlignFrame.setMaximum(
+              jalview.bin.Cache.getDefault("SHOW_FULLSCREEN", false));
     } catch (java.beans.PropertyVetoException ex)
     {
     }
@@ -924,8 +925,8 @@ public class AlignViewport extends AlignmentViewport implements
      * is protein, the mappings to cDNA will be registered with
      * StructureSelectionManager as a side-effect.
      */
-    AlignFrame copyMe = new AlignFrame(complement,
-            AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+    AlignFrame copyMe = new AlignFrame(complement, AlignFrame.DEFAULT_WIDTH,
+            AlignFrame.DEFAULT_HEIGHT);
     copyMe.setTitle(getAlignPanel().alignFrame.getTitle());
 
     AlignmentI al = newAlignFrame.viewport.getAlignment();