-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectCompositionLine.java
More file actions
34 lines (25 loc) · 1.04 KB
/
ObjectCompositionLine.java
File metadata and controls
34 lines (25 loc) · 1.04 KB
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
import java.awt.Graphics;
public class ObjectCompositionLine extends MainLine {
public ObjectCompositionLine(MainObject start_obj, MainObject.connection_port start_port) {
super(start_obj, start_port);
// TODO Auto-generated constructor stub
}
@Override
public void draw(Graphics g) {
// TODO Auto-generated method stub
g.drawLine(super.start_obj.getLocation().x+super.start_port.x, super.start_obj.getLocation().y+super.start_port.y, super.end_obj.getLocation().x+super.end_port.x, super.end_obj.getLocation().y+super.end_port.y);
int[] pgx = {
super.end_obj.getLocation().x+super.end_port.x,
super.end_obj.getLocation().x+super.end_port.x+5,
super.end_obj.getLocation().x+super.end_port.x,
super.end_obj.getLocation().x+super.end_port.x-5
};
int[] pgy = {
super.end_obj.getLocation().y+super.end_port.y,
super.end_obj.getLocation().y+super.end_port.y+5,
super.end_obj.getLocation().y+super.end_port.y+10,
super.end_obj.getLocation().y+super.end_port.y+5
};
g.fillPolygon(pgx, pgy, 4);
}
}