Wrap alignment with annotations
[jalview.git] / src / jalview / appletgui / RotatableCanvas.java
index 9fa7491..82207a2 100755 (executable)
@@ -80,12 +80,19 @@ public class RotatableCanvas
   float scalefactor = 1;\r
 \r
   AlignViewport av;\r
+  boolean showLabels = false;\r
 \r
   public RotatableCanvas(AlignViewport av)\r
   {\r
     this.av = av;\r
   }\r
 \r
+  public void showLabels(boolean b)\r
+  {\r
+    showLabels = b;\r
+    repaint();\r
+  }\r
+\r
   public void setPoints(Vector points, int npoint)\r
   {\r
     this.points = points;\r
@@ -376,7 +383,14 @@ public class RotatableCanvas
       }\r
 \r
       g.fillRect(x - 3, y - 3, 6, 6);\r
-      g.setColor(Color.red);\r
+      if (showLabels)\r
+      {\r
+        g.setColor(Color.red);\r
+        g.drawString( ( (SequencePoint) points.elementAt(i)).sequence.\r
+                     getName(),\r
+                     x - 3, y - 4);\r
+      }\r
+\r
     }\r
 //    //Now the rectangle\r
 //    if (rectx2 != -1 && recty2 != -1) {\r