X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAnnotationPanel.java;fp=src%2Fjalview%2Fgui%2FAnnotationPanel.java;h=be8f5f6a89dbfa1d328cd41c538df118673c0ac4;hb=daf64249356f9a156423bd56ab0336d9da2e5325;hp=61099c3d4bdb96375afa5714d933ae8a92c388ae;hpb=4f9c22055c3cdbfc9c4375dcb74755a89ec32b62;p=jalview.git diff --git a/src/jalview/gui/AnnotationPanel.java b/src/jalview/gui/AnnotationPanel.java index 61099c3..be8f5f6 100755 --- a/src/jalview/gui/AnnotationPanel.java +++ b/src/jalview/gui/AnnotationPanel.java @@ -285,7 +285,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, if (anot.length < av.getColumnSelection().getMax()) { - Annotation[] temp = new Annotation[av.getColumnSelection().getMax() + 2]; + Annotation[] temp = new Annotation[av.getColumnSelection().getMax() + + 2]; System.arraycopy(anot, 0, temp, 0, anot.length); anot = temp; aa[activeRow].annotations = anot; @@ -413,8 +414,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, anot[index] = new Annotation(label, "", type, 0); } - anot[index].secondaryStructure = type != 'S' ? type : label - .length() == 0 ? ' ' : label.charAt(0); + anot[index].secondaryStructure = type != 'S' ? type + : label.length() == 0 ? ' ' : label.charAt(0); anot[index].displayCharacter = label; } @@ -658,11 +659,14 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { if (graphStretch > -1) { - av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY - - evt.getY(); - if (av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight < 0) + av.getAlignment() + .getAlignmentAnnotation()[graphStretch].graphHeight += graphStretchY + - evt.getY(); + if (av.getAlignment() + .getAlignmentAnnotation()[graphStretch].graphHeight < 0) { - av.getAlignment().getAlignmentAnnotation()[graphStretch].graphHeight = 0; + av.getAlignment() + .getAlignmentAnnotation()[graphStretch].graphHeight = 0; } graphStretchY = evt.getY(); adjustPanelHeight(); @@ -820,8 +824,7 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, int seqIndex = av.getAlignment().findIndex(seqref); if (seqIndex != -1) { - text.append(", ") - .append(MessageManager.getString("label.sequence")) + text.append(", ").append(MessageManager.getString("label.sequence")) .append(" ").append(seqIndex + 1); char residue = seqref.getCharAt(column); if (!Comparison.isGap(residue)) @@ -830,16 +833,17 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, String name; if (av.getAlignment().isNucleotide()) { - name = ResidueProperties.nucleotideName.get(String - .valueOf(residue)); - text.append(" Nucleotide: ").append( - name != null ? name : residue); + name = ResidueProperties.nucleotideName + .get(String.valueOf(residue)); + text.append(" Nucleotide: ") + .append(name != null ? name : residue); } else { - name = 'X' == residue ? "X" : ('*' == residue ? "STOP" - : ResidueProperties.aa2Triplet.get(String - .valueOf(residue))); + name = 'X' == residue ? "X" + : ('*' == residue ? "STOP" + : ResidueProperties.aa2Triplet + .get(String.valueOf(residue))); text.append(" Residue: ").append(name != null ? name : residue); } int residuePos = seqref.findPosition(column); @@ -913,8 +917,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, return; } } - imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes() + 1) - * av.getCharWidth(); + imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes() + + 1) * av.getCharWidth(); if (imgWidth < 1) { return; @@ -924,8 +928,9 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, { try { - image = new BufferedImage(imgWidth, ap.getAnnotationPanel() - .getHeight(), BufferedImage.TYPE_INT_RGB); + image = new BufferedImage(imgWidth, + ap.getAnnotationPanel().getHeight(), + BufferedImage.TYPE_INT_RGB); } catch (OutOfMemoryError oom) { try @@ -955,8 +960,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, imageFresh = true; } - drawComponent(gg, av.getRanges().getStartRes(), av.getRanges() - .getEndRes() + 1); + drawComponent(gg, av.getRanges().getStartRes(), + av.getRanges().getEndRes() + 1); imageFresh = false; g.drawImage(image, 0, 0, this); } @@ -1046,8 +1051,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, // and draw a faded image until the calculation // has completed if (lastImageGood - && (fadedImage == null || fadedImage.getWidth() != imgWidth || fadedImage - .getHeight() != image.getHeight())) + && (fadedImage == null || fadedImage.getWidth() != imgWidth + || fadedImage.getHeight() != image.getHeight())) { // System.err.println("redraw faded image ("+(fadedImage==null ? // "null image" : "") + " lastGood="+lastImageGood+")"); @@ -1059,8 +1064,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, fadedG.setColor(Color.white); fadedG.fillRect(0, 0, imgWidth, image.getHeight()); - fadedG.setComposite(AlphaComposite.getInstance( - AlphaComposite.SRC_OVER, .3f)); + fadedG.setComposite( + AlphaComposite.getInstance(AlphaComposite.SRC_OVER, .3f)); fadedG.drawImage(image, 0, 0, this); } @@ -1101,8 +1106,8 @@ public class AnnotationPanel extends JPanel implements AwtRenderPanelI, return; } - lastImageGood = renderer.drawComponent(this, av, g, activeRow, - startRes, endRes); + lastImageGood = renderer.drawComponent(this, av, g, activeRow, startRes, + endRes); if (!lastImageGood && fadedImage == null) { fadedImage = oldFaded;