protected void handleObjectPressed (final SceneObject scobj, int mx, int my)
    {
        String action = scobj.info.action;
        final ObjectActionHandler handler = ObjectActionHandler.lookup(action);

        // if there's no handler, just fire the action immediately
        if (handler == null) {
            fireObjectAction(null, scobj, new SceneObjectActionEvent(
                                 this, 0, action, 0, scobj));
            return;
        }

        // if the action's not allowed, pretend like we handled it
        if (!handler.actionAllowed(action)) {
            return;
        }

        // if there's no menu for this object, fire the action immediately
        RadialMenu menu = handler.handlePressed(scobj);
        if (menu == null) {
            fireObjectAction(handler, scobj, new SceneObjectActionEvent(
                                 this, 0, action, 0, scobj));
            return;
        }

        // make the menu surround the clicked object, but with consistent size
        Rectangle mbounds = getRadialMenuBounds(scobj);

        _activeMenu = menu;
        _activeMenu.addActionListener(new ActionListener() {
            public void actionPerformed (ActionEvent e) {
                if (e instanceof CommandEvent) {
                    fireObjectAction(handler, scobj, e);
                } else {
                    SceneObjectActionEvent event = new SceneObjectActionEvent(
                        e.getSource(), e.getID(), e.getActionCommand(),
                        e.getModifiers(), scobj);
                    fireObjectAction(handler, scobj, event);
                }
            }
        });
        _activeMenu.activate(this, mbounds, scobj);
    }
protected void handleObjectPressed ( final SceneObject scobj , int mx , int my ) { String action = scobj . info . action ; final ObjectActionHandler handler = ObjectActionHandler . lookup ( action ) ; if ( handler == null ) { fireObjectAction ( null , scobj , new SceneObjectActionEvent ( this , 0 , action , 0 , scobj ) ) ; return ; } if ( ! handler . actionAllowed ( action ) ) { return ; } RadialMenu menu = handler . handlePressed ( scobj ) ; if ( menu == null ) { fireObjectAction ( handler , scobj , new SceneObjectActionEvent ( this , 0 , action , 0 , scobj ) ) ; return ; } Rectangle mbounds = getRadialMenuBounds ( scobj ) ; _activeMenu = menu ; _activeMenu . addActionListener ( new ActionListener ( ) { public void actionPerformed ( ActionEvent e ) { if ( e instanceof CommandEvent ) { fireObjectAction ( handler , scobj , e ) ; } else { SceneObjectActionEvent event = new SceneObjectActionEvent ( e . getSource ( ) , e . getID ( ) , e . getActionCommand ( ) , e . getModifiers ( ) , scobj ) ; fireObjectAction ( handler , scobj , event ) ; } } } ) ; _activeMenu . activate ( this , mbounds , scobj ) ; }
Called when the user presses the mouse button over an object.