X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=inline;f=src%2Fjalview%2Fviewmodel%2FAlignmentViewport.java;h=27af11e6268d63010863aba5641ba0772b49933e;hb=aa213924876640ba82e866da5a750d9cdaa816d2;hp=8c34f31cdd5fe1d5e6f1ea71e4c8753df29a6b03;hpb=7f4ea25188b05b5a4a346b4c5136e3e50c8f0036;p=jalview.git diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index 8c34f31..27af11e 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -1374,4 +1374,75 @@ public abstract class AlignmentViewport implements AlignViewportI } } + /* + * (non-Javadoc) + * @see jalview.api.AlignViewportI#calcPanelHeight() + */ + public int calcPanelHeight() + { + // setHeight of panels + AlignmentAnnotation[] aa = getAlignment().getAlignmentAnnotation(); + int height = 0; + int charHeight=getCharHeight(); + if (aa != null) + { + boolean graphgrp[] = null; + for (int i = 0; i < aa.length; i++) + { + if (aa[i] == null) + { + System.err.println("Null annotation row: ignoring."); + continue; + } + if (!aa[i].visible) + { + continue; + } + if (aa[i].graphGroup > -1) + { + if (graphgrp == null) + { + graphgrp = new boolean[aa.length]; + } + if (graphgrp[aa[i].graphGroup]) + { + continue; + } + else + { + graphgrp[aa[i].graphGroup] = true; + } + } + aa[i].height = 0; + + if (aa[i].hasText) + { + aa[i].height += charHeight; + } + + if (aa[i].hasIcons) + { + aa[i].height += 16; + } + + if (aa[i].graph > 0) + { + aa[i].height += aa[i].graphHeight; + } + + if (aa[i].height == 0) + { + aa[i].height = 20; + } + + height += aa[i].height; + } + } + if (height == 0) + { + // set minimum + height = 20; + } + return height; + } }