public static CStateChange changeNode(
      final CStateFactory<?, ?> m_factory,
      final MouseEvent event,
      final HitInfo hitInfo,
      final Node oldNode) {
    final Node node = hitInfo.getHitNode();

    if (node == oldNode) {
      // TODO @Nils please check if this change does not break BinDiff behavior
      // It fixes case 4207.
      return new CStateChange(m_factory.createNodeHoverState(node, event), false);
    } else {
      m_factory.createNodeExitState(oldNode, event);

      return new CStateChange(m_factory.createNodeEnterState(node, event), true);
    }
  }
Changes the state of the node depending on the current hitInfo.

@param m_factory The state factory for all states.
@param event The mouse event that caused the state change.
@param hitInfo The information about what was hit.
@param oldNode The node which we come from.
@return The state object that describes the mouse state.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/editmode/transformations/CHitNodesTransformer.java