From fa21a782429cc6e63360249588a2c180974907a3 Mon Sep 17 00:00:00 2001 From: Walter Korman Date: Thu, 8 Aug 2002 20:58:32 +0000 Subject: [PATCH] Override setBounds() to capture resizing and movement rather than creating a component listener. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@1631 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/media/VirtualMediaPanel.java | 27 ++++++++----------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/src/java/com/threerings/media/VirtualMediaPanel.java b/src/java/com/threerings/media/VirtualMediaPanel.java index efd6deedb..b7a7eacb8 100644 --- a/src/java/com/threerings/media/VirtualMediaPanel.java +++ b/src/java/com/threerings/media/VirtualMediaPanel.java @@ -1,5 +1,5 @@ // -// $Id: VirtualMediaPanel.java,v 1.8 2002/08/08 20:16:07 shaper Exp $ +// $Id: VirtualMediaPanel.java,v 1.9 2002/08/08 20:58:32 shaper Exp $ package com.threerings.media; @@ -9,8 +9,6 @@ import java.awt.Graphics; import java.awt.Point; import java.awt.Rectangle; import java.awt.Shape; -import java.awt.event.ComponentAdapter; -import java.awt.event.ComponentEvent; import java.awt.event.MouseEvent; import javax.swing.SwingUtilities; @@ -37,19 +35,6 @@ public class VirtualMediaPanel extends MediaPanel public VirtualMediaPanel (FrameManager framemgr) { super(framemgr); - - // keep an eye on any movement or resizing of the panel so that we - // can track our absolute screen coordinates to work around the - // Windows copyArea() bug - addComponentListener(new ComponentAdapter() { - public void componentMoved (ComponentEvent e) { - findRootBounds(); - } - - public void componentResized (ComponentEvent e) { - findRootBounds(); - } - }); } /** @@ -158,6 +143,16 @@ public class VirtualMediaPanel extends MediaPanel findRootBounds(); } + // documentation inherited + public void setBounds (int x, int y, int width, int height) + { + super.setBounds(x, y, width, height); + + // we need to obtain our absolute screen coordinates to work + // around the Windows copyArea() bug + findRootBounds(); + } + /** * Determines the absolute screen coordinates at which this panel is * located and stores them for reference later when rendering. This