From 0673686a4ceda776a64350afd35ecff18e74e575 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Fri, 6 May 2016 14:09:53 +0100 Subject: [PATCH] JAL-2100 triangles shown below in jvdesktop unwrapped ruler --- src/jalview/gui/ScalePanel.java | 62 +++++++++++++++++++++------------------ 1 file changed, 33 insertions(+), 29 deletions(-) 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"), -- 1.7.10.2