package placeholder.ui;
import java.awt.BorderLayout;
import java.awt.Dimension;
import java.io.PrintStream;
import javax.swing.JFrame;
import javax.swing.SwingUtilities;
import placeholder.check.CheckServices;
import placeholder.ui.panel.SimplePanel;
import placeholder.website.queue.WebsiteQueue;
import placeholder.website.queue.WebsiteResultQueue;
import placeholder.website.queue.http.HttpWebsiteQueue;
import placeholder.website.queue.http.HttpWebsiteResultQueue;
/**
* @author Heiko Bornholdt
*/
public class SimpleUI extends JFrame {
private static final long serialVersionUID = 1L;
public static void main(String[] args) {
try {
CheckServices.load();
} catch (Exception e) {
throw new RuntimeException(e);
}
PrintStream out = System.out;
final WebsiteQueue queue = new HttpWebsiteQueue(out);
final WebsiteResultQueue resultQueue = new HttpWebsiteResultQueue(out);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
new SimpleUI(queue, resultQueue);
}
});
}
public SimpleUI(WebsiteQueue queue, WebsiteResultQueue resultQueue) {
super("Plaecholder");
this.setLayout(new BorderLayout());
this.add(new SimplePanel(queue, resultQueue));
this.setDefaultCloseOperation(EXIT_ON_CLOSE);
this.setPreferredSize(new Dimension(375, 200));
this.pack();
this.setLocationRelativeTo(null);
this.setVisible(true);
}
}