@Override
        protected void controlUpdate(float tpf) {
            time += tpf;
            spatial.setLocalTranslation(origPos.x + FastMath.cos(time) * direction, origPos.y, origPos.z + FastMath.sin(time) * direction);
        }
Switch mode with space bar at run time
jme3-examples/src/main/java/jme3test/light/TestManyLightsSingle.java