X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=134019de2fb51ad45a7b3e4323afa1131da88c68;hb=b4e0958489010d048a9247dad7b45791e633a1dc;hp=cad4339f671b766249b6db495edd0ae3e0aca980;hpb=b2f9a8d7bce642ff4011bc6d49e02bb0569fbb11;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index cad4339..134019d 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -1,19 +1,21 @@ /* - * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.1) + * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2) * 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. + * 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 . + * 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.gui; @@ -422,16 +424,19 @@ public class AlignmentPanel extends GAlignmentPanel implements protected void validateAnnotationDimensions(boolean adjustPanelHeight) { int height = annotationPanel.adjustPanelHeight(); - - int theight = av.getCharHeight() * (av.getAlignment().getHeight() + (!av.hasHiddenRows() ? 0 : av.getAlignment().getHiddenSequences().getSize())); - float sscaling = (float) (theight/(1.0*theight+height)); - float ascaling=(float)(height*1.0/alignFrame.getHeight()); + + int theight = av.getCharHeight() + * (av.getAlignment().getHeight() + (!av.hasHiddenRows() ? 0 + : av.getAlignment().getHiddenSequences().getSize())); + float sscaling = (float) (theight / (1.0 * theight + height)); + float ascaling = (float) (height * 1.0 / alignFrame.getHeight()); int rheight = alignFrame.getHeight() - height - av.getCharHeight(); if (adjustPanelHeight) { - // NOTE: this logic is different in the applet. Need a better algorithm to define behaviour + // NOTE: this logic is different in the applet. Need a better algorithm to + // define behaviour // try and set height according to alignment - if (ascaling>0 && sscaling < 0.5) + if (ascaling > 0 && sscaling < 0.5) { // if the alignment is too big then // default is 0.5 split @@ -439,10 +444,11 @@ public class AlignmentPanel extends GAlignmentPanel implements } else { - // if space for more than one sequence row left when annotation is fully displayed then set height to annotation height - // otherwise, leave at least two lines of sequence shown. - height = (rheight>av.getCharHeight()) ? height : (-av.getCharHeight() * 3 - + (int) (alignFrame.getHeight() * (1 - sscaling))); + // if space for more than one sequence row left when annotation is fully + // displayed then set height to annotation height + // otherwise, leave at least two lines of sequence shown. + height = (rheight > av.getCharHeight()) ? height + : (-av.getCharHeight() * 3 + (int) (alignFrame.getHeight() * (1 - sscaling))); } } else @@ -703,7 +709,7 @@ public class AlignmentPanel extends GAlignmentPanel implements seqPanel.seqCanvas.fastPaint(scrollX, scrollY); scalePanel.repaint(); - if (av.getShowAnnotation() && scrollX!=0) + if (av.getShowAnnotation() && scrollX != 0) { annotationPanel.fastPaint(scrollX); } @@ -1109,8 +1115,8 @@ public class AlignmentPanel extends GAlignmentPanel implements void makeAlignmentImage(int type, File file) { long progress = System.currentTimeMillis(); - boolean headless = (System.getProperty("java.awt.headless") != null - && System.getProperty("java.awt.headless").equals("true")); + boolean headless = (System.getProperty("java.awt.headless") != null && System + .getProperty("java.awt.headless").equals("true")); if (alignFrame != null && !headless) { alignFrame.setProgressBar("Saving "