From: jprocter Date: Mon, 7 Nov 2011 13:08:45 +0000 (+0000) Subject: (JAL-975) formatting X-Git-Tag: Jalview_2_9~559^2~2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c2bf1f82a29ad1b64cd83647421f644f66e3ab81;p=jalview.git (JAL-975) formatting --- diff --git a/src/jalview/ws/jws2/AAConsClient.java b/src/jalview/ws/jws2/AAConsClient.java index 054c9ab..a720593 100644 --- a/src/jalview/ws/jws2/AAConsClient.java +++ b/src/jalview/ws/jws2/AAConsClient.java @@ -361,8 +361,9 @@ public class AAConsClient extends AlignCalcWorker Map> scoremap = scoremanager.asMap(); int alWidth = alignViewport.getAlignment().getWidth(); AlignmentI alignment; - int ann = (alignment=alignViewport.getAlignment()).getAlignmentAnnotation().length; - ArrayList ourAnnot=new ArrayList(); + int ann = (alignment = alignViewport.getAlignment()) + .getAlignmentAnnotation().length; + ArrayList ourAnnot = new ArrayList(); for (String score : scoremap.keySet()) { TreeSet scores = scoremap.get(score); @@ -385,40 +386,57 @@ public class AAConsClient extends AlignCalcWorker // simple annotation row annotation = findOrCreate(scr.getMethod(), true, null, null); Annotation[] elm = new Annotation[alWidth]; - if (alWidth==scr.getScores().size()) + if (alWidth == scr.getScores().size()) { - Iterator vals = scr.getScores().iterator(); - float m=0f,x=0f; - for (int i = 0; vals.hasNext(); i++) - { - float val = vals.next().floatValue(); - if (i==0) { m=val;x=val;} else { if (m>val) { m=val; }; if (x vals = scr.getScores().iterator(); + float m = 0f, x = 0f; + for (int i = 0; vals.hasNext(); i++) + { + float val = vals.next().floatValue(); + if (i == 0) + { + m = val; + x = val; + } + else + { + if (m > val) + { + m = val; + } + ; + if (x < val) + { + x = val; + } + } + elm[i] = new Annotation("", "" + val, ' ', val); + } + + annotation.annotations = elm; + annotation.belowAlignment = true; + if (x < 0) + { + x = 0; + } + x += (x - m) * 0.1; + annotation.graphMax = x; + annotation.graphMin = m; + annotation.validateRangeAndDisplay(); + ourAnnot.add(annotation); } } } } - if (ourAnnot.size()>0) + if (ourAnnot.size() > 0) { - List our=ourAnnots; + List our = ourAnnots; ourAnnots = ourAnnot; - if (our!=null) { - if (our.size()>0) + if (our != null) + { + if (our.size() > 0) { - for (AlignmentAnnotation an:our) + for (AlignmentAnnotation an : our) { if (!ourAnnots.contains(an)) { @@ -430,14 +448,14 @@ public class AAConsClient extends AlignCalcWorker our.clear(); } } - //if (ann != alignViewport.getAlignment().getAlignmentAnnotation().length) + // if (ann != + // alignViewport.getAlignment().getAlignmentAnnotation().length) { ap.adjustAnnotationHeight(); } - /* else - { - ap.paintAlignment(true); - }*/ + /* + * else { ap.paintAlignment(true); } + */ } }