X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;fp=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;h=f4d8f5999cb3b2d5291ad75e12a6661e0c8a507a;hb=537f890bfcd90e4d01099c74da10a3cfe4ad4e3d;hp=8d2580b93833f17e643daf2b296da8fa3e0e817b;hpb=f01d759960fc7bf6d91307aac03c41870c9a5493;p=jalview.git diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 8d2580b..f4d8f59 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1284,6 +1284,8 @@ public abstract class AlignmentViewport implements AlignViewportI, protected boolean showConsensus = true; + protected boolean showOccupancy = true; + private Map sequenceColours = new HashMap(); protected SequenceAnnotationOrder sortAnnotationsBy = null; @@ -1893,11 +1895,7 @@ public abstract class AlignmentViewport implements AlignViewportI, consensus = new AlignmentAnnotation("Consensus", "PID", new Annotation[1], 0f, 100f, AlignmentAnnotation.BAR_GRAPH); initConsensus(consensus); - gapcounts = new AlignmentAnnotation("Occupancy", - "Number of aligned positions", - new Annotation[1], 0f, alignment.getHeight(), - AlignmentAnnotation.BAR_GRAPH); - initGapCounts(gapcounts); + initGapCounts(); initComplementConsensus(); } @@ -1954,16 +1952,19 @@ public abstract class AlignmentViewport implements AlignViewportI, // these should be extracted from the view model - style and settings for // derived annotation - private void initGapCounts(AlignmentAnnotation counts) + private void initGapCounts() { - counts.hasText = true; - counts.autoCalculated = true; - counts.scaleColLabel = true; - counts.graph = AlignmentAnnotation.BAR_GRAPH; - - if (showConsensus) + if (showOccupancy) { - alignment.addAnnotation(counts); + gapcounts = new AlignmentAnnotation("Occupancy", + "Number of aligned positions", new Annotation[1], 0f, + alignment.getHeight(), AlignmentAnnotation.BAR_GRAPH); + gapcounts.hasText = true; + gapcounts.autoCalculated = true; + gapcounts.scaleColLabel = true; + gapcounts.graph = AlignmentAnnotation.BAR_GRAPH; + + alignment.addAnnotation(gapcounts); } }