From 82a1660cd4ac60d30f947e2c57c66f7fb2a40996 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 11 Jul 2013 13:54:25 +0100 Subject: [PATCH] JAL-1347 refactor logic for setting display flags for histogram and profile to main control loop --- src/jalview/renderer/AnnotationRenderer.java | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/src/jalview/renderer/AnnotationRenderer.java b/src/jalview/renderer/AnnotationRenderer.java index 6ed2b9f..f492d9c 100644 --- a/src/jalview/renderer/AnnotationRenderer.java +++ b/src/jalview/renderer/AnnotationRenderer.java @@ -318,6 +318,8 @@ public class AnnotationRenderer boolean centreColLabels, centreColLabelsDef = av .getCentreColumnLabels(); boolean scaleColLabel = false; + AlignmentAnnotation consensusAnnot=av.getAlignmentConsensusAnnotation(); + boolean renderHistogram = true, renderProfile = true, normaliseProfile = false; BitSet graphGroupDrawn = new BitSet(); int charOffset = 0; // offset for a label @@ -674,7 +676,7 @@ public class AnnotationRenderer else if (row.graph == AlignmentAnnotation.BAR_GRAPH) { drawBarGraph(g, row, row_annotations, startRes, endRes, - row.graphMin, row.graphMax, y); + row.graphMin, row.graphMax, y, renderHistogram,renderProfile,normaliseProfile); } } } else { @@ -910,7 +912,7 @@ public class AnnotationRenderer public void drawBarGraph(Graphics g, AlignmentAnnotation _aa, Annotation[] aa_annotations, int sRes, int eRes, float min, - float max, int y) + float max, int y, boolean renderHistogram,boolean renderProfile,boolean normaliseProfile) { if (sRes > aa_annotations.length) { @@ -934,23 +936,6 @@ public class AnnotationRenderer int column; int aaMax = aa_annotations.length - 1; - boolean renderHistogram = true, renderProfile = true, normaliseProfile = false; - // if (aa.autoCalculated && aa.label.startsWith("Consensus")) - { - // TODO: generalise this to have render styles for consensus/profile data - if (_aa.groupRef != null) - { - renderHistogram = _aa.groupRef.isShowConsensusHistogram(); - renderProfile = _aa.groupRef.isShowSequenceLogo(); - normaliseProfile = _aa.groupRef.isNormaliseSequenceLogo(); - } - else - { - renderHistogram = av_renderHistogram; - renderProfile = av_renderProfile; - normaliseProfile = av_normaliseProfile; - } - } while (x < eRes - sRes) { column = sRes + x; -- 1.7.10.2