From c59d5663482450a2eb646e64b33b1967fa749ce3 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Thu, 27 Aug 2015 15:24:34 +0100 Subject: [PATCH] JAL-845 compacting duplicated code --- src/jalview/gui/SplitFrame.java | 27 +++++++++------------------ 1 file changed, 9 insertions(+), 18 deletions(-) diff --git a/src/jalview/gui/SplitFrame.java b/src/jalview/gui/SplitFrame.java index a665f5c..aa658ce 100644 --- a/src/jalview/gui/SplitFrame.java +++ b/src/jalview/gui/SplitFrame.java @@ -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(); }; }); } -- 1.7.10.2