X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fappletgui%2FScalePanel.java;h=e00db7c3e2a0f2c778c76e1b155f291c6181126a;hb=5e92df41fe4f6fa8b50c3a65000bdb8ddcdc901f;hp=5e0a2fd02eeeeef28e736a9de1701499703a3809;hpb=bcb27a1f7be90472b18d795f0ffca68dac95e7de;p=jalview.git diff --git a/src/jalview/appletgui/ScalePanel.java b/src/jalview/appletgui/ScalePanel.java index 5e0a2fd..e00db7c 100755 --- a/src/jalview/appletgui/ScalePanel.java +++ b/src/jalview/appletgui/ScalePanel.java @@ -44,8 +44,8 @@ import java.awt.event.MouseMotionListener; import java.beans.PropertyChangeEvent; import java.util.List; -public class ScalePanel extends Panel implements MouseMotionListener, - MouseListener, ViewportListenerI +public class ScalePanel extends Panel + implements MouseMotionListener, MouseListener, ViewportListenerI { protected int offy = 4; @@ -95,7 +95,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, min = res; max = res; - if ((evt.getModifiers() & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) + if ((evt.getModifiers() + & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK) { rightMouseButtonPressed(evt, res); } @@ -157,7 +158,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, PopupMenu pop = new PopupMenu(); if (reveal != null) { - MenuItem item = new MenuItem(MessageManager.getString("label.reveal")); + MenuItem item = new MenuItem( + MessageManager.getString("label.reveal")); item.addActionListener(new ActionListener() { @Override @@ -200,9 +202,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, public void actionPerformed(ActionEvent e) { av.hideColumns(res, res); - if (av.getSelectionGroup() != null - && av.getSelectionGroup().getSize() == av.getAlignment() - .getHeight()) + if (av.getSelectionGroup() != null && av.getSelectionGroup() + .getSize() == av.getAlignment().getHeight()) { av.setSelectionGroup(null); } @@ -344,8 +345,8 @@ public class ScalePanel extends Panel implements MouseMotionListener, */ if (!av.getWrapAlignment()) { - drawScale(g, av.getRanges().getStartRes(), - av.getRanges().getEndRes(), getSize().width, getSize().height); + drawScale(g, av.getRanges().getStartRes(), av.getRanges().getEndRes(), + getSize().width, getSize().height); } } @@ -435,21 +436,19 @@ public class ScalePanel extends Panel implements MouseMotionListener, if (av.getShowHiddenMarkers()) { int widthx = 1 + endx - startx; - List positions = hidden.findHiddenRegionPositions(); + List positions = hidden.findHiddenRegionPositions(startx, + startx + widthx + 1); for (int pos : positions) { - res = pos - startx; - if (res < 0 || res > widthx) - { - continue; - } - - gg.fillPolygon(new int[] { - -1 + res * avCharWidth - avcharHeight / 4, - -1 + res * avCharWidth + avcharHeight / 4, - -1 + res * avCharWidth }, new int[] { y, y, y + 2 * yOf }, 3); + gg.fillPolygon( + new int[] + { -1 + res * avCharWidth - avcharHeight / 4, + -1 + res * avCharWidth + avcharHeight / 4, + -1 + res * avCharWidth }, + new int[] + { y, y, y + 2 * yOf }, 3); } } }