Merge branch 'develop' into patch/JAL-4281_idwidthandannotHeight_in_project
[jalview.git] / src / jalview / gui / IdCanvas.java
index 2df84a9..dbffc72 100755 (executable)
@@ -307,7 +307,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
     if (alignViewport.getWrapAlignment())
     {
-      drawIdsWrapped(g, alignViewport, startSeq, getHeight());
+      drawIdsWrapped(g, alignViewport, startSeq, getHeight(), manuallyAdjusted ? panelWidth : -1,forGUI);
       return;
     }
 
@@ -401,7 +401,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     drawIdsWrapped(g, av2, totalHeight, totalHeight, i,false);
   }
 
-  void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
+  public void drawIdsWrapped(Graphics2D g, AlignViewport alignViewport,
           int startSeq, int pageHeight, int idWidth, boolean forGUI)
   {
     int alignmentWidth = alignViewport.getAlignment().getWidth();
@@ -418,6 +418,8 @@ public class IdCanvas extends JPanel implements ViewportListenerI
     AnnotationLabels labels = null;
     if (alignViewport.isShowAnnotation())
     {
+      // in wrapped mode, no alignPanel reference is available
+      // FIXME: make the renderer not create a new object in wrapped mode everytime!
       labels = new AnnotationLabels(alignViewport);
     }
 
@@ -453,7 +455,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
         int getWidth = getWidth();
         int thisIdWidth = getWidth;
         g.translate(0, ypos + (alheight * charHeight));
-        if (!manuallyAdjusted())
+        if (!isManuallyAdjusted())
         {
           int getAnnotationsIdWidth = labels.drawLabels(g, false, -1, false,forGUI,
                   null, false);
@@ -625,7 +627,7 @@ public class IdCanvas extends JPanel implements ViewportListenerI
 
   private boolean manuallyAdjusted = false;
 
-  public boolean manuallyAdjusted()
+  public boolean isManuallyAdjusted()
   {
     return manuallyAdjusted;
   }