JAL-845 compacting duplicated code
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 27 Aug 2015 14:24:34 +0000 (15:24 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Thu, 27 Aug 2015 14:24:34 +0000 (15:24 +0100)
src/jalview/gui/SplitFrame.java

index a665f5c..aa658ce 100644 (file)
@@ -1,5 +1,13 @@
 package jalview.gui;
 
+import jalview.api.SplitContainerI;
+import jalview.api.ViewStyleI;
+import jalview.datamodel.AlignmentI;
+import jalview.jbgui.GAlignFrame;
+import jalview.jbgui.GSplitFrame;
+import jalview.structure.StructureSelectionManager;
+import jalview.viewmodel.AlignmentViewport;
+
 import java.awt.Component;
 import java.awt.Toolkit;
 import java.awt.event.ActionEvent;
@@ -18,14 +26,6 @@ import javax.swing.KeyStroke;
 import javax.swing.event.InternalFrameAdapter;
 import javax.swing.event.InternalFrameEvent;
 
-import jalview.api.SplitContainerI;
-import jalview.api.ViewStyleI;
-import jalview.datamodel.AlignmentI;
-import jalview.jbgui.GAlignFrame;
-import jalview.jbgui.GSplitFrame;
-import jalview.structure.StructureSelectionManager;
-import jalview.viewmodel.AlignmentViewport;
-
 /**
  * An internal frame on the desktop that hosts a horizontally split view of
  * linked DNA and Protein alignments. Additional views can be created in linked
@@ -144,16 +144,7 @@ public class SplitFrame extends GSplitFrame implements SplitContainerI
       @Override
       public void internalFrameClosed(InternalFrameEvent evt)
       {
-        if (getTopFrame() instanceof AlignFrame)
-        {
-          ((AlignFrame) getTopFrame())
-                  .closeMenuItem_actionPerformed(true);
-        }
-        if (getBottomFrame() instanceof AlignFrame)
-        {
-          ((AlignFrame) getBottomFrame())
-                  .closeMenuItem_actionPerformed(true);
-        }
+        close();
       };
     });
   }