JAL-4090 JAL-1551 spotlessApply
[jalview.git] / src / jalview / viewmodel / AlignmentViewport.java
index 975b292..3e1bc63 100644 (file)
@@ -50,6 +50,8 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.AlignmentView;
 import jalview.datamodel.Annotation;
 import jalview.datamodel.ColumnSelection;
+import jalview.datamodel.ContactListI;
+import jalview.datamodel.ContactMatrixI;
 import jalview.datamodel.HiddenColumns;
 import jalview.datamodel.HiddenSequences;
 import jalview.datamodel.ProfilesI;
@@ -58,6 +60,7 @@ import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceCollectionI;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
+import jalview.gui.QuitHandler;
 import jalview.project.Jalview2XML;
 import jalview.renderer.ResidueShader;
 import jalview.renderer.ResidueShaderI;
@@ -104,7 +107,7 @@ public abstract class AlignmentViewport
   /**
    * used to determine if quit should be confirmed
    */
-  private boolean savedUpToDate = true;
+  private boolean savedUpToDate = false;
 
   /**
    * alignment displayed in the viewport. Please use get/setter
@@ -931,7 +934,8 @@ public abstract class AlignmentViewport
     }
     if (calculator.workingInvolvedWith(alignmentAnnotation))
     {
-      // System.err.println("grey out ("+alignmentAnnotation.label+")");
+      // jalview.bin.Console.errPrintln("grey out
+      // ("+alignmentAnnotation.label+")");
       return true;
     }
     return false;
@@ -1204,7 +1208,7 @@ public abstract class AlignmentViewport
   {
     if (sequenceSetID != null)
     {
-      System.err.println(
+      jalview.bin.Console.errPrintln(
               "Warning - overwriting a sequenceSetId for a viewport!");
     }
     sequenceSetID = new String(newid);
@@ -2097,7 +2101,7 @@ public abstract class AlignmentViewport
       {
         if (aa == null)
         {
-          System.err.println("Null annotation row: ignoring.");
+          jalview.bin.Console.errPrintln("Null annotation row: ignoring.");
           continue;
         }
         if (!aa.visible)
@@ -2129,7 +2133,7 @@ public abstract class AlignmentViewport
 
         if (aa.graph > 0)
         {
-          aa.height += aa.graphHeight;
+          aa.height += aa.graphHeight + 20;
         }
 
         if (aa.height == 0)
@@ -2290,7 +2294,8 @@ public abstract class AlignmentViewport
   {
     if (this == av)
     {
-      System.err.println("Ignoring recursive setCodingComplement request");
+      jalview.bin.Console
+              .errPrintln("Ignoring recursive setCodingComplement request");
     }
     else
     {
@@ -2940,6 +2945,19 @@ public abstract class AlignmentViewport
     return searchResults;
   }
 
+  @Override
+  public ContactListI getContactList(AlignmentAnnotation _aa, int column)
+  {
+    return alignment.getContactListFor(_aa, column);
+  }
+
+  @Override
+  public ContactMatrixI getContactMatrix(
+          AlignmentAnnotation alignmentAnnotation)
+  {
+    return alignment.getContactMatrixFor(alignmentAnnotation);
+  }
+
   /**
    * get the consensus sequence as displayed under the PID consensus annotation
    * row.
@@ -3108,9 +3126,15 @@ public abstract class AlignmentViewport
 
   public void setSavedUpToDate(boolean s)
   {
+    setSavedUpToDate(s, QuitHandler.Message.UNSAVED_CHANGES);
+  }
+
+  public void setSavedUpToDate(boolean s, QuitHandler.Message m)
+  {
     Console.debug(
             "Setting " + this.getViewId() + " setSavedUpToDate to " + s);
     savedUpToDate = s;
+    QuitHandler.setMessage(m);
   }
 
   public boolean savedUpToDate()