X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fgui%2FIdCanvas.java;h=c89a9d5bfe00b45a041dd77216b5614c7e089813;hb=743a0473c959092ec7c80bdb8169a541d33657cd;hp=a7a4e34d47a8aa4e09ab55f2254d4dc56971326e;hpb=be32c14cd8e48fe0a207cd7030cb9cd46f894678;p=jalview.git diff --git a/src/jalview/gui/IdCanvas.java b/src/jalview/gui/IdCanvas.java index a7a4e34..c89a9d5 100755 --- a/src/jalview/gui/IdCanvas.java +++ b/src/jalview/gui/IdCanvas.java @@ -86,6 +86,8 @@ public class IdCanvas extends JPanel * * @param gg * DOCUMENT ME! + * @param hiddenRows + * true - check and display hidden row marker if need be * @param s * DOCUMENT ME! * @param i @@ -95,8 +97,8 @@ public class IdCanvas extends JPanel * @param ypos * DOCUMENT ME! */ - public void drawIdString(Graphics2D gg, SequenceI s, int i, int starty, - int ypos) + public void drawIdString(Graphics2D gg, boolean hiddenRows, SequenceI s, + int i, int starty, int ypos) { int xPos = 0; int panelWidth = getWidth(); @@ -134,7 +136,7 @@ public class IdCanvas extends JPanel gg.drawString(s.getDisplayId(av.getShowJVSuffix()), xPos, (((i - starty + 1) * charHeight) + ypos) - (charHeight / 5)); - if (av.hasHiddenRows() && av.getShowHiddenMarkers()) + if (hiddenRows) { drawMarker(i, starty, ypos); } @@ -274,6 +276,9 @@ public class IdCanvas extends JPanel Color currentColor = Color.white; Color currentTextColor = Color.black; + final boolean doHiddenCheck = av.isDisplayReferenceSeq() + || av.hasHiddenRows(), hiddenRows = av.hasHiddenRows(); + if (av.getWrapAlignment()) { int maxwidth = av.getAlignment().getWidth(); @@ -317,7 +322,7 @@ public class IdCanvas extends JPanel for (int i = starty; i < alheight; i++) { SequenceI s = av.getAlignment().getSequenceAt(i); - if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) + if (doHiddenCheck) { setHiddenFont(s); } @@ -326,7 +331,7 @@ public class IdCanvas extends JPanel gg.setFont(getIdfont()); } - drawIdString(gg, s, i, 0, ypos); + drawIdString(gg, hiddenRows, s, i, 0, ypos); } if (labels != null && av.isShowAnnotation()) @@ -357,7 +362,7 @@ public class IdCanvas extends JPanel continue; } - if (av.isDisplayReferenceSeq() || av.hasHiddenRows()) + if (doHiddenCheck) { setHiddenFont(sequence); } @@ -399,7 +404,7 @@ public class IdCanvas extends JPanel (((i - starty) * av.getCharHeight()) + av.getCharHeight()) - (av.getCharHeight() / 5)); - if (av.hasHiddenRows() && av.getShowHiddenMarkers()) + if (hiddenRows) { drawMarker(i, starty, 0); } @@ -447,11 +452,9 @@ public class IdCanvas extends JPanel if (below) { gg.fillPolygon( - new int[] - { getWidth() - av.getCharHeight(), - getWidth() - av.getCharHeight(), - getWidth() }, new int[] - { + new int[] { getWidth() - av.getCharHeight(), + getWidth() - av.getCharHeight(), getWidth() }, + new int[] { (i - starty) * av.getCharHeight() + yoffset, (i - starty) * av.getCharHeight() + yoffset + av.getCharHeight() / 4, @@ -460,11 +463,9 @@ public class IdCanvas extends JPanel if (above) { gg.fillPolygon( - new int[] - { getWidth() - av.getCharHeight(), - getWidth() - av.getCharHeight(), - getWidth() }, new int[] - { + new int[] { getWidth() - av.getCharHeight(), + getWidth() - av.getCharHeight(), getWidth() }, + new int[] { (i - starty + 1) * av.getCharHeight() + yoffset, (i - starty + 1) * av.getCharHeight() + yoffset - av.getCharHeight() / 4,