private GetEngineSettingsFromPanel(EngineSettings engineSettings)
	{
		this.engineSettings = engineSettings;
		this.ballSize = engineSettings.getBallSize();
		this.ballCount = engineSettings.getBallCount();
		this.speed = engineSettings.getSpeed();
		this.width = engineSettings.getWidth();
		this.height = engineSettings.getHeight();
		this.momentum = engineSettings.getMomentum();
		
		optionsPanel = new JPanel();
		dialog = new JDialog();
		
		lblBallSize = new JLabel("Ball Size:");
		lblBallCount = new JLabel("Ball Count:");
		lblSpeed = new JLabel("Speed:");
		lblWidth = new JLabel("Frame Width:");
		lblHeight = new JLabel("Frame Height:");
		lblMomentum = new JLabel("Momentum (0 .. 1):");
		
		txtBallSize = new JTextField("" + ballSize, textFieldLength);
		txtBallCount = new JTextField("" + ballCount, textFieldLength);
		txtSpeed = new JTextField("" + speed, textFieldLength);
		txtWidth = new JTextField("" + width, textFieldLength);
		txtHeight = new JTextField("" + height, textFieldLength);
		txtMomentum = new JTextField("" + momentum, textFieldLength);
		
		txtBallSize.setMaximumSize(txtBallSize.getPreferredSize());
		txtBallCount.setMaximumSize(txtBallCount.getPreferredSize());
		txtSpeed.setMaximumSize(txtSpeed.getPreferredSize());
		txtWidth.setMaximumSize(txtWidth.getPreferredSize());
		txtHeight.setMaximumSize(txtHeight.getPreferredSize());
		txtMomentum.setMaximumSize(txtMomentum.getPreferredSize());
		
		OKButton = new JButton("OK");
		cancelButton = new JButton("Cancel");
		
		OKButton.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				try
				{
					ballSize = Integer.parseInt(txtBallSize.getText());
					ballCount = Integer.parseInt(txtBallCount.getText());
					speed = Integer.parseInt(txtSpeed.getText());
					width = Integer.parseInt(txtWidth.getText());
					height = Integer.parseInt(txtHeight.getText());
					momentum = Double.parseDouble(txtMomentum.getText());
				}
				
				catch(NumberFormatException ex)
				{
					// Should implement this as a documentlistener in the future.
					JOptionPane.showMessageDialog(null, "Make sure all entries are numbers.");
					// awful form, to be replaced soon.
					return;
				}
				
				try
				{
					getOutsideReference().engineSettings = new EngineSettings.Builder().ballSize(ballSize).ballCount(ballCount).speed(speed).width(width).height(height).momentum(momentum).build();
				}
				
				catch(IllegalArgumentException ex)
				{
					JOptionPane.showMessageDialog(null, ex.getMessage());
					return;
				}
				
				dialog.setModal(false);
				dialog.dispose();
			}
		});
		
		cancelButton.addActionListener(new ActionListener()
		{
			@Override
			public void actionPerformed(ActionEvent e)
			{
				dialog.dispose();
			}
		});
		
		buildOptionsPanel();
		dialog.add(optionsPanel);
		dialog.setSize(optionsPanel.getSize());
		dialog.setMinimumSize(dialog.getSize());
		dialog.setLocationRelativeTo(null);
		dialog.setModal(true);
		dialog.setVisible(true);
	}