-
Notifications
You must be signed in to change notification settings - Fork 0
/
Icurrent.java
executable file
·58 lines (50 loc) · 1.35 KB
/
Icurrent.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import javax.swing.*;
import java.awt.*;
public class Icurrent {
String name;
int node1;
int node2;
int xloc;
int yloc;
double orientation_angle;
double value;
Icurrent(String name,int ND1, int ND2,int xloc,int yloc,double angle,double value) {
this.name = name;
this.value = value;
this.node1 = ND1;
this.node2 = ND2;
this.xloc = xloc;
this.yloc = yloc;
this.orientation_angle = angle;
}
public void setParameter(String name,int ND1, int ND2,int xloc,int yloc,double angle,double value) {
this.name = name;
this.value = value;
this.node1 = ND1;
this.node2 = ND2;
this.xloc = xloc;
this.yloc = yloc;
this.orientation_angle = angle;
}
public void setParameter(Icurrent i) {
this.name = i.name;
this.value = i.value;
this.node1 = i.node1;
this.node2 = i.node1;
this.xloc = i.xloc;
this.yloc = i.yloc;
this.orientation_angle = i.orientation_angle;
}
public void SetLocation(int x,int y) {
this.xloc=x;
this.yloc=y;
}
public void SetLocation(Point p) {
this.xloc=p.x;
this.yloc=p.y;
}
public String toString() // should put public befor String toSting(),otherwise the error will happen {
//return String.format("%g",value);
return(name + "\t"+node1+ "\t"+node2 + "\t"+value+"A"+"\tx= "+xloc+"\ty= "+yloc+"\tAngle= "+ orientation_angle);
}
}