X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=efefeafbada38512aa86f69d4377d8d6675873eb;hb=cce8dd5b2737f394593b3a418c7bb1836cf55c57;hp=4f0d0e88f4203ebcc08484172cbb30605ceb3141;hpb=6b544d4a85673db44b7f75f40c22d9b7425d444e;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 4f0d0e8..efefeaf 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1,5 +1,5 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.5) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.6) * Copyright (C) 2010 J Procter, AM Waterhouse, G Barton, M Clamp, S Searle * * This file is part of Jalview. @@ -179,8 +179,8 @@ public class AlignmentPanel extends GAlignmentPanel implements AlignmentI al = av.getAlignment(); int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300); - int maxwidth = Math.max(20, Math.min(afwidth - 200, (int) 2 * afwidth - / 3)); + int maxwidth = Math.max(20, + Math.min(afwidth - 200, (int) 2 * afwidth / 3)); int i = 0; int idWidth = 0; String id; @@ -283,7 +283,8 @@ public class AlignmentPanel extends GAlignmentPanel implements } int start = r[0]; int end = r[1]; - // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // DEBUG + // System.err.println("Seq : "+seqIndex+" Scroll to "+start+","+end); // + // DEBUG if (start < 0) { return false; @@ -577,9 +578,7 @@ public class AlignmentPanel extends GAlignmentPanel implements { int x = hscroll.getValue(); av.setStartRes(x); - av - .setEndRes((x + (seqPanel.seqCanvas.getWidth() / av - .getCharWidth())) - 1); + av.setEndRes((x + (seqPanel.seqCanvas.getWidth() / av.getCharWidth())) - 1); } if (evt.getSource() == vscroll) @@ -859,8 +858,8 @@ public class AlignmentPanel extends GAlignmentPanel implements } pg.setColor(currentColor); - pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, av - .getCharHeight()); + pg.fillRect(0, (i - startSeq) * av.charHeight, idWidth, + av.getCharHeight()); pg.setColor(currentTextColor); @@ -873,7 +872,9 @@ public class AlignmentPanel extends GAlignmentPanel implements - 4; } - pg.drawString(seq.getDisplayId(av.getShowJVSuffix()), xPos, + pg.drawString( + seq.getDisplayId(av.getShowJVSuffix()), + xPos, (((i - startSeq) * av.charHeight) + av.getCharHeight()) - (av.getCharHeight() / 5)); } @@ -1327,7 +1328,8 @@ public class AlignmentPanel extends GAlignmentPanel implements public void updateAnnotation(boolean applyGlobalSettings) { - // TODO: this should be merged with other annotation update stuff - that sits on AlignViewport + // TODO: this should be merged with other annotation update stuff - that + // sits on AlignViewport boolean updateCalcs = false; boolean conv = av.isShowGroupConservation(); boolean cons = av.isShowGroupConsensus(); @@ -1346,46 +1348,46 @@ public class AlignmentPanel extends GAlignmentPanel implements Hashtable oldrfs = new Hashtable(); if (aan != null) { - for (int an = 0; an < aan.length; an++) - { - if (aan[an].autoCalculated && aan[an].groupRef != null) + for (int an = 0; an < aan.length; an++) { - oldrfs.put(aan[an].groupRef, aan[an].groupRef); - av.alignment.deleteAnnotation(aan[an]); - aan[an] = null; + if (aan[an].autoCalculated && aan[an].groupRef != null) + { + oldrfs.put(aan[an].groupRef, aan[an].groupRef); + av.alignment.deleteAnnotation(aan[an]); + aan[an] = null; + } } } - } SequenceGroup sg; if (gr != null) { - for (int g = 0; g < gr.size(); g++) - { - updateCalcs = false; - sg = (SequenceGroup) gr.elementAt(g); - if (applyGlobalSettings || !oldrfs.containsKey(sg)) - { - // set defaults for this group's conservation/consensus - sg.setshowSequenceLogo(showprf); - sg.setShowConsensusHistogram(showConsHist); - } - if (conv) - { - updateCalcs = true; - av.alignment.addAnnotation(sg.getConservationRow(), 0); - } - if (cons) - { - updateCalcs = true; - av.alignment.addAnnotation(sg.getConsensus(), 0); - } - // refresh the annotation rows - if (updateCalcs) + for (int g = 0; g < gr.size(); g++) { - sg.recalcConservation(); + updateCalcs = false; + sg = (SequenceGroup) gr.elementAt(g); + if (applyGlobalSettings || !oldrfs.containsKey(sg)) + { + // set defaults for this group's conservation/consensus + sg.setshowSequenceLogo(showprf); + sg.setShowConsensusHistogram(showConsHist); + } + if (conv) + { + updateCalcs = true; + av.alignment.addAnnotation(sg.getConservationRow(), 0); + } + if (cons) + { + updateCalcs = true; + av.alignment.addAnnotation(sg.getConsensus(), 0); + } + // refresh the annotation rows + if (updateCalcs) + { + sg.recalcConservation(); + } } } - } oldrfs.clear(); adjustAnnotationHeight(); }