From: gmungoc Date: Thu, 27 Aug 2015 14:24:34 +0000 (+0100) Subject: JAL-845 compacting duplicated code X-Git-Tag: Jalview_2_9~10^2~6 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=c59d5663482450a2eb646e64b33b1967fa749ce3;p=jalview.git JAL-845 compacting duplicated code --- 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(); }; }); }