From: Jim Procter Date: Fri, 6 May 2016 13:09:53 +0000 (+0100) Subject: JAL-2100 triangles shown below in jvdesktop unwrapped ruler X-Git-Tag: Release_2_10_0~227^2~2^2~9 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=0673686a4ceda776a64350afd35ecff18e74e575;p=jalview.git JAL-2100 triangles shown below in jvdesktop unwrapped ruler --- diff --git a/src/jalview/gui/ScalePanel.java b/src/jalview/gui/ScalePanel.java index 41b46a7..7c9b57e 100755 --- a/src/jalview/gui/ScalePanel.java +++ b/src/jalview/gui/ScalePanel.java @@ -488,6 +488,39 @@ public class ScalePanel extends JPanel implements MouseMotionListener, } } } + + int widthx = 1 + endx - startx; + + FontMetrics fm = gg.getFontMetrics(av.getFont()); + int y = avCharHeight - fm.getDescent(); + + if (av.hasHiddenColumns()) + { + // draw any hidden column markers + gg.setColor(Color.blue); + int res; + if (av.getShowHiddenMarkers() + && av.getColumnSelection().getHiddenColumns() != null) + { + for (int i = 0; i < av.getColumnSelection().getHiddenColumns() + .size(); i++) + { + res = av.getColumnSelection().findHiddenRegionPosition(i) + - startx; + + if (res < 0 || res > widthx) + { + continue; + } + + gg.fillPolygon(new int[] { res * avCharWidth - avCharHeight / 4, + res * avCharWidth + avCharHeight / 4, res * avCharWidth }, + new int[] { y - avCharHeight / 2, y - avCharHeight / 2, + y + 8 }, 3); + + } + } + } // Draw the scale numbers gg.setColor(Color.black); @@ -512,11 +545,6 @@ public class ScalePanel extends JPanel implements MouseMotionListener, } - int widthx = 1 + endx - startx; - - FontMetrics fm = gg.getFontMetrics(av.getFont()); - int y = avCharHeight - fm.getDescent(); - if (refSeq == null && scalestartx % 10 == 0) { scalestartx += 5; @@ -575,30 +603,6 @@ public class ScalePanel extends JPanel implements MouseMotionListener, if (av.hasHiddenColumns()) { - gg.setColor(Color.blue); - int res; - if (av.getShowHiddenMarkers() - && av.getColumnSelection().getHiddenColumns() != null) - { - for (int i = 0; i < av.getColumnSelection().getHiddenColumns() - .size(); i++) - { - res = av.getColumnSelection().findHiddenRegionPosition(i) - - startx; - - if (res < 0 || res > widthx) - { - continue; - } - - gg.fillPolygon(new int[] { res * avCharWidth - avCharHeight / 4, - res * avCharWidth + avCharHeight / 4, res * avCharWidth }, - new int[] { y - avCharHeight / 2, y - avCharHeight / 2, - y + 8 }, 3); - - } - } - if (reveal != null && reveal[0] > startx && reveal[0] < endx) { gg.drawString(MessageManager.getString("label.reveal_columns"),