Right align print and images
authoramwaterhouse <Andrew Waterhouse>
Tue, 21 Nov 2006 16:25:12 +0000 (16:25 +0000)
committeramwaterhouse <Andrew Waterhouse>
Tue, 21 Nov 2006 16:25:12 +0000 (16:25 +0000)
src/jalview/gui/AlignmentPanel.java

index 0012ec4..1574d03 100755 (executable)
@@ -736,8 +736,17 @@ public class AlignmentPanel extends GAlignmentPanel
 \r
       pg.setColor(currentTextColor);\r
 \r
+      int xPos = 0;\r
+      if (av.rightAlignIds)\r
+      {\r
+        fm = pg.getFontMetrics();\r
+        xPos = idWidth - fm.stringWidth(\r
+            seq.getDisplayId(av.getShowJVSuffix())\r
+            ) - 4;\r
+      }\r
+\r
       pg.drawString(seq.getDisplayId( av.getShowJVSuffix()),\r
-                    0,\r
+                    xPos,\r
                     ( ( (i - startSeq) * av.charHeight) + av.getCharHeight()) -\r
                     (av.getCharHeight() / 5));\r
     }\r
@@ -828,8 +837,13 @@ public class AlignmentPanel extends GAlignmentPanel
       {\r
         SequenceI s = av.alignment.getSequenceAt(i);\r
         String string = s.getDisplayId( av.getShowJVSuffix());\r
-\r
-        pg.drawString(string, 0,\r
+        int xPos = 0;\r
+        if (av.rightAlignIds)\r
+        {\r
+          FontMetrics fm = getFontMetrics(italic);\r
+          xPos = idWidth - fm.stringWidth( string ) - 4;\r
+        }\r
+        pg.drawString(string, xPos,\r
                       ( (i * av.charHeight) + ypos + av.charHeight) -\r
                       (av.charHeight / 5));\r
       }\r