Merge branch 'Jalview-JS/develop' into merge_js_develop
[jalview.git] / src / jalview / appletgui / AnnotationPanel.java
index 88408bb..aa08e79 100755 (executable)
@@ -51,6 +51,17 @@ import java.awt.event.MouseListener;
 import java.awt.event.MouseMotionListener;
 import java.beans.PropertyChangeEvent;
 
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.SequenceI;
+import jalview.renderer.AnnotationRenderer;
+import jalview.renderer.AwtRenderPanelI;
+import jalview.schemes.ResidueProperties;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+import jalview.viewmodel.ViewportListenerI;
+import jalview.viewmodel.ViewportRanges;
+
 public class AnnotationPanel extends Panel
         implements AwtRenderPanelI, AdjustmentListener, ActionListener,
         MouseListener, MouseMotionListener, ViewportListenerI
@@ -99,14 +110,14 @@ public class AnnotationPanel extends Panel
 
   public static int GRAPH_HEIGHT = 40;
 
-  boolean MAC = false;
+//  boolean MAC = false;
 
   public final AnnotationRenderer renderer;
 
   public AnnotationPanel(AlignmentPanel ap)
   {
     new jalview.util.Platform();
-    MAC = Platform.isAMac();
+//    MAC = Platform.isAMac();
     this.ap = ap;
     av = ap.av;
     setLayout(null);
@@ -354,8 +365,8 @@ public class AnnotationPanel extends Panel
       }
     }
 
-    if ((evt.getModifiers()
-            & InputEvent.BUTTON3_MASK) == InputEvent.BUTTON3_MASK
+    if ((evt.getModifiersEx()
+            & InputEvent.BUTTON3_DOWN_MASK) == InputEvent.BUTTON3_DOWN_MASK
             && activeRow != -1)
     {
       if (av.getColumnSelection() == null
@@ -439,7 +450,8 @@ public class AnnotationPanel extends Panel
       graphStretchY = evt.getY();
       av.calcPanelHeight();
       needValidating = true;
-      ap.paintAlignment(true);
+      // TODO: only update overview visible geometry
+      ap.paintAlignment(true, false);
     }
     else
     {
@@ -479,7 +491,7 @@ public class AnnotationPanel extends Panel
     if (av.hasHiddenColumns())
     {
       column = av.getAlignment().getHiddenColumns()
-              .adjustForHiddenColumns(column);
+              .visibleToAbsoluteColumn(column);
     }
 
     if (row > -1 && column < aa[row].annotations.length
@@ -782,5 +794,9 @@ public class AnnotationPanel extends Panel
       fastPaint(((int[]) evt.getNewValue())[0]
               - ((int[]) evt.getOldValue())[0]);
     }
+    else if (evt.getPropertyName().equals(ViewportRanges.MOVE_VIEWPORT))
+    {
+      repaint();
+    }
   }
 }