X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=67eaef8660052a6ec997472f5584caee65b2c15d;hb=3bdd4947c87108581abe34d05c878ee110b60f72;hp=6d4e226000261c455d100309748fb9153620b954;hpb=b9fa0041e8f04f85f4f5357d2e2fe07e74d2172d;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 6d4e226..67eaef8 100755 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -92,11 +92,8 @@ public class AlignmentPanel extends GAlignmentPanel setScrollValues(0, 0); - annotationPanel.adjustPanelHeight(); - annotationSpaceFillerHolder.setPreferredSize(annotationPanel. - getPreferredSize()); - annotationScroller.setPreferredSize(annotationPanel. - getPreferredSize()); + adjustAnnotationHeight(); + setAnnotationVisible(av.getShowAnnotation()); hscroll.addAdjustmentListener(this); @@ -418,6 +415,37 @@ public class AlignmentPanel extends GAlignmentPanel repaint(); } + public void adjustAnnotationHeight() + { + javax.swing.SwingUtilities.invokeLater(new Runnable() + { + public void run() + { + while(alignFrame.getHeight()==0) + { + Thread.yield(); + } + + int height = annotationPanel.adjustPanelHeight(); + + if (height > alignFrame.getHeight() / 2) + { + height = alignFrame.getHeight() / 2; + } + + annotationScroller.setPreferredSize( + new Dimension(annotationScroller.getWidth(), + height)); + + annotationSpaceFillerHolder.setPreferredSize(new Dimension( + annotationSpaceFillerHolder.getWidth(), + height)); + + annotationPanel.repaint(); + } + }); + } + /** * DOCUMENT ME! * @@ -1132,9 +1160,9 @@ public class AlignmentPanel extends GAlignmentPanel if (features[f].getDescription() != null && !features[f].getType().equals(features[f].getDescription())) text.append(" " + features[f].getDescription()); - if (features[f].getStatus() != null && features[f].getStatus().length()>0) + if (features[f].getValue("status") != null ) { - text.append(" (" + features[f].getStatus() + ")"); + text.append(" (" + features[f].getValue("status") + ")"); } } }