The announcement by House Majority Leader James C. Wright Jr. (D-Tex.) this week that he has all but locked up the 1986 race for speaker was a preemptive strike in the best traditions of the legendary House speaker and fellow Texan Sam Rayburn.

In a carefully choreographed news conference, 23 months before Speaker Thomas P. (Tip) O'Neill Jr. (D-Mass.) is to retire, the Fort Worth Democrat with the bushy eyebrows and florid oratory let would-be opponents know that it isn't worth even thinking about taking him on.

Wright admirers called the announcement a clever political stroke, the sort of thing the iron-fisted Rayburn might have done. Detractors labeled it a presumptuous sign of insecurity.

Almost everyone agreed that it was rare for a politician to suit up so long before the main event and publicly and jauntily declare, as Wright did, that the contest essentially is over.

He said 184 of the House's 251 Democrats have committed themselves to him, but with a typical political coyness, declined to give many names.

"It was a brilliant move," said an official in one potential opposing camp. "He's shown his hand, and it's a strong hand. It would take a lot for people to turn back on commitments -- that's our currency up here."

But another Democrat, no supporter of Wright, said, "I think that's a real sign of weakness. It looked like he thought he was in trouble. As majority leader, he's the speaker presumptive anyway. It's his to lose, and two years is a long time."

House Democrats in 1986 will select the heir to a line of power that stretches from O'Neill back to such legislative legends as Rayburn and Henry Clay -- provided they retain control of the House in that year's elections, which is likely.

Every Democratic majority leader in the last 50 years has risen to speaker, with the exception of Rep. Hale Boggs (D-La.), who died in a plane crash in 1972.

No one had declared against Wright or even begun rustling up support, but several prominent names had been floating around Capitol Hill for weeks as potential challengers.

In addition, since the November election, younger, more junior Democrats have expressed dissatified with the party's image -- implicitly directed at O'Neill and Wright, leaders of the status quo.

One sign of that dissatisfaction was the Democratic Caucus vote to oust the chairman of the House Armed Services Committee, Rep. Melvin Price (D-Ill.), 80, and replace him with Rep. Les Aspin (D-Wis.), 46, despite intense lobbying by O'Neill.

Some younger Democrats said the Price vote foreshadowed trouble for Wright, if the 30-year House veteran were challenged by an aggressive, younger "new" face.

But Wright has stayed out of fights between the younger generation and many in the leadership. And no younger-generation candidate has begun to move forward to challenge him.

In addition, several younger Democrats said their success in knocking off Price, getting O'Neill to set up a "speaker's cabinet" that includes several younger members and winning caucus approval to make the majority whip position an elected one has cooled the passion behind demands for change. Younger Democrats appear to be focusing their ambitions on the No. 3 position, majority whip.

"If Jim Wright in charge is going to be the same as Jim Wright second-in-command, then it's not a change. But I think Jim Wright is big enough to handle the need for change," said Rep. Buddy Roemer (D-La.), a younger Democrat who said he would likely vote for Wright to be speaker.

Finally, Wright has tended diligently to the needs of all his flock over the last few years -- going on hundreds of campaign appearances, making campaign contributions and paying attention to the smallest of problems that crop up in the House.

Wright has been performing a careful balancing act among the various factions in the House since 1976, when he ran as the dark-horse candidate for majority leader and emerged the victor -- by a one-vote margin on the third ballot over the late representative Phillip Burton (D-Calif.).

A Texas moderate, Wright is considered too liberal by some in Texas and too conservative by the House Democrats' fairly large liberal bloc. He has shifted to the left in the last few years, according to interest-group rankings reported in Congressional Quarterly.

His ranking by the liberal Americans for Democratic Action in 1976, the year before he took over as majority leader, was 30 percent. His ADA rating by 1982 was 55 percent and 70 percent in 1983. The House Democrats' average that year was 72 percent.

Wright is liberal on social issues, such as civil rights, housing and education programs, and helped lead the fight in the last few years against Reagan administration cuts in many social programs.

He has been critical of Reagan's defense buildup and was instrumental in winning House approval for a a cutoff of further funds to Central Intelligence Agency-backed "contras" fighting the leftist government of Nicaragua.

But, unlike O'Neill, Wright has supported the president on flight-testing and development of the MX nuclear missile, although he switched to oppose it under pressure from disgruntled freshmen Democrats, on huge increases in aid to El Salvador and on the "Star Wars" antimissile defense system.

Liberals were enraged by his decision to be the key final speaker for the administration on behalf of its El Salvador aid package. Most Democrats opposed the package. They say they fear that Wright, if elected speaker, would steer a course more conservative than O'Neill's.

"There is general uneasiness that his views are not the same as most Democrats on defense and some foreign policy questions," said a liberal Democrat. "And that maybe when he's with us, it's more because he's been pushed to do so by internal election politics."

This is by no means a uniform liberal view of Wright. Several liberals, including the head of the Democratic Study Group, Rep. Matthew F. McHugh (D-N.Y.), Rep. Barney Frank (D-Mass.) and Rep. Barbara A. Mikulski (D-Md.) are backing him.

But, as one liberal detractor said, "Jim has it right now, but there are a lot of controversial issues coming up and he has two years to blow it.