Behave like a normal swing component and just post actions to our action
listeners. If they want to do the controller thing, they can. git-svn-id: https://samskivert.googlecode.com/svn/trunk@1099 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
//
|
//
|
||||||
// $Id: RadialMenu.java,v 1.1 2003/04/15 20:28:36 mdb Exp $
|
// $Id: RadialMenu.java,v 1.2 2003/04/15 20:54:34 mdb Exp $
|
||||||
|
|
||||||
package com.samskivert.swing;
|
package com.samskivert.swing;
|
||||||
|
|
||||||
@@ -32,8 +32,7 @@ import com.samskivert.util.StringUtil;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a radial menu with iconic menu items that expand to include
|
* Provides a radial menu with iconic menu items that expand to include
|
||||||
* textual descriptions when moused over. Menu selections are posted as
|
* textual descriptions when moused over.
|
||||||
* controller commands.
|
|
||||||
*/
|
*/
|
||||||
public class RadialMenu
|
public class RadialMenu
|
||||||
implements MouseMotionListener, MouseListener
|
implements MouseMotionListener, MouseListener
|
||||||
@@ -436,12 +435,9 @@ public class RadialMenu
|
|||||||
Object itemArg = _activeItem.argument;
|
Object itemArg = _activeItem.argument;
|
||||||
Object arg = (itemArg == null) ? _argument : itemArg;
|
Object arg = (itemArg == null) ? _argument : itemArg;
|
||||||
|
|
||||||
// post the action
|
// notify our listeners that the action is posted
|
||||||
final CommandEvent evt = new CommandEvent(
|
final CommandEvent evt = new CommandEvent(
|
||||||
_host.getComponent(), _activeItem.command, arg);
|
_host.getComponent(), _activeItem.command, arg);
|
||||||
Controller.postAction(evt);
|
|
||||||
|
|
||||||
// and notify our listeners
|
|
||||||
_actlist.apply(new ObserverList.ObserverOp() {
|
_actlist.apply(new ObserverList.ObserverOp() {
|
||||||
public boolean apply (Object obs) {
|
public boolean apply (Object obs) {
|
||||||
((ActionListener)obs).actionPerformed(evt);
|
((ActionListener)obs).actionPerformed(evt);
|
||||||
|
|||||||
Reference in New Issue
Block a user