X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;fp=src%2Fjalview%2Fappletgui%2FAnnotationPanel.java;h=6fe71de7520a3b0d589a3c93522a7528c85f4325;hb=2dd39c36211f947fda099c550e711ef5905efefd;hp=417bb0672b27e87b2f6c151923ef7819452ceb4d;hpb=4dd40d33a5becefd51c31a426f2501b21029f82c;p=jalview.git diff --git a/src/jalview/appletgui/AnnotationPanel.java b/src/jalview/appletgui/AnnotationPanel.java index 417bb06..6fe71de 100755 --- a/src/jalview/appletgui/AnnotationPanel.java +++ b/src/jalview/appletgui/AnnotationPanel.java @@ -51,9 +51,9 @@ import java.awt.event.MouseListener; import java.awt.event.MouseMotionListener; import java.beans.PropertyChangeEvent; -public class AnnotationPanel extends Panel implements AwtRenderPanelI, - AdjustmentListener, ActionListener, MouseListener, - MouseMotionListener, ViewportListenerI +public class AnnotationPanel extends Panel + implements AwtRenderPanelI, AdjustmentListener, ActionListener, + MouseListener, MouseMotionListener, ViewportListenerI { AlignViewport av; @@ -153,7 +153,8 @@ public class AnnotationPanel extends Panel 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; @@ -287,8 +288,8 @@ public class AnnotationPanel extends Panel 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; } } @@ -353,7 +354,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, } } - if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK + if ((evt.getModifiers() + & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK && activeRow != -1) { if (av.getColumnSelection() == null @@ -425,11 +427,14 @@ public class AnnotationPanel extends Panel 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(); av.calcPanelHeight(); @@ -509,18 +514,19 @@ public class AnnotationPanel extends Panel 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))); - text.append(" Residue: ").append( - name != null ? name : 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); text.append(" (").append(residuePos).append(")"); @@ -626,8 +632,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, gg.setColor(Color.white); gg.fillRect(0, 0, getSize().width, getSize().height); - drawComponent(gg, av.getRanges().getStartRes(), av.getRanges() - .getEndRes() + 1); + drawComponent(gg, av.getRanges().getStartRes(), + av.getRanges().getEndRes() + 1); g.drawImage(image, 0, 0, this); } @@ -644,7 +650,8 @@ public class AnnotationPanel extends Panel implements AwtRenderPanelI, gg.copyArea(0, 0, imgWidth, getSize().height, -horizontal * av.getCharWidth(), 0); - int sr = av.getRanges().getStartRes(), er = av.getRanges().getEndRes() + 1, transX = 0; + int sr = av.getRanges().getStartRes(), + er = av.getRanges().getEndRes() + 1, transX = 0; if (horizontal > 0) // scrollbar pulled right, image to the left {