Git Repository Public Repository

RRRRHHHH_Code

URLs

Copy to Clipboard
 
d30bcc8a3c13bbf5144b03a644c1345865aed708
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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
package gui;

/**
 * @author willCodeForFood
 */
import java.awt.Color;
import java.awt.Font;
import java.awt.KeyEventDispatcher;
import java.awt.KeyboardFocusManager;
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
import java.rmi.RMISecurityManager;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.SwingConstants;
import javax.swing.UIManager;

import configuration.ConfigXML;

@SuppressWarnings("deprecation")
public class StartWindow extends JFrame {

	private static final long serialVersionUID = 1L;

	private JPanel jContentPane = null;
	private JButton boton2 = null;
	private JButton boton3 = null;
	private static configuration.ConfigXML c;
	private JLabel lblNewLabel;

	public static void main(String[] args) {

		StartWindow a = new StartWindow();
		
		System.setProperty("java.security.policy", "java.policy");
		
		a.setVisible(true);

		try {

			c = ConfigXML.getInstance();

			System.setProperty("java.security.policy", c.getJavaPolicyPath());

			System.setSecurityManager(new RMISecurityManager());

			UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());

			c = configuration.ConfigXML.getInstance();

		} catch (com.db4o.ext.DatabaseFileLockedException e) {
			a.lblNewLabel
					.setText("Database locked: Do not run BusinessLogicServer or BusinessLogicServer!!");
			a.lblNewLabel.setForeground(Color.RED);
			System.out.println("Error in StartWindow: " + e.toString());
		} catch (Exception e) {
			a.lblNewLabel.setText("Error: " + e.toString());
			a.lblNewLabel.setForeground(Color.RED);
			System.out.println("Error in StartWindow: " + e.toString());
		}

	}

	/**
	 * This is the default constructor
	 */

	public StartWindow() {
		super();

		addWindowListener(new WindowAdapter() {
			@Override
			public void windowClosing(WindowEvent e) {

				System.exit(1);
			}

		});

		KeyboardFocusManager.getCurrentKeyboardFocusManager()
				.addKeyEventDispatcher(new KeyEventDispatcher() {

					@Override
					public boolean dispatchKeyEvent(KeyEvent e) {
						switch (e.getKeyCode()) {

						case KeyEvent.VK_ESCAPE:
							System.exit(1);
						
						}
						return false;
					}
				});
		initialize();
		// this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
	}

	/**
	 * This method initializes this
	 * 
	 * @return void
	 */
	private void initialize() {
		// this.setSize(271, 295);
		this.setSize(495, 290);
		this.setContentPane(getJContentPane());
		this.setTitle("Rural Houses");
	}

	/**
	 * This method initializes jContentPane
	 * 
	 * @return javax.swing.JPanel
	 */
	private JPanel getJContentPane() {
		if (jContentPane == null) {
			jContentPane = new JPanel();
			jContentPane.setLayout(null);
			jContentPane.add(getLblNewLabel());
			jContentPane.add(getBoton2());
			jContentPane.add(getBoton3());
		}
		return jContentPane;
	}

	/**
	 * This method initializes boton2
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getBoton2() {
		if (boton2 == null) {
			boton2 = new JButton();
			boton2.setBounds(0, 74, 479, 93);
			boton2.setText("Login");
			boton2.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// C?digo cedido por la universidad
					JFrame a = new LoginGUI();
					a.setVisible(true);
				}
			});
		}
		return boton2;
	}

	/**
	 * This method initializes boton3
	 * 
	 * @return javax.swing.JButton
	 */
	private JButton getBoton3() {
		if (boton3 == null) {
			boton3 = new JButton();
			boton3.setBounds(0, 165, 479, 87);
			boton3.setText("Query availability");
			boton3.addActionListener(new java.awt.event.ActionListener() {
				public void actionPerformed(java.awt.event.ActionEvent e) {
					// C?digo cedido por la universidad
					// JFrame a = new QueryAvailabilityWindow();
					JFrame a = new QueryAvailabilityGUI2();

					a.setVisible(true);
				}
			});
		}
		return boton3;
	}

	private JLabel getLblNewLabel() {
		if (lblNewLabel == null) {
			lblNewLabel = new JLabel("Select option:");
			lblNewLabel.setBounds(0, 0, 479, 63);
			lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 13));
			lblNewLabel.setForeground(Color.BLACK);
			lblNewLabel.setHorizontalAlignment(SwingConstants.CENTER);
		}
		return lblNewLabel;
	}

} // @jve:decl-index=0:visual-constraint="0,0"

Commits for RRRRHHHH_CoderuralHouses/src/gui/StartWindow.java

Diff revisions: vs.
Revision Author Commited Message
d30bcc ... Diff Diff pinene picture pinene Wed 20 May, 2015 16:32:33 +0000

cleaning

4f8bcc ... Diff Diff epinzolas001 Mon 18 May, 2015 09:49:54 +0000

Merge conflicts solutioned

42679b ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 14:18:02 +0000

Merge branch ‘master’ of https://xp-dev.com/git/RRRRHHHH_Code

Conflicts:
ruralHouses/src/businessLogic/OfferManager.java
ruralHouses/src/gui/HouseFeaturesGUI.java
ruralHouses/src/gui/ModifyHouseGUI.java
ruralHouses/src/gui/StartWindow.java

520867 ... Diff Diff pinene picture pinene Sun 19 Apr, 2015 14:09:12 +0000

tmp

837fab ... Diff Diff Eneko Pinzolas Murua Sat 18 Apr, 2015 14:09:49 +0000

no warnings

2ac167 ... Diff Diff Eneko Pinzolas Murua Wed 15 Apr, 2015 13:53:44 +0000

admin completed

e2ae30 ... Diff Diff Eneko Pinzolas Murua Tue 14 Apr, 2015 15:07:35 +0000

imports leaned

3e4f7e ... Diff Diff camjan Wed 08 Apr, 2015 13:18:53 +0000

New GUI for booking and querying availability

5dd541 ... Diff Diff camjan Wed 11 Mar, 2015 22:59:01 +0000

GUI added to show list of available houses

e16868 ... Eneko Pinzolas Murua Mon 09 Mar, 2015 13:02:33 +0000

deleted aplicationFacade and imported it’s functions to specific business logics.