X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FTreeCanvas.java;h=2e5f93884eef308441c1fb29ffa7c3dced893b2d;hb=57738a1f3c19b1c3a00bd3ac5108f8cd0af32f99;hp=272a2b3f172cfc536289690cd4de34fcdba2fd74;hpb=136c0793b90b72b928c4d77dc109dd5c644e00d3;p=jalview.git diff --git a/src/jalview/appletgui/TreeCanvas.java b/src/jalview/appletgui/TreeCanvas.java index 272a2b3..2e5f938 100755 --- a/src/jalview/appletgui/TreeCanvas.java +++ b/src/jalview/appletgui/TreeCanvas.java @@ -51,8 +51,8 @@ import java.util.Hashtable; import java.util.List; import java.util.Vector; -public class TreeCanvas extends Panel implements MouseListener, - MouseMotionListener +public class TreeCanvas extends Panel + implements MouseListener, MouseMotionListener { TreeModel tree; @@ -210,8 +210,9 @@ public class TreeCanvas extends Panel implements MouseListener, g.drawString(nodeLabel, xstart + 2, ypos - 2); } - String name = (markPlaceholders && node.isPlaceholder()) ? (PLACEHOLDER + node - .getName()) : node.getName(); + String name = (markPlaceholders && node.isPlaceholder()) + ? (PLACEHOLDER + node.getName()) + : node.getName(); FontMetrics fm = g.getFontMetrics(font); int charWidth = fm.stringWidth(name) + 3; int charHeight = fm.getHeight(); @@ -261,11 +262,10 @@ public class TreeCanvas extends Panel implements MouseListener, g.fillRect(xend - 2, ypos - 2, 4, 4); } - int ystart = (int) (node.left() == null ? 0 : (((SequenceNode) node - .left()).ycount * chunk)) - + offy; - int yend = (int) (node.right() == null ? 0 : (((SequenceNode) node - .right()).ycount * chunk)) + offy; + int ystart = (int) (node.left() == null ? 0 + : (((SequenceNode) node.left()).ycount * chunk)) + offy; + int yend = (int) (node.right() == null ? 0 + : (((SequenceNode) node.right()).ycount * chunk)) + offy; Rectangle pos = new Rectangle(xend - 2, ypos - 2, 5, 5); nodeHash.put(node, pos); @@ -491,7 +491,8 @@ public class TreeCanvas extends Panel implements MouseListener, g.setColor(Color.gray); } - int x = (int) (threshold * (getSize().width - labelLength - 2 * offx) + offx); + int x = (int) (threshold * (getSize().width - labelLength - 2 * offx) + + offx); g.drawLine(x, 0, x, getSize().height); } @@ -630,7 +631,7 @@ public class TreeCanvas extends Panel implements MouseListener, Vector l = tree.findLeaves(groups.get(i)); - Vector sequences = new Vector(); + Vector sequences = new Vector<>(); for (int j = 0; j < l.size(); j++) { SequenceI s1 = (SequenceI) l.elementAt(j).element(); @@ -656,9 +657,9 @@ public class TreeCanvas extends Panel implements MouseListener, } else { - cs = ColourSchemeProperty.getColourScheme(sg, - ColourSchemeProperty.getColourName(av - .getGlobalColourScheme())); + cs = ColourSchemeProperty.getColourScheme(av, sg, + ColourSchemeProperty + .getColourName(av.getGlobalColourScheme())); } // cs is null if shading is an annotationColourGradient // if (cs != null)