-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathComicCatalogue.java
104 lines (76 loc) · 2.57 KB
/
ComicCatalogue.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
import java.awt.*;
import java.io.*;
import java.net.*;
import java.util.ArrayList;
import java.util.Map;
import java.util.Random;
import javax.imageio.ImageIO;
import javax.swing.*;
import org.json.simple.*;
/*Notes:
- System does not display a message when results are not found, simply nothing is displayed.
- all fields are required
- all text should be lowercase
- example of entry "comic starts with: d issue number: 2"
Produced by: Mark Angus
Date: 17/02/2016*/
//Provides comic book information based on requests
public class ComicCatalogue {
//implement login screen requiring key
public static void main(String[] args) throws IOException, ParseException,
Exception {
//Style
LineBorder blackline = new LineBorder(Color.black);
//comic array
ArrayList<ComicObject> comicArr = new ArrayList<Comic>();
//Defaults for API
String format = "format=comic";
String formatType = "&formatType=comic";
String noVarients = "&noVariants=true";
String hasDigitalIssue = "&hasDigitalIssue=false";
//Keys
//A random timestamp to make calls
String ts="&ts=2009-09-22%2016:47:08";
//provide key and hash as command line args
String apiKey= args[1];
String hash= args[2];
//Attribution
String attribution = "Data provided by Marvel. � 2014 Marvel";
//Main Frame
JFrame mainWindow = new JFrame("Comic Library");
//Main panel
JPanel container = new JPanel();
container.setLayout(new BorderLayout());
container.setPreferredSize(new Dimension(1000, 400));
//Create Selection panel
//Create Daily Comic panel
//create random comic button listener
//new daily comic button
//create new library panel
//create new mouse listener instance
//create new subnit button mouse listener
//Daily Panel components
dailyPanel.add(dcPanel);
dailyPanel.add(dcButton);
dailyPanel.setBackground(Color.WHITE);
//LibPanel components
libPanel.setBackground(Color.WHITE);
//Add add attribute panel
//Add search submit button
JButton submitButton = new JButton("Submit");
SubmitMouseListener submitListener = new SubmitMouseListener();
submitButton.addMouseListener(submitListener);
searchPanel.add(submitButton);
//Add panels to container
container.add(searchPanel, BorderLayout.NORTH);
container.add(libPanel,BorderLayout.WEST);
container.add(selectionPanel,BorderLayout.CENTER);
container.add(dailyPanel, BorderLayout.EAST);
//Add container to mainWindow
mainWindow.add(container);
//Display Interface
mainWindow.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
mainWindow.pack();
mainWindow.setVisible(true);
}
}