View Javadoc

1   package nl.tudelft.goal.ut2004.visualizer;
2   
3   import javax.swing.JFrame;
4   import javax.swing.JTabbedPane;
5   import javax.swing.SwingUtilities;
6   
7   import nl.tudelft.goal.ut2004.visualizer.map.PureMapTopPanel;
8   import nl.tudelft.goal.ut2004.visualizer.panels.connection.ServerConnectionPanel;
9   import nl.tudelft.pogamut.base.server.ReconnectingServerDefinition;
10  import nl.tudelft.pogamut.base.server.ServerDefinition;
11  import nl.tudelft.pogamut.unreal.server.UnrealServerDefinition;
12  import nl.tudelft.pogamut.ut2004.server.UTServerDefinition;
13  import cz.cuni.amis.pogamut.unreal.server.IUnrealServer;
14  
15  public class UnrealVisualizer extends JFrame {
16  
17  	private ReconnectingServerDefinition<IUnrealServer> server;
18  
19  	@SuppressWarnings("unchecked")
20  	private UnrealVisualizer() {
21  
22  		UnrealServerDefinition<? extends IUnrealServer> server = new UTServerDefinition();
23  
24  		this.server = new ReconnectingServerDefinition<IUnrealServer>(
25  				(ServerDefinition<IUnrealServer>) server);
26  
27  		JTabbedPane tabbedPane = new JTabbedPane();
28  		tabbedPane.add(new ServerConnectionPanel(this.server));
29  		tabbedPane.add(new PureMapTopPanel(this.server));
30  
31  		add(tabbedPane);
32  	}
33  
34  	public static void main(String[] args) {
35  		SwingUtilities.invokeLater(new Runnable() {
36  			public void run() {
37  				UnrealVisualizer visualizer = new UnrealVisualizer();
38  				visualizer.setTitle("UnrealVisualizer");
39  				visualizer.setSize(500, 500);
40  				visualizer.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
41  				visualizer.setVisible(true);
42  			}
43  		});
44  
45  	}
46  
47  }