If you look at this (CameraMovementState) class it is a bit more ‘readable’ than JME’s… just ignore the event processing stuff and you can see the logic of how the camera moves:
The camera doesn’t provide the smarter methods that Spatial does so you can more easily see how you might manage your own rotation and movement.