how did japan deal with western involvement in the east?

how did japan deal with western involvement in the east?
all i need is a few facts to base my essay on

While the Japanese originally tolerated trade with the west(especially the Portuguese), when Ieyasu Tokugawa took power he took action to isolate Japan from the Europeans. It’s sort of ironic, since his rise to the Shogunate was based partially on the use of European technology like firearms. He also moved to suppress Christianity, either having learned or suspected how European powers had used the Church to assist in dominating other cultures.
The Japanese did maintain contact with mainland China, so it would be expected that they kept abreast of how Europeans were acting there and the effects they were having. When an American squadron sailed into Tokyo Bay, it didn’t take the Japanese officials long to recognize that isolation was a losing strategy. While Japan’s technology stagnated, Europeans continued to advance on everything from shipbuilding to weaponry to medicine.
The next two decades saw massive changes in Japan. The end of the Tokugawa shogunate, the official ending of the samurai class, the embracing of western ways saw Japan race to make up for 200 years of stagnation.
By the beginning of the 20th century, Japan transformed itself into a world power model led after the successful European nations. Japan made itself strong enough to resist any attempts to make it a European colony, and while it embraced western ways, retained its own sense of identity, with few outsiders understanding or appreciating what Japan had done. not even the Russo-Japanese war was enough to convince most Europeans that Japan had truly emerged from a medieval culture into a 20th century powerhouse.