📄 fex.java
字号:
repaint();
}
return;
}
/**
* Comment
*/
public void button51_ActionEvents() {
bNodeManul=false;
bUnitManul=false;
if(UnitNum>0)
{
String id=(ivjChoice11.getSelectedItem());
Integer I=new Integer(id);
delunit(I.intValue());
if(I.intValue()>1)
unitselected(I.intValue()-1);
else unitselected(1);
repaint();
}
return;
}
/**
* Comment
*/
public void button6_ActionEvents() {
bNodeManul=false;
bUnitManul=false;
return;
}
/**
* Comment
*/
public void button7_ActionEvents() {
bNodeManul=false;
bUnitManul=false;
return;
}
/**
* Comment
*/
public void button8_ActionEvents() {
bNodeManul=false;
bUnitManul=false;
Integer I=new Integer(ivjChoice1.getSelectedItem());
int i=I.intValue();
nodes[i].X=(Integer.valueOf(ivjTextField1.getText())).intValue();
nodes[i].Y=(Integer.valueOf(ivjTextField2.getText())).intValue();
nodes[i].load.X=(Integer.valueOf(ivjTextField12.getText())).intValue();
nodes[i].load.Y=(Integer.valueOf(ivjTextField22.getText())).intValue();
repaint();
for(int j=1;j<=UnitNum;j++)
register(units[j],j);
for(int j=1;j<=NodeNum;j++)
register(nodes[j],j);
return;
}
/**
* Comment
*/
public void button9_ActionEvents() {
bNodeManul=false;
bUnitManul=false;
Integer I=new Integer(ivjChoice11.getSelectedItem());
int i=I.intValue();
int Node1=(Integer.valueOf(ivjChoice12.getSelectedItem())).intValue();
int Node2=(Integer.valueOf(ivjChoice13.getSelectedItem())).intValue();
int A=(Integer.valueOf(ivjTextField3.getText())).intValue();
int E=(Integer.valueOf(ivjTextField4.getText())).intValue();
if(Node1!=Node2)
{
units[i].Node1=Node1;
units[i].Node2=Node2;
}
if(A!=0)units[i].A=A;
if(E!=0)units[i].E=E;
repaint();
return;
}
/**
* Insert the method's description here.
* Creation date: (99-5-17 12:21:08)
*/
public void calculate() {
int n=2*NodeNum;
double P[]=new double[n];
double AK[][]=new double[n][n];
double AKE[][]=new double[2][2];
double AKEE[][]=new double[4][4];
double T[][]=new double[2][4];
int node[]=new int[2];
double s;
double c;
int xx,yy;
for(int i=1;i<=UnitNum;i++)
{
xx=nodes[units[i].Node1].X-nodes[units[i].Node2].X;
yy=nodes[units[i].Node1].Y-nodes[units[i].Node2].Y;
s=Math.sqrt(xx*xx+yy*yy);
c=units[i].A*units[i].E/s;
AKE[0][0]=c;
AKE[1][1]=c;
AKE[0][1]=-c;
AKE[1][0]=-c;
c=xx/s;
T[0][0]=c;
T[1][2]=c;
c=yy/s;
T[0][1]=c;
T[1][3]=c;
double tkt[][]=matmult(2,2,4,AKE,T);
//matmult(2,2,4,AKE,T);
double tt[][]=matt(2,4,T);
AKEE=matmult(4,2,4,tt,tkt);
node[0]=units[i].Node1;
node[1]=units[i].Node2;
for(int ii=0;ii<4;ii++)
{
int a=(node[ii/2]-1)*2+ii%2;
for(int jj=0;jj<4;jj++)
{
int b=(node[jj/2]-1)*2+jj%2;
AK[a][b]+=AKEE[ii][jj];
}
}
}
for(int i=0;i<n;i+=2)
{
P[i]=nodes[i/2+1].load.X;
if(nodes[i/2+1].band.X)AK[i][i]=Double.MAX_VALUE;
}
for(int i=1;i<n;i+=2)
{
P[i]=nodes[i/2+1].load.Y;
if(nodes[i/2+1].band.Y)AK[i][i]=Double.MAX_VALUE;
}
AK=lu(AK);
for(int i=0;i<n;i++)
{
for(int j=0;j<=i-1;j++)
P[i]-=AK[i][j]*AK[j][j]*P[j];
P[i]=P[i]/AK[i][i];
}
for(int j=n-1;j>=0;j--)
{
for(int i=j+1;i<n;i++)
P[j]-=AK[i][j]*P[i];
}
for(int i=0;i<n;i+=2)
nodes[i/2+1].U=P[i];
for(int i=1;i<n;i+=2)
nodes[i/2+1].V=P[i] ;
/*
ivjTextArea1.append("\n 计算总刚\n");//Now computing AK;
for(int i=0;i<n;i++)
for(int j=0;j<i+1;j++)
ivjTextArea1.append("AK"+"("+(i+1)+","+(j+1)+")"+"="+AK[i][j]+"\n");
if(AK==null)ivjTextArea1.append("结构非静定");
else
{
ivjTextArea1.append("\n 进行LU分解\n");//Now computing LU of AK;
for(int i=0;i<n;i++)
for(int j=0;j<i+1;j++)
ivjTextArea1.append("LU"+"("+(i+1)+","+(1+j)+")"+"="+AK[i][j]+"\n");
}
//ivjTextArea1.append("=====================================\n");*/
ivjTextArea1.append("运算成功\n");
ivjPanel9.setVisible(true);
return;
}
/**
* Comment
*/
public void checkbox1_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
nodes[currentNode].band.X=ivjCheckbox1.getState();
repaint();
return;
}
/**
* Comment
*/
public void checkbox2_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
nodes[currentNode].band.Y=ivjCheckbox2.getState();
repaint();
return;
}
/**
* Comment
*/
public void checkbox3_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
if(ivjCheckbox3.getState())bGrid=true;
else bGrid=false;
repaint();
return;
}
/**
* Comment
*/
public void checkbox4_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
if(ivjCheckbox4.getState())bally=true;
else bally=false;
//repaint();
return;
}
/**
* Comment
*/
public void choice1_ItemStateChanged(java.awt.event.ItemEvent itemEvent)
{
bNodeManul=false;
bUnitManul=false;
Integer I=new Integer(ivjChoice1.getSelectedItem());
int i=I.intValue();
nodeselected(i);
repaint();
return;
}
/**
* Comment
*/
public void choice11_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
bNodeManul=false;
bUnitManul=false;
Integer I=new Integer(ivjChoice11.getSelectedItem());
int i=I.intValue();
unitselected(i);
repaint();
return;
}
/**
* Comment
*/
public void choice111_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
Integer I=new Integer(ivjChoice111.getSelectedItem());
int i=I.intValue();
unitselected(i);
repaint();
return;
}
/**
* Comment
*/
public void choice14_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
Integer I=new Integer(ivjChoice14.getSelectedItem());
int i=I.intValue();
nodeselected(i);
return;
}
/**
* Comment
*/
public void choice3_ItemStateChanged(java.awt.event.ItemEvent itemEvent) {
Integer I=new Integer(ivjChoice3.getSelectedItem());
int i=I.intValue();
coif=100*i;
repaint();
return;
}
/**
* connEtoC1: (Button1.action. --> FEX.button1_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC1() {
try {
// user code begin {1}
// user code end
this.button1_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC10: (FEX.mouse.mouseClicked(java.awt.event.MouseEvent) --> FEX.fEX_MouseClicked(Ljava.awt.event.MouseEvent;)V)
* @param arg1 java.awt.event.MouseEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC10(java.awt.event.MouseEvent arg1) {
try {
// user code begin {1}
// user code end
this.fEX_MouseClicked(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC11: (Checkbox1.item.itemStateChanged(java.awt.event.ItemEvent) --> FEX.checkbox1_ItemStateChanged(Ljava.awt.event.ItemEvent;)V)
* @param arg1 java.awt.event.ItemEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC11(java.awt.event.ItemEvent arg1) {
try {
// user code begin {1}
// user code end
this.checkbox1_ItemStateChanged(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC12: (Checkbox2.item.itemStateChanged(java.awt.event.ItemEvent) --> FEX.checkbox2_ItemStateChanged(Ljava.awt.event.ItemEvent;)V)
* @param arg1 java.awt.event.ItemEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC12(java.awt.event.ItemEvent arg1) {
try {
// user code begin {1}
// user code end
this.checkbox2_ItemStateChanged(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC13: (Button15.action. --> FEX.button15_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC13() {
try {
// user code begin {1}
// user code end
this.button15_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC14: (Button16.action. --> FEX.button16_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC14() {
try {
// user code begin {1}
// user code end
this.button16_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC15: (FEX.mouseMotion.mouseMoved(java.awt.event.MouseEvent) --> FEX.fEX_MouseMoved(Ljava.awt.event.MouseEvent;)V)
* @param arg1 java.awt.event.MouseEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC15(java.awt.event.MouseEvent arg1) {
try {
// user code begin {1}
// user code end
this.fEX_MouseMoved(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC16: (Choice11.item.itemStateChanged(java.awt.event.ItemEvent) --> FEX.choice11_ItemStateChanged(Ljava.awt.event.ItemEvent;)V)
* @param arg1 java.awt.event.ItemEvent
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC16(java.awt.event.ItemEvent arg1) {
try {
// user code begin {1}
// user code end
this.choice11_ItemStateChanged(arg1);
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC17: (Button51.action. --> FEX.button51_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC17() {
try {
// user code begin {1}
// user code end
this.button51_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC18: (Button9.action. --> FEX.button9_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC18() {
try {
// user code begin {1}
// user code end
this.button9_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC19: (Button7.action. --> FEX.button7_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC19() {
try {
// user code begin {1}
// user code end
this.button7_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC2: (Button2.action. --> FEX.button2_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC2() {
try {
// user code begin {1}
// user code end
this.button2_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC20: (Button6.action. --> FEX.button6_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC20() {
try {
// user code begin {1}
// user code end
this.button6_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
* connEtoC21: (Button10.action. --> FEX.button10_ActionEvents()V)
*/
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private void connEtoC21() {
try {
// user code begin {1}
// user code end
this.button10_ActionEvents();
// user code begin {2}
// user code end
} catch (java.lang.Throwable ivjExc) {
// user code begin {3}
// user code end
handleException(ivjExc);
}
}
/**
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -