1 /* 2 * This program is free software; you can redistribute it and/or 3 * modify it under the terms of the GNU General Public License as 4 * published by the Free Software Foundation; either version 2 of the 5 * License, or (at your option) any later version. 6 * 7 * This program is distributed in the hope that it will be useful, but 8 * WITHOUT ANY WARRANTY; without even the implied warranty of 9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOUSE. See the GNU 10 * General Public License for more details. 11 * 12 * You should have recieved a copy of the GNU General Public License 13 * along with this program; if not write to the Free Software 14 * Foundation, inc., 59 Temple Place, Suite 330, Boston MA 02111-1307 15 * USA 16 */ 17 18 package gui; 19 20 import javax.swing.*; 21 import java.awt.*; 22 import java.awt.event.*; 23 /** 24 * Insert the type's description here. 25 * 26 * @author: Yuriy Mikhaylovskiy 27 */ 28 29 public class ProcessorGUI extends JFrame { 30 Processor processor; 31 ProcessorGUI(boolean openGL)32 public ProcessorGUI(boolean openGL) { 33 processor = new Processor(openGL); 34 try { 35 setTitle(Processor.ver); 36 getContentPane().setLayout(new BorderLayout()); 37 Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize(); 38 setBounds(50,50,screenSize.width-100, screenSize.height-100); 39 addWindowListener(new WindowAdapter() { 40 public void windowClosing(WindowEvent e) { 41 System.exit(0); 42 } 43 }); 44 getContentPane().add(processor, BorderLayout.CENTER); 45 show(); 46 }catch(Exception e) { e.printStackTrace();} 47 } 48 main(String[] args)49 public static void main(String[] args) { 50 if (args.length > 0) 51 new ProcessorGUI(args[0].toUpperCase().equals("-OPENGL")); 52 else 53 new ProcessorGUI(false); 54 } 55 56 } 57