-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSnapShop.java
More file actions
69 lines (58 loc) · 1.79 KB
/
SnapShop.java
File metadata and controls
69 lines (58 loc) · 1.79 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
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
/**
* An application for filtering/transforming images
* It contains a FilterButtons JPanel to display Buttons to trigger different Filters,
* a FileLoader JPanel to choose the image file, and
* an ImagePanel to display the image.
*
* @author Richard Dunn, Tim Gesell, modified by Pranav Kadekodi
* @version November 5th 2023
*/
import javax.swing.JFrame;
import java.awt.BorderLayout;
public class SnapShop extends JFrame
{
private FileLoader fl;
private FilterButtons fb;
private ImagePanel ip;
/**
* Constructor for objects of class SnapShop
*/
public SnapShop()
{
super("Image Manipulator"); //JFrame Constructor
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
ip = new ImagePanel(this);
this.getContentPane().add(ip, BorderLayout.CENTER);
fl = new FileLoader(this);
this.getContentPane().add(fl, BorderLayout.NORTH);
fb = new FilterButtons(this);
this.getContentPane().add(fb, BorderLayout.WEST);
SnapShopConfiguration.configure(this);
this.pack();
this.setVisible(true);
}
/**
* Add a filter to the SnapShop interface.
* Creates a button and links it to the filter.
* @param f The filter to apply
* @param description Description of the filter
*/
public void addFilter(Filter f, String description) {
fb.addFilter(f, description);
}
/**
* accessor for ImagePanel
*/
protected ImagePanel getImagePanel() {
return ip;
}
public static void main(String[] args)
{
/* Create and display the JFrame */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new SnapShop().setVisible(true);
}
});
}
}