code: private State getNextState(State state) {
  
          State nextState = null;
          switch (state) {
              case off:
                  nextState = State.on;
                  break;
              case on:
                  nextState = State.off;
                  break;
              case middle:
              default:
                  nextState = m_nextStateAfterMiddle;
          }
          return nextState;
      }
docs: Gets the state which the check box would change to if cilcked on in a given state.<p>
  
  @param state the original state
  @return the next state