Jalview-JS/JAL-3253-applet additional static final preferences
[jalview.git] / src / jalview / gui / CalculationChooser.java
index a41a998..45bf2d7 100644 (file)
@@ -156,12 +156,15 @@ public class CalculationChooser extends JPanel
     pca = new JRadioButton(
             MessageManager.getString("label.principal_component_analysis"));
     pca.setOpaque(false);
+    
     neighbourJoining = new JRadioButton(
             MessageManager.getString("label.tree_calc_nj"));
     neighbourJoining.setSelected(true);
+    neighbourJoining.setOpaque(false);
+
     averageDistance = new JRadioButton(
             MessageManager.getString("label.tree_calc_av"));
-    neighbourJoining.setOpaque(false);
+    averageDistance.setOpaque(false);
 
     JPanel calcChoicePanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
     calcChoicePanel.setOpaque(false);
@@ -271,9 +274,9 @@ public class CalculationChooser extends JPanel
 
     setMinimumSize(new Dimension(325, height - 10));
     String title = MessageManager.getString("label.choose_calculation");
-    if (af.getViewport().viewName != null)
+    if (af.getViewport().getViewName() != null)
     {
-      title = title + " (" + af.getViewport().viewName + ")";
+      title = title + " (" + af.getViewport().getViewName() + ")";
     }
 
     Desktop.addInternalFrame(frame, title, width, height, false);
@@ -291,6 +294,7 @@ public class CalculationChooser extends JPanel
       };
     });
 
+    validateCalcTypes();
     frame.setLayer(JLayeredPane.PALETTE_LAYER);
   }
 
@@ -496,7 +500,8 @@ public class CalculationChooser extends JPanel
      * for backwards compatibility with Jalview < 2.8 (JAL-2962)
      */
     if (nucleotide && forPca
-            && Cache.getDefault("BLOSUM62_PCA_FOR_NUCLEOTIDE", false))
+            && Cache.getDefault(Preferences.BLOSUM62_PCA_FOR_NUCLEOTIDE,
+                    false))
     {
       filtered.add(scoreModels.getBlosum62());
     }
@@ -541,7 +546,7 @@ public class CalculationChooser extends JPanel
     SequenceGroup sg = viewport.getSelectionGroup();
     if (sg != null && sg.getSize() < MIN_TREE_SELECTION)
     {
-      JvOptionPane.showMessageDialog(Desktop.desktop,
+      JvOptionPane.showMessageDialog(Desktop.getDesktopPane(),
               MessageManager.formatMessage(
                       "label.you_need_at_least_n_sequences",
                       MIN_TREE_SELECTION),