X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAlignmentPanel.java;h=7f2a943d9425ee5a6958b35661f7d314d12844e1;hb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;hp=51ade37f77ca73b3028d487aa9ce5488e863feca;hpb=b57a02c25e335d033c97f8a6bacd6b54f62bd2b6;p=jalview.git diff --git a/src/jalview/appletgui/AlignmentPanel.java b/src/jalview/appletgui/AlignmentPanel.java index 51ade37..7f2a943 100644 --- a/src/jalview/appletgui/AlignmentPanel.java +++ b/src/jalview/appletgui/AlignmentPanel.java @@ -1,26 +1,25 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.7) - * Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Copyright (C) 2014 The Jalview Authors * * This file is part of Jalview. * * Jalview is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - * + * * Jalview is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty * of MERCHANTABILITY or FITNESS FOR A PARTICULAR * PURPOSE. See the GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along with Jalview. If not, see . + * The Jalview Authors are detailed in the 'AUTHORS' file. */ package jalview.appletgui; import java.awt.*; import java.awt.event.*; -import java.util.Hashtable; -import java.util.Vector; import jalview.api.AlignmentViewPanel; import jalview.datamodel.*; @@ -85,7 +84,6 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, annotationPanelHolder.add(annotationPanel, BorderLayout.CENTER); sequenceHolderPanel.add(annotationPanelHolder, BorderLayout.SOUTH); - alabels = new AnnotationLabels(this); setAnnotationVisible(av.showAnnotation); @@ -139,7 +137,6 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, } } }); - } public SequenceRenderer getSequenceRenderer() @@ -481,12 +478,27 @@ public class AlignmentPanel extends Panel implements AdjustmentListener, int mheight = height; Dimension d = sequenceHolderPanel.getSize(), e = idPanel.getSize(); int seqandannot = d.height - scalePanelHolder.getSize().height; - // sets initial preferred height - if ((height + 40) > seqandannot / 2) + + if (adjustPanelHeight) { - height = seqandannot / 2; + // NOTE: this logic is different in the application. Need a better algorithm to define behaviour + // sets initial preferred height + // try and set height according to alignment + float sscaling = (float) ((av.getCharHeight() * av.getAlignment().getHeight())/(1.0*mheight)); + if (sscaling > 0.5) + { + // if the alignment is too big then + // default is 0.5 split + height = seqandannot / 2; + } + else + { + // otherwise just set the panel so that one row of sequence is visible + height = -av.getCharHeight() * 1 + + (int) (seqandannot * (1 - sscaling)); + } } - if (!adjustPanelHeight) + else { // maintain same window layout whilst updating sliders height = annotationPanelHolder.getSize().height;