Merge branch 'features/JAL-2360colourSchemeApplicability' into features/JAL-2371colle...
[jalview.git] / src / jalview / gui / AlignViewport.java
index d0a0f11..35a87d4 100644 (file)
@@ -37,9 +37,12 @@ import jalview.datamodel.AlignmentI;
 import jalview.datamodel.ColumnSelection;
 import jalview.datamodel.PDBEntry;
 import jalview.datamodel.SearchResults;
+import jalview.datamodel.SearchResultsI;
 import jalview.datamodel.Sequence;
 import jalview.datamodel.SequenceGroup;
 import jalview.datamodel.SequenceI;
+import jalview.schemes.CollectionColourScheme;
+import jalview.schemes.ColourSchemeI;
 import jalview.schemes.ColourSchemeProperty;
 import jalview.schemes.UserColourScheme;
 import jalview.structure.CommandListener;
@@ -60,7 +63,6 @@ import java.util.List;
 import java.util.Vector;
 
 import javax.swing.JInternalFrame;
-import javax.swing.JOptionPane;
 
 /**
  * DOCUMENT ME!
@@ -291,14 +293,15 @@ public class AlignViewport extends AlignmentViewport implements
     }
     if (propertyValue != null)
     {
-      globalColourScheme = ColourSchemeProperty.getColour(alignment,
-              propertyValue);
+      ColourSchemeI colourScheme = ColourSchemeProperty.getColourScheme(
+              alignment, propertyValue);
+      globalColourScheme = new CollectionColourScheme(colourScheme);
 
-      if (globalColourScheme instanceof UserColourScheme)
+      if (colourScheme instanceof UserColourScheme)
       {
-        globalColourScheme = UserDefinedColours.loadDefaultColours();
-        ((UserColourScheme) globalColourScheme).setThreshold(0,
-                isIgnoreGapsConsensus());
+        globalColourScheme = new CollectionColourScheme(
+                UserDefinedColours.loadDefaultColours());
+        globalColourScheme.setThreshold(0, isIgnoreGapsConsensus());
       }
 
       if (globalColourScheme != null)
@@ -875,9 +878,9 @@ public class AlignViewport extends AlignmentViewport implements
         MessageManager.getString("label.new_window"), };
     final String question = JvSwingUtils.wrapTooltip(true,
             MessageManager.getString("label.open_split_window?"));
-    int response = JOptionPane.showOptionDialog(Desktop.desktop, question,
+    int response = JvOptionPane.showOptionDialog(Desktop.desktop, question,
             MessageManager.getString("label.open_split_window"),
-            JOptionPane.DEFAULT_OPTION, JOptionPane.PLAIN_MESSAGE, null,
+            JvOptionPane.DEFAULT_OPTION, JvOptionPane.PLAIN_MESSAGE, null,
             options, options[0]);
 
     if (response != 1 && response != 2)
@@ -917,7 +920,7 @@ public class AlignViewport extends AlignmentViewport implements
 
     // TODO if we want this (e.g. to enable reload of the alignment from file),
     // we will need to add parameters to the stack.
-    // if (!protocol.equals(AppletFormatAdapter.PASTE))
+    // if (!protocol.equals(DataSourceType.PASTE))
     // {
     // alignFrame.setFileName(file, format);
     // }
@@ -1042,7 +1045,7 @@ public class AlignViewport extends AlignmentViewport implements
      * there is no complement, or it is not following highlights, or no mapping
      * is found, the result will be empty.
      */
-    SearchResults sr = new SearchResults();
+    SearchResultsI sr = new SearchResults();
     int verticalOffset = findComplementScrollTarget(sr);
     if (!sr.isEmpty())
     {