View Javadoc

1   /*
2    * Copyright (C) 2010 Unreal Visualizer Authors
3    *
4    * This program is free software: you can redistribute it and/or modify
5    * it under the terms of the GNU General Public License as published by
6    * the Free Software Foundation, either version 3 of the License, or
7    * (at your option) any later version.
8    *
9    * This program is distributed in the hope that it will be useful,
10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12   * GNU General Public License for more details.
13   *
14   * You should have received a copy of the GNU General Public License
15   * along with this program.  If not, see <http://www.gnu.org/licenses/>.
16   */
17  package nl.tudelft.goal.ut2004.visualizer.gui.dialogs;
18  
19  import java.awt.Frame;
20  import javax.swing.JDialog;
21  import nl.tudelft.goal.ut2004.visualizer.panels.connection.ServerConnectionPanel;
22  import nl.tudelft.goal.ut2004.visualizer.util.WindowPersistenceHelper;
23  import nl.tudelft.pogamut.base.server.ReconnectingServerDefinition;
24  
25  /**
26   * Dialog to connect to the server.
27   * 
28   * @author M.P. Korstanje
29   * 
30   */
31  public class ServerConnectionDialog extends JDialog {
32  
33  	/**
34  	 * Helper class to persist this window.
35  	 */
36  	private WindowPersistenceHelper persistenceHelper;
37  	
38  	public ServerConnectionDialog(Frame parent,
39  			ReconnectingServerDefinition serverDefinition) {
40  		super(parent, false);
41  
42  		setTitle("Server Connection");
43  
44  		this.add(new ServerConnectionPanel(serverDefinition));
45  		
46  		this.setSize(400, 75);
47  		// Setup persistence
48  		persistenceHelper = new WindowPersistenceHelper(this);
49  		persistenceHelper.load();
50  
51  	}
52  }