JAL-244 Added light grey marks to indicate regions to resize the margins
[jalview.git] / src / jalview / gui / IdwidthAdjuster.java
index 8a6c7eb..4596e1f 100755 (executable)
@@ -30,6 +30,7 @@ import java.awt.event.MouseMotionListener;
 import javax.swing.JPanel;
 
 import jalview.api.AlignViewportI;
+import jalview.bin.Cache;
 
 /**
  * DOCUMENT ME!
@@ -199,8 +200,21 @@ public class IdwidthAdjuster extends JPanel
   @Override
   public void paintComponent(Graphics g)
   {
+    int width = getWidth();
+    int height = getHeight();
     g.setColor(Color.white);
-    g.fillRect(0, 0, getWidth(), getHeight());
+    g.fillRect(0, 0, width, height);
+
+    if (!Cache.getDefault(AnnotationLabels.RESIZE_MARGINS_MARK_PREF, false))
+    // && !ap.getAlignViewport().getWrapAlignment()) // now allowing adjustment
+    // in wrap mode
+    {
+      int spacer = Math.max(2, AnnotationLabels.HEIGHT_ADJUSTER_HEIGHT / 4);
+      g.setColor(Color.LIGHT_GRAY);
+      g.drawLine(width - 3 * spacer, 0, width - 3 * spacer, height / 2);
+      g.drawLine(width - spacer, 0, width - spacer, height / 2);
+    }
+
     setCursor(Cursor.getPredefinedCursor(Cursor.W_RESIZE_CURSOR));
   }
 }