X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAlignmentPanel.java;h=cdac5b4a82884c512877ebb9d902962c0c5540dc;hb=85d8faf004199c5cc63773d7d4643143d16600da;hp=6ae19a501b1c647673779a702784a81b44c5a6ca;hpb=47168f025aefdaa044802bd5f8f510ffe43a4808;p=jalview.git diff --git a/src/jalview/gui/AlignmentPanel.java b/src/jalview/gui/AlignmentPanel.java index 6ae19a5..cdac5b4 100644 --- a/src/jalview/gui/AlignmentPanel.java +++ b/src/jalview/gui/AlignmentPanel.java @@ -34,6 +34,7 @@ import jalview.datamodel.*; import jalview.jbgui.*; import jalview.schemes.*; import jalview.structure.StructureSelectionManager; +import jalview.util.MessageManager; /** * DOCUMENT ME! @@ -424,16 +425,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 @@ -441,10 +445,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 @@ -705,7 +710,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); } @@ -1111,13 +1116,11 @@ 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 " - + (type == jalview.util.ImageMaker.PNG ? "PNG image" - : "EPS file"), progress); + alignFrame.setProgressBar(MessageManager.formatMessage("status.saving_file", new String[]{(type == jalview.util.ImageMaker.PNG ? MessageManager.getString("label.png_image") : MessageManager.getString("label.eps_file"))}), progress); } try { @@ -1204,7 +1207,7 @@ public class AlignmentPanel extends GAlignmentPanel implements { if (alignFrame != null && !headless) { - alignFrame.setProgressBar("Export complete.", progress); + alignFrame.setProgressBar(MessageManager.getString("status.export_complete"), progress); } } }