-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathObjectGeneralizationLine.java
More file actions
31 lines (23 loc) · 965 Bytes
/
ObjectGeneralizationLine.java
File metadata and controls
31 lines (23 loc) · 965 Bytes
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
import java.awt.Graphics;
public class ObjectGeneralizationLine extends MainLine {
public ObjectGeneralizationLine(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-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+5
};
g.fillPolygon(pgx, pgy, 3);
}
}