Don't freak out if we are deactivated multiple times.
git-svn-id: https://samskivert.googlecode.com/svn/trunk@1100 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: RadialMenu.java,v 1.2 2003/04/15 20:54:34 mdb Exp $
|
// $Id: RadialMenu.java,v 1.3 2003/04/16 22:50:55 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.swing;
|
package com.samskivert.swing;
|
||||||
|
|
||||||
@@ -267,21 +267,24 @@ public class RadialMenu
|
|||||||
*/
|
*/
|
||||||
public void deactivate ()
|
public void deactivate ()
|
||||||
{
|
{
|
||||||
Component comp = _host.getComponent();
|
if (_host != null) {
|
||||||
|
// unwire ourselves from the host component
|
||||||
|
Component comp = _host.getComponent();
|
||||||
|
comp.removeMouseListener(this);
|
||||||
|
comp.removeMouseMotionListener(this);
|
||||||
|
|
||||||
// unwire ourselves from the host component
|
// reinstate the previous mouse listeners
|
||||||
comp.removeMouseListener(this);
|
if (_hijacker != null) {
|
||||||
comp.removeMouseMotionListener(this);
|
_hijacker.release();
|
||||||
|
_hijacker = null;
|
||||||
|
}
|
||||||
|
|
||||||
// reinstate the previous mouse listeners
|
// tell our host that we are no longer
|
||||||
_hijacker.release();
|
_host.menuDeactivated(this);
|
||||||
_hijacker = null;
|
|
||||||
|
|
||||||
// tell our host that we are no longer
|
// fire off a last repaint to clean up after ourselves
|
||||||
_host.menuDeactivated(this);
|
repaint();
|
||||||
|
}
|
||||||
// fire off a last repaint to clean up after ourselves
|
|
||||||
repaint();
|
|
||||||
|
|
||||||
// clear out our references
|
// clear out our references
|
||||||
_host = null;
|
_host = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user