code: private void setSelectionState(Object node, State state, boolean propagate)
      {
          Objects.requireNonNull(state, "The state may not be null");
          Objects.requireNonNull(node, "The node may not be null");
          State oldState = selectionStates.put(node, state);
          if (!state.equals(oldState))
          {
              fireStateChanged(node, oldState, state);
              if (propagate)
              {
                  updateSelection(node);
              }
          }
          repaint();
      }
docs: Set the selection state of the given node
  
  @param node The node
  @param state The state
  @param propagate Whether the state change should be propagated
  to its children and ancestor nodes