A person could practice going into a situation repeatedly - then the experience for them would gradually become more understood and the feelings generated more automatic. But how could their mind influence what feelings are felt? Maybe if they focused on different aspects of the situation or thought about different aspects differently they could change the feelings involved.
So feelings aren't entirely based on the environment or external stimuli - what the person thinks or who they are probably influences the feelings to a great degree.
How does that work exactly; however? It probably depends on what the situation is and what the inputs and thoughts are. Also, what aspects are unchangeable from situation to situation - or how does the mind construct feeling and thought from an environment?