Interesting that you recognized that nations planting flags where others already lived AND CONTROLLED would be considered rude (to say the least). 
Yet, you think that Mexico owned this area when in all of the area that is today's US, they never had a population CLOSE to what the native Americans were. 
Texas came about because they somewhat controlled it ( while they were still minority controllers, they had the most land of any place that they would ever control ), they brought Americans in to stop the Indians from raiding them (basically, they were setting Americans up as cannon fodder; this is why Americans rebelled there ). 

So, no, we did NOT acquire southwestern US from Mexico by military means. We did prevent THEM from acquiring control though. 
America actually gained the southwest by being part of the American Indian Wars, which lasted some 400 years.