X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=085b259e9e098481b6bddd74b7e9681056d4cad4;hb=9e926ac4305fd9dff38b6e079e55b4f50664d544;hp=052c5277c0a86eac613a3cd63170bf01d23e1282;hpb=163ed5b997bbda48e4cdd950e87a8fe01baae7fb;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index 052c527..085b259 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -266,8 +266,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI { if (av.isSeqNameItalics()) { - setIdfont(new Font(av.getFont().getName(), Font.ITALIC, av.getFont() - .getSize())); + setIdfont(new Font(av.getFont().getName(), Font.ITALIC, + av.getFont().getSize())); } else { @@ -323,9 +323,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI currentColor = Color.black; currentTextColor = Color.white; } - else if ((av.getSelectionGroup() != null) - && av.getSelectionGroup().getSequences(null) - .contains(sequence)) + else if ((av.getSelectionGroup() != null) && av.getSelectionGroup() + .getSequences(null).contains(sequence)) { currentColor = Color.lightGray; currentTextColor = Color.black; @@ -444,7 +443,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI void drawMarker(int i, int starty, int yoffset) { - SequenceI[] hseqs = av.getAlignment().getHiddenSequences().hiddenSequences; + SequenceI[] hseqs = av.getAlignment() + .getHiddenSequences().hiddenSequences; // Use this method here instead of calling hiddenSeq adjust // 3 times. int hSize = hseqs.length; @@ -479,32 +479,36 @@ public class IdCanvas extends JPanel implements ViewportListenerI if (below) { gg.fillPolygon( - new int[] { getWidth() - av.getCharHeight(), + new int[] + { getWidth() - av.getCharHeight(), getWidth() - av.getCharHeight(), getWidth() }, - new int[] { - (i - starty) * av.getCharHeight() + yoffset, + new int[] + { (i - starty) * av.getCharHeight() + yoffset, (i - starty) * av.getCharHeight() + yoffset + av.getCharHeight() / 4, - (i - starty) * av.getCharHeight() + yoffset }, 3); + (i - starty) * av.getCharHeight() + yoffset }, + 3); } if (above) { gg.fillPolygon( - new int[] { getWidth() - av.getCharHeight(), + new int[] + { getWidth() - av.getCharHeight(), getWidth() - av.getCharHeight(), getWidth() }, - new int[] { - (i - starty + 1) * av.getCharHeight() + yoffset, + new int[] + { (i - starty + 1) * av.getCharHeight() + yoffset, (i - starty + 1) * av.getCharHeight() + yoffset - av.getCharHeight() / 4, - (i - starty + 1) * av.getCharHeight() + yoffset }, 3); + (i - starty + 1) * av.getCharHeight() + yoffset }, + 3); } } void setHiddenFont(SequenceI seq) { - Font bold = new Font(av.getFont().getName(), Font.BOLD, av.getFont() - .getSize()); + Font bold = new Font(av.getFont().getName(), Font.BOLD, + av.getFont().getSize()); if (av.isReferenceSeq(seq) || av.isHiddenRepSequence(seq)) { @@ -555,10 +559,19 @@ public class IdCanvas extends JPanel implements ViewportListenerI { String propertyName = evt.getPropertyName(); if (propertyName.equals(ViewportRanges.STARTSEQ) - || (av.getWrapAlignment() && propertyName - .equals(ViewportRanges.STARTRES))) + || (av.getWrapAlignment() + && propertyName.equals(ViewportRanges.STARTRES))) { fastPaint((int) evt.getNewValue() - (int) evt.getOldValue()); } + else if (propertyName.equals(ViewportRanges.STARTRESANDSEQ)) + { + fastPaint(((int[]) evt.getNewValue())[1] + - ((int[]) evt.getOldValue())[1]); + } + else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT)) + { + repaint(); + } } }