From 8b4d5de0b6326b2377e6822bdc03275fa4c13682 Mon Sep 17 00:00:00 2001 From: Ingo Maier Date: Fri, 12 Aug 2011 16:16:12 +0000 Subject: Pulled up the SuperMixin that calls closeOperat... Pulled up the SuperMixin that calls closeOperations for frames into window and let dialogs mix it in as well. Closes #3708. --- src/swing/scala/swing/RichWindow.scala | 14 +++----------- src/swing/scala/swing/Window.scala | 8 ++++++++ 2 files changed, 11 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/swing/scala/swing/RichWindow.scala b/src/swing/scala/swing/RichWindow.scala index 78e22f9c60..977aab300a 100644 --- a/src/swing/scala/swing/RichWindow.scala +++ b/src/swing/scala/swing/RichWindow.scala @@ -75,14 +75,6 @@ sealed trait RichWindow extends Window { class Frame(gc: java.awt.GraphicsConfiguration = null) extends RichWindow { override lazy val peer: JFrame with InterfaceMixin = new JFrame(gc) with InterfaceMixin with SuperMixin - protected trait SuperMixin extends JFrame { - override protected def processWindowEvent(e: java.awt.event.WindowEvent) { - super.processWindowEvent(e) - if (e.getID() == java.awt.event.WindowEvent.WINDOW_CLOSING) - closeOperation() - } - } - def iconify() { peer.setExtendedState(peer.getExtendedState | AWTFrame.ICONIFIED) } def uniconify() { peer.setExtendedState(peer.getExtendedState & ~AWTFrame.ICONIFIED) } def iconified: Boolean = (peer.getExtendedState & AWTFrame.ICONIFIED) != 0 @@ -189,10 +181,10 @@ object Dialog { */ class Dialog(owner: Window, gc: java.awt.GraphicsConfiguration = null) extends RichWindow { override lazy val peer: JDialog with InterfaceMixin = - if (owner == null) new JDialog with InterfaceMixin + if (owner == null) new JDialog with InterfaceMixin with SuperMixin else owner match { - case f: Frame => new JDialog(f.peer, "", false, gc) with InterfaceMixin - case d: Dialog => new JDialog(d.peer, "", false, gc) with InterfaceMixin + case f: Frame => new JDialog(f.peer, "", false, gc) with InterfaceMixin with SuperMixin + case d: Dialog => new JDialog(d.peer, "", false, gc) with InterfaceMixin with SuperMixin } def this() = this(null) diff --git a/src/swing/scala/swing/Window.scala b/src/swing/scala/swing/Window.scala index 71982a9b18..c3918551db 100644 --- a/src/swing/scala/swing/Window.scala +++ b/src/swing/scala/swing/Window.scala @@ -27,6 +27,14 @@ abstract class Window extends UIElement with RootPanel with Publisher { outer => protected trait InterfaceMixin extends javax.swing.RootPaneContainer + protected trait SuperMixin extends AWTWindow { + override protected def processWindowEvent(e: java.awt.event.WindowEvent) { + super.processWindowEvent(e) + if (e.getID() == java.awt.event.WindowEvent.WINDOW_CLOSING) + closeOperation() + } + } + /** * This method is called when the window is closing, after all other window * event listeners have been processed. -- cgit v1.2.3