DacWizard/src/main/java/jme3utilities/minie/wizard/TestMode.java
/**
     * Process an action from the keyboard or mouse.
     *
     * @param actionString textual description of the action (not null)
     * @param ongoing true if the action is ongoing, otherwise false
     * @param tpf time interval between frames (in seconds, &ge;0)
     */
Process an action from the keyboard or mouse.

@param actionString textual description of the action (not null)
@param ongoing true if the action is ongoing, otherwise false
@param tpf time interval between frames (in seconds, ≥0)
Process an action from the keyboard or mouse . @param actionString textual description of the action ( not null ) @param ongoing true if the action is ongoing otherwise false @param tpf time interval between frames ( in seconds ≥0 )
@Override
    public void onAction(String actionString, boolean ongoing, float tpf) {
        Validate.nonNull(actionString, "action string");
        logger.log(Level.INFO, "Got action {0} ongoing={1}", new Object[]{
            MyString.quote(actionString), ongoing
        });
        boolean handled = false;
        if (ongoing) {
            handled = true;
            DacWizard app = DacWizard.getApplication();
            switch (actionString) {
                case Action.pickLink:
                    pickLink();
                    break;
                case Action.previousScreen:
                    previousScreen();
                    break;
                case Action.save:
                    saveJava();
                    break;
                case Action.saveJ3o:
                    saveJ3o();
                    break;
                case Action.setMargin:
                    setMargin();
                    break;
                case Action.toggleAxes:
                    Model model = DacWizard.getModel();
                    model.toggleShowingAxes();
                    break;
                case Action.toggleMesh:
                    app.toggleMesh();
                    break;
                case Action.togglePhysicsDebug:
                    togglePhysicsDebug();
                    break;
                case Action.toggleRagdoll:
                    toggleRagdoll();
                    break;
                case Action.toggleSkeleton:
                    app.toggleSkeletonVisualizer();
                    break;
                default:
                    handled = false;
            }
        }
        if (!handled) {
            if (actionString.startsWith(Action.setMargin + " ")) {
                String arg = MyString.remainder(actionString,
                        Action.setMargin + " ");
                float newMargin = Float.valueOf(arg);
                setMargin(newMargin);
                handled = true;
            }
        }
        if (!handled) {
            actionApplication.onAction(actionString, ongoing, tpf);
        }
    }
@ Override public void onAction ( String actionString , boolean ongoing , float tpf ) { Validate . nonNull ( actionString , "action string" ) ; logger . log ( Level . INFO , "Got action {0} ongoing={1}" , new Object [ ] { MyString . quote ( actionString ) , ongoing } ) ; boolean handled = false ; if ( ongoing ) { handled = true ; DacWizard app = DacWizard . getApplication ( ) ; switch ( actionString ) { case Action . pickLink : pickLink ( ) ; break ; case Action . previousScreen : previousScreen ( ) ; break ; case Action . save : saveJava ( ) ; break ; case Action . saveJ3o : saveJ3o ( ) ; break ; case Action . setMargin : setMargin ( ) ; break ; case Action . toggleAxes : Model model = DacWizard . getModel ( ) ; model . toggleShowingAxes ( ) ; break ; case Action . toggleMesh : app . toggleMesh ( ) ; break ; case Action . togglePhysicsDebug : togglePhysicsDebug ( ) ; break ; case Action . toggleRagdoll : toggleRagdoll ( ) ; break ; case Action . toggleSkeleton : app . toggleSkeletonVisualizer ( ) ; break ; default : handled = false ; } } if ( ! handled ) { if ( actionString . startsWith ( Action . setMargin + " " ) ) { String arg = MyString . remainder ( actionString , Action . setMargin + " " ) ; float newMargin = Float . valueOf ( arg ) ; setMargin ( newMargin ) ; handled = true ; } } if ( ! handled ) { actionApplication . onAction ( actionString , ongoing , tpf ) ; } }
Process an action from the keyboard or mouse.
Process an action from the keyboard or mouse .