-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimatedLine.java
More file actions
43 lines (33 loc) · 905 Bytes
/
Copy pathAnimatedLine.java
File metadata and controls
43 lines (33 loc) · 905 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
32
33
34
35
36
37
38
39
40
41
42
43
import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
/**
* Lab 8 Lines animation. used from Lab 8
*
* @author Grant Visker and Jordan Breen
* @Version Fall 2021
*/
abstract class AnimatedLine extends Thread {
public static final int DELAY_TIME = 33;
protected Point[] location;
protected int bottom;
protected boolean done;
protected JComponent container;
public AnimatedLine(Point startPoint, Point endPoint, JComponent container)
{
location = new Point[2];
location[0] = new Point(startPoint);
location[1] = new Point(endPoint);
this.bottom = container.getHeight();
this.container = container;
}
public abstract void paint(Graphics g);
@Override
public abstract void run();
public boolean done()
{
return done;
}
}