apply jalview code style
[jalview.git] / src / jalview / appletgui / TreeCanvas.java
index f0e7b62..d40ab73 100755 (executable)
@@ -1,20 +1,19 @@
 /*
- * Jalview - A Sequence Alignment Editor and Viewer (Development Version 2.4.1)
- * Copyright (C) 2009 AM Waterhouse, J Procter, G Barton, M Clamp, S Searle
+ * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6)
+ * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle
  * 
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version 2
- * of the License, or (at your option) any later version.
+ * This file is part of Jalview.
  * 
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License 
+ * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
  * 
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
+ * Jalview is distributed in the hope that it will be useful, but 
+ * WITHOUT ANY WARRANTY; without even the implied warranty 
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
+ * PURPOSE.  See the GNU General Public License for more details.
+ * 
+ * You should have received a copy of the GNU General Public License along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
  */
 package jalview.appletgui;
 
@@ -185,8 +184,7 @@ public class TreeCanvas extends Panel implements MouseListener,
       }
 
       String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node
-              .getName())
-              : node.getName();
+              .getName()) : node.getName();
       FontMetrics fm = g.getFontMetrics(font);
       int charWidth = fm.stringWidth(name) + 3;
       int charHeight = fm.getHeight();
@@ -406,7 +404,7 @@ public class TreeCanvas extends Panel implements MouseListener,
     {
       repaint();
     }
-    
+
     int width = scrollPane.getSize().width;
     int height = scrollPane.getSize().height;
     if (!fitToWindow)
@@ -436,9 +434,9 @@ public class TreeCanvas extends Panel implements MouseListener,
     g.fillRect(0, 0, width, height);
 
     labelLength = g.getFontMetrics(font).stringWidth(longestName) + 20; // 20
-                                                                        // allows
-                                                                        // for
-                                                                        // scrollbar
+    // allows
+    // for
+    // scrollbar
 
     float wscale = (float) (width - labelLength - offx * 2)
             / tree.getMaxHeight();
@@ -586,12 +584,12 @@ public class TreeCanvas extends Panel implements MouseListener,
     for (int i = 0; i < tree.getGroups().size(); i++)
     {
 
-      Color col = new Color((int) (Math.random() * 255), (int) (Math
-              .random() * 255), (int) (Math.random() * 255));
+      Color col = new Color((int) (Math.random() * 255),
+              (int) (Math.random() * 255), (int) (Math.random() * 255));
       setColor((SequenceNode) tree.getGroups().elementAt(i), col.brighter());
 
-      Vector l = tree.findLeaves((SequenceNode) tree.getGroups().elementAt(
-              i), new Vector());
+      Vector l = tree.findLeaves(
+              (SequenceNode) tree.getGroups().elementAt(i), new Vector());
 
       Vector sequences = new Vector();
       for (int j = 0; j < l.size(); j++)
@@ -610,8 +608,9 @@ public class TreeCanvas extends Panel implements MouseListener,
       {
         if (av.getGlobalColourScheme() instanceof UserColourScheme)
         {
-          cs = new UserColourScheme(((UserColourScheme) av
-                  .getGlobalColourScheme()).getColours());
+          cs = new UserColourScheme(
+                  ((UserColourScheme) av.getGlobalColourScheme())
+                          .getColours());
 
         }
         else
@@ -621,8 +620,8 @@ public class TreeCanvas extends Panel implements MouseListener,
                   .getGlobalColourScheme()));
         }
 
-        cs.setThreshold(av.getGlobalColourScheme().getThreshold(), av
-                .getIgnoreGapsConsensus());
+        cs.setThreshold(av.getGlobalColourScheme().getThreshold(),
+                av.getIgnoreGapsConsensus());
       }
 
       SequenceGroup sg = new SequenceGroup(sequences, "", cs, true, true,
@@ -634,8 +633,8 @@ public class TreeCanvas extends Panel implements MouseListener,
               && av.getGlobalColourScheme().conservationApplied())
       {
         Conservation c = new Conservation("Group",
-                ResidueProperties.propHash, 3, sg.getSequences(null), sg
-                        .getStartRes(), sg.getEndRes());
+                ResidueProperties.propHash, 3, sg.getSequences(null),
+                sg.getStartRes(), sg.getEndRes());
 
         c.calculate();
         c.verdict(false, av.ConsPercGaps);