JAL-3416 Ensure setFrameIcon(null) is set for remaining JInternalFrames
[jalview.git] / src / jalview / jbgui / GPCAPanel.java
index 774641c..cf7bc4e 100755 (executable)
@@ -20,8 +20,6 @@
  */
 package jalview.jbgui;
 
-import jalview.util.MessageManager;
-
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.FlowLayout;
@@ -42,17 +40,18 @@ import javax.swing.JPanel;
 import javax.swing.event.MenuEvent;
 import javax.swing.event.MenuListener;
 
+import jalview.util.ImageMaker.TYPE;
+import jalview.util.MessageManager;
+
 public class GPCAPanel extends JInternalFrame
 {
   private static final Font VERDANA_12 = new Font("Verdana", 0, 12);
 
-  protected JComboBox<String> xCombobox = new JComboBox<String>();
-
-  protected JComboBox<String> yCombobox = new JComboBox<String>();
+  protected JComboBox<String> xCombobox = new JComboBox<>();
 
-  protected JComboBox<String> zCombobox = new JComboBox<String>();
+  protected JComboBox<String> yCombobox = new JComboBox<>();
 
-  protected JMenu scoreMatrixMenu = new JMenu();
+  protected JComboBox<String> zCombobox = new JComboBox<>();
 
   protected JMenu viewMenu = new JMenu();
 
@@ -60,18 +59,15 @@ public class GPCAPanel extends JInternalFrame
 
   protected JMenu associateViewsMenu = new JMenu();
 
-  protected JMenu calcSettings = new JMenu();
-
-  protected JCheckBoxMenuItem nuclSetting = new JCheckBoxMenuItem();
-
-  protected JCheckBoxMenuItem protSetting = new JCheckBoxMenuItem();
-
-  protected JCheckBoxMenuItem jvVersionSetting = new JCheckBoxMenuItem();
-
   protected JLabel statusBar = new JLabel();
 
   protected JPanel statusPanel = new JPanel();
 
+  protected JMenuItem originalSeqData;
+
+  /**
+   * Constructor
+   */
   public GPCAPanel()
   {
     try
@@ -92,6 +88,8 @@ public class GPCAPanel extends JInternalFrame
 
   private void jbInit() throws Exception
   {
+    setFrameIcon(null);
+    setName("jalview-pca");
     this.getContentPane().setLayout(new BorderLayout());
     JPanel jPanel2 = new JPanel();
     jPanel2.setLayout(new FlowLayout());
@@ -112,7 +110,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        zCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     yCombobox.setFont(VERDANA_12);
@@ -121,7 +119,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        yCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     xCombobox.setFont(VERDANA_12);
@@ -130,7 +128,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        xCombobox_actionPerformed(e);
+        doDimensionChange();
       }
     });
     JButton resetButton = new JButton();
@@ -141,7 +139,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        resetButton_actionPerformed(e);
+        resetButton_actionPerformed();
       }
     });
     JMenu fileMenu = new JMenu();
@@ -154,7 +152,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        eps_actionPerformed(e);
+        makePCAImage(TYPE.EPS);
       }
     });
     JMenuItem png = new JMenuItem("PNG");
@@ -163,7 +161,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        png_actionPerformed(e);
+        makePCAImage(TYPE.PNG);
       }
     });
     JMenuItem outputValues = new JMenuItem();
@@ -173,7 +171,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputValues_actionPerformed(e);
+        outputValues_actionPerformed();
       }
     });
     JMenuItem outputPoints = new JMenuItem();
@@ -183,18 +181,18 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputPoints_actionPerformed(e);
+        outputPoints_actionPerformed();
       }
     });
     JMenuItem outputProjPoints = new JMenuItem();
-    outputProjPoints.setText(MessageManager
-            .getString("label.output_transformed_points"));
+    outputProjPoints.setText(
+            MessageManager.getString("label.output_transformed_points"));
     outputProjPoints.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        outputProjPoints_actionPerformed(e);
+        outputProjPoints_actionPerformed();
       }
     });
     JMenuItem print = new JMenuItem();
@@ -204,7 +202,7 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        print_actionPerformed(e);
+        print_actionPerformed();
       }
     });
     viewMenu.setText(MessageManager.getString("action.view"));
@@ -226,33 +224,13 @@ public class GPCAPanel extends JInternalFrame
       {
       }
     });
-    scoreMatrixMenu.setText(MessageManager
-            .getString("label.select_score_model"));
-    scoreMatrixMenu.addMenuListener(new MenuListener()
-    {
-      @Override
-      public void menuSelected(MenuEvent e)
-      {
-        scoreMatrix_menuSelected();
-      }
-
-      @Override
-      public void menuDeselected(MenuEvent e)
-      {
-      }
-
-      @Override
-      public void menuCanceled(MenuEvent e)
-      {
-      }
-    });
     showLabels.setText(MessageManager.getString("label.show_labels"));
     showLabels.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        showLabels_actionPerformed(e);
+        showLabels_actionPerformed();
       }
     });
     JMenuItem bgcolour = new JMenuItem();
@@ -262,57 +240,22 @@ public class GPCAPanel extends JInternalFrame
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        bgcolour_actionPerformed(e);
+        bgcolour_actionPerformed();
       }
     });
-    JMenuItem originalSeqData = new JMenuItem();
+    originalSeqData = new JMenuItem();
     originalSeqData.setText(MessageManager.getString("label.input_data"));
     originalSeqData.addActionListener(new ActionListener()
     {
       @Override
       public void actionPerformed(ActionEvent e)
       {
-        originalSeqData_actionPerformed(e);
+        originalSeqData_actionPerformed();
       }
     });
-    associateViewsMenu.setText(MessageManager
-            .getString("label.associate_nodes_with"));
-    calcSettings.setText(MessageManager.getString("action.change_params"));
-    nuclSetting
-            .setText(MessageManager.getString("label.nucleotide_matrix"));
-    protSetting.setText(MessageManager.getString("label.protein_matrix"));
-    nuclSetting.addActionListener(new ActionListener()
-    {
+    associateViewsMenu.setText(
+            MessageManager.getString("label.associate_nodes_with"));
 
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        nuclSetting_actionPerfomed(arg0);
-      }
-    });
-    protSetting.addActionListener(new ActionListener()
-    {
-
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        protSetting_actionPerfomed(arg0);
-      }
-    });
-    jvVersionSetting.setText(MessageManager
-            .getString("label.jalview_pca_calculation"));
-    jvVersionSetting.addActionListener(new ActionListener()
-    {
-      @Override
-      public void actionPerformed(ActionEvent arg0)
-      {
-        jvVersionSetting_actionPerfomed(arg0);
-      }
-    });
-    // calcSettings.add(jvVersionSetting); // todo remove? JAL-2416
-    calcSettings.add(nuclSetting);
-    calcSettings.add(protSetting);
-    calcSettings.add(scoreMatrixMenu);
     statusPanel.setLayout(new GridLayout());
     statusBar.setFont(VERDANA_12);
     // statusPanel.setBackground(Color.lightGray);
@@ -333,7 +276,6 @@ public class GPCAPanel extends JInternalFrame
     JMenuBar jMenuBar1 = new JMenuBar();
     jMenuBar1.add(fileMenu);
     jMenuBar1.add(viewMenu);
-    jMenuBar1.add(calcSettings);
     setJMenuBar(jMenuBar1);
     fileMenu.add(saveMenu);
     fileMenu.add(outputValues);
@@ -348,97 +290,47 @@ public class GPCAPanel extends JInternalFrame
     viewMenu.add(associateViewsMenu);
   }
 
-  protected void scoreMatrix_menuSelected()
-  {
-    // TODO Auto-generated method stub
-
-  }
-
-  protected void resetButton_actionPerformed(ActionEvent e)
-  {
-    // TODO Auto-generated method stub
-
-  }
-
-  protected void protSetting_actionPerfomed(ActionEvent arg0)
+  protected void resetButton_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void nuclSetting_actionPerfomed(ActionEvent arg0)
+  protected void outputPoints_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void outputPoints_actionPerformed(ActionEvent e)
+  protected void outputProjPoints_actionPerformed()
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void outputProjPoints_actionPerformed(ActionEvent e)
+  public void makePCAImage(TYPE imageType)
   {
-    // TODO Auto-generated method stub
-
   }
 
-  protected void xCombobox_actionPerformed(ActionEvent e)
+  protected void outputValues_actionPerformed()
   {
   }
 
-  protected void yCombobox_actionPerformed(ActionEvent e)
+  protected void print_actionPerformed()
   {
   }
 
-  protected void zCombobox_actionPerformed(ActionEvent e)
+  protected void showLabels_actionPerformed()
   {
   }
 
-  public void eps_actionPerformed(ActionEvent e)
+  protected void bgcolour_actionPerformed()
   {
-
   }
 
-  public void png_actionPerformed(ActionEvent e)
+  protected void originalSeqData_actionPerformed()
   {
-
   }
 
-  public void outputValues_actionPerformed(ActionEvent e)
+  protected void viewMenu_menuSelected()
   {
-
   }
 
-  public void print_actionPerformed(ActionEvent e)
+  protected void doDimensionChange()
   {
-
-  }
-
-  public void showLabels_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void bgcolour_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void originalSeqData_actionPerformed(ActionEvent e)
-  {
-
-  }
-
-  public void viewMenu_menuSelected()
-  {
-
-  }
-
-  protected void jvVersionSetting_actionPerfomed(ActionEvent arg0)
-  {
-    // TODO Auto-generated method stub
-
   }
 }