X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FAquaInternalFrameManager.java;h=537ec17f60d13c675c4a1745bf77c1b98aae507b;hb=8334a9d216c71bd0960ea01e2991c26382a139b7;hp=92830dc9bcf2aad3fd490b52e3fcc0254226f3ee;hpb=c5cce447dc326bdd6d0d2dc3061ad1f27a1ae425;p=jalview.git diff --git a/src/jalview/gui/AquaInternalFrameManager.java b/src/jalview/gui/AquaInternalFrameManager.java index 92830dc..537ec17 100644 --- a/src/jalview/gui/AquaInternalFrameManager.java +++ b/src/jalview/gui/AquaInternalFrameManager.java @@ -26,15 +26,13 @@ package jalview.gui; import java.awt.Container; -import java.awt.Rectangle; import java.beans.PropertyVetoException; import java.util.Vector; import javax.swing.DefaultDesktopManager; +import javax.swing.DesktopManager; import javax.swing.JInternalFrame; -import com.apple.laf.AquaInternalFramePaneUI; - /** * Based on AquaInternalFrameManager * @@ -62,7 +60,7 @@ import com.apple.laf.AquaInternalFramePaneUI; * around to the bottom of the window stack (as the original implementation * does) * - * @see com.sun.java.swing.plaf.windows.WindowsDesktopManager + * see com.sun.java.swing.plaf.windows.WindowsDesktopManager */ public class AquaInternalFrameManager extends DefaultDesktopManager { @@ -75,8 +73,6 @@ public class AquaInternalFrameManager extends DefaultDesktopManager JInternalFrame fInitialFrame; - AquaInternalFramePaneUI fCurrentPaneUI; - /* The list of frames, sorted by order of creation. * This list is necessary because by default the order of * child frames in the JDesktopPane changes during frame @@ -86,6 +82,17 @@ public class AquaInternalFrameManager extends DefaultDesktopManager */ Vector fChildFrames = new Vector<>(1); + /** + * keep a reference to the original LAF manager so we can iconise/de-iconise + * correctly + */ + private DesktopManager ourManager; + + public AquaInternalFrameManager(DesktopManager desktopManager) + { + ourManager = desktopManager; + } + @Override public void closeFrame(final JInternalFrame f) { @@ -116,7 +123,7 @@ public class AquaInternalFrameManager extends DefaultDesktopManager // reshape does delta checks for us f.reshape(desktopIcon.getX(), desktopIcon.getY(), f.getWidth(), f.getHeight()); - super.deiconifyFrame(f); + ourManager.deiconifyFrame(f); } void addIcon(final Container c, @@ -131,25 +138,7 @@ public class AquaInternalFrameManager extends DefaultDesktopManager @Override public void iconifyFrame(final JInternalFrame f) { - // Same as super except doesn't deactivate it - JInternalFrame.JDesktopIcon desktopIcon; - Container c; - - desktopIcon = f.getDesktopIcon(); - // Position depends on *current* position of frame, unlike super which - // reuses the first position - final Rectangle r = getBoundsForIconOf(f); - desktopIcon.setBounds(r.x, r.y, r.width, r.height); - - c = f.getParent(); - if (c == null) - { - return; - } - - c.remove(f); - addIcon(c, desktopIcon); - c.repaint(f.getX(), f.getY(), f.getWidth(), f.getHeight()); + ourManager.iconifyFrame(f); } // WindowsDesktopManager code @@ -265,4 +254,4 @@ public class AquaInternalFrameManager extends DefaultDesktopManager { switchFrame(false); } -} \ No newline at end of file +}