-
Notifications
You must be signed in to change notification settings - Fork 0
/
AudioDisplayContainer.java
70 lines (49 loc) · 1.82 KB
/
AudioDisplayContainer.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
59
60
61
62
63
64
65
66
67
68
69
70
package daw;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.File;
/**
*
* @author opdada01 Daniel Opdahl
* @author mantno01 Noah Manternach
* @author nteste01 Teboho Nteso
*
*/
//The AudioDisplayContainer class serves as a container component for AudioFileInfo objects and
//AudioFileVisualDisplay objects.
public class AudioDisplayContainer extends JPanel {
/* FIELDS */
public File track;
public MainDisplayWindow main_display_window;
/* CONSTRUCTOR */
public AudioDisplayContainer(MainDisplayWindow main_display_window, File track) {
//The AudioDisplayContainer constructor is given a main_display_window and a track. After
//setting the track, main_display_window for functional purposes and layout, border and
//minimumsize for display and astetic purposes, we create and add the AudioFileVisualDisplay
//and AudioFileInfo objects for our respective track.
setTrack(track);
setMainDisplayWindow(main_display_window);
setLayout(new BorderLayout());
setBorder(BorderFactory.createLineBorder(Color.green));
setMinimumSize(new Dimension(500,10));
AudioFileVisualDisplay audio_file_display = new AudioFileVisualDisplay()
AudioFileInfo audio_file_info = new AudioFileInfo(this, getMainDisplayWindow(), getTrack());
add(audio_file_info, BorderLayout.LINE_START);
add(audio_file_display, BorderLayout.LINE_END);
}
/* ACCESSORS */
File getTrack() {
return track;
}
MainDisplayWindow getMainDisplayWindow() {
return main_display_window;
}
/* MUTATORS */
void setTrack(File other) {
track = other;
}
void setMainDisplayWindow(MainDisplayWindow other) {
main_display_window = other;
}
}