📄 showarrayfactor.java
字号:
/*
* ShowArrayFactor
*
* Button action to read current taper and performances
* Get array factor then call the drawer to show on the screen
*
* Meirong He
* EEE Department
* University of Sheffield
* July 2005
*/
import java.awt.*;
import java.awt.event.*;
class ShowArrayFactor implements ActionListener {
private Button button;
private AntennaDesigner taper;
public ShowArrayFactor (Button bb, AntennaDesigner tt) {
button=bb;
taper=tt;
}
public void actionPerformed (ActionEvent e) {
taper.screen.clear();
int N=taper.N;
Complex[] I=new Complex[N];
double d=taper.lamda*Double.parseDouble(new String(taper.spacing.getText()));
double module, ang;
for (int i=0; i<N; i++) {
module=Double.parseDouble(new String(taper.amp[i].getText()));
ang=Double.parseDouble(new String(taper.phase[i].getText()))*Math.PI/180;
I[i]=new Complex("polar", module, ang);
}
//Read current taper and construct current array
ArrayFactor arrayFactor=new ArrayFactor(I,d,taper.k0);
//Constructor array factor calculation function
String com=button.getLabel();
if (com.equals("Power Pattern")) {
taper.screen.drawArrayFactor(arrayFactor);
}
if(com.equals("Geometrical Pattern")) {
taper.screen.drawGeometry(arrayFactor);
} //Call drawer operation according to user command
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -