// Path: src/mgi/tools/jagdecs2/util/Options.java
// public class Options {
// 
// 	private File file;
// 	private HashMap<String, String> options;
// 	
// 	public Options(File file) {
// 		this.file = file;
// 		this.options = new HashMap<String, String>();
// 		reload();
// 	}
// 	
// 	/**
// 	 * Save's options to file.
// 	 */
// 	public void save() {
// 		try {
// 			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
// 			
// 			writer.write("# Auto generated options - DO NOT EDIT\n\n\n\n");
// 			
// 			for (String key : options.keySet()) {
// 				writer.write(key + " " + options.get(key) + "\n\n");
// 			}
// 			
// 			writer.close();
// 		}
// 		catch (Throwable t) {
// 			t.printStackTrace();
// 		}
// 	}
// 	
// 	/**
// 	 * Read's options from options file.
// 	 */
// 	public void reload() {
// 		try {
// 			BufferedReader reader = new BufferedReader(new FileReader(file));
// 			
// 			int linesCount = 0;
// 			for (String line = reader.readLine(); line != null; line = reader.readLine(), linesCount++) {
// 				if (line.length() <= 0 || line.startsWith(" ") || line.startsWith("//") || line.startsWith("#"))
// 					continue;			
// 				try {
// 					int space = line.indexOf(' ');
// 					if (space <= 0) {
// 						reader.close();
// 						throw new RuntimeException("Bad syntax!");
// 					}
// 					String key = line.substring(0, space);
// 					String value = line.substring(space + 1);
// 					setOption(key, value);
// 				}
// 				catch (Exception ex) {
// 					reader.close();
// 					throw new RuntimeException("Error parsing options file " + file + " on line:" + (linesCount + 1));
// 				}
// 			}
// 			
// 			reader.close();
// 		}
// 		catch (Throwable t) {
// 			t.printStackTrace();
// 		}
// 	}
// 	
// 	/**
// 	 * Get's option.
// 	 * Return's null if it's not found.
// 	 */
// 	public String getOption(String key) {
// 		if (options.containsKey(key))
// 			return options.get(key);
// 		return null;
// 	}
// 	
// 	/**
// 	 * Set's option.
// 	 */
// 	public void setOption(String key, String value) {
// 		if (options.containsKey(key))
// 			options.remove(key);
// 		options.put(key, value);
// 	}
// 	
// 	
// 	
// }


import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import mgi.tools.jagdecs2.util.Options;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

		opcPath.setText("Loading please wait...");
		opcPath.setColumns(10);
		opcPath.setBounds(43, 89, 184, 20);
		add(opcPath);
		
		JLabel lblScr = new JLabel("Scripts database path:");
		lblScr.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblScr.setBounds(43, 135, 184, 14);
		add(lblScr);
		
		scrPath = new JTextField();
		scrPath.setText("Loading please wait...");
		scrPath.setColumns(10);
		scrPath.setBounds(43, 155, 184, 20);
		add(scrPath);
		
		JLabel lblScrs = new JLabel("Scripts path:");
		lblScrs.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblScrs.setBounds(256, 11, 184, 14);
		add(lblScrs);
		
		scrsPath = new JTextField();
		scrsPath.setText("Loading please wait...");
		scrsPath.setColumns(10);
		scrsPath.setBounds(256, 31, 184, 20);
		add(scrsPath);
		
		JButton btnApply = new JButton("Apply");
		btnApply.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

// Path: src/mgi/tools/jagdecs2/util/Options.java
// public class Options {
// 
// 	private File file;
// 	private HashMap<String, String> options;
// 	
// 	public Options(File file) {
// 		this.file = file;
// 		this.options = new HashMap<String, String>();
// 		reload();
// 	}
// 	
// 	/**
// 	 * Save's options to file.
// 	 */
// 	public void save() {
// 		try {
// 			BufferedWriter writer = new BufferedWriter(new FileWriter(file));
// 			
// 			writer.write("# Auto generated options - DO NOT EDIT\n\n\n\n");
// 			
// 			for (String key : options.keySet()) {
// 				writer.write(key + " " + options.get(key) + "\n\n");
// 			}
// 			
// 			writer.close();
// 		}
// 		catch (Throwable t) {
// 			t.printStackTrace();
// 		}
// 	}
// 	
// 	/**
// 	 * Read's options from options file.
// 	 */
// 	public void reload() {
// 		try {
// 			BufferedReader reader = new BufferedReader(new FileReader(file));
// 			
// 			int linesCount = 0;
// 			for (String line = reader.readLine(); line != null; line = reader.readLine(), linesCount++) {
// 				if (line.length() <= 0 || line.startsWith(" ") || line.startsWith("//") || line.startsWith("#"))
// 					continue;			
// 				try {
// 					int space = line.indexOf(' ');
// 					if (space <= 0) {
// 						reader.close();
// 						throw new RuntimeException("Bad syntax!");
// 					}
// 					String key = line.substring(0, space);
// 					String value = line.substring(space + 1);
// 					setOption(key, value);
// 				}
// 				catch (Exception ex) {
// 					reader.close();
// 					throw new RuntimeException("Error parsing options file " + file + " on line:" + (linesCount + 1));
// 				}
// 			}
// 			
// 			reader.close();
// 		}
// 		catch (Throwable t) {
// 			t.printStackTrace();
// 		}
// 	}
// 	
// 	/**
// 	 * Get's option.
// 	 * Return's null if it's not found.
// 	 */
// 	public String getOption(String key) {
// 		if (options.containsKey(key))
// 			return options.get(key);
// 		return null;
// 	}
// 	
// 	/**
// 	 * Set's option.
// 	 */
// 	public void setOption(String key, String value) {
// 		if (options.containsKey(key))
// 			options.remove(key);
// 		options.put(key, value);
// 	}
// 	
// 	
// 	
// }


// Path: src/mgi/tools/jagdecs2/gui/OptionsPanel.java
import javax.swing.JPanel;
import javax.swing.JTextField;
import javax.swing.JLabel;
import javax.swing.JButton;
import mgi.tools.jagdecs2.util.Options;
import com.jgoodies.forms.layout.FormLayout;
import com.jgoodies.forms.layout.ColumnSpec;
import com.jgoodies.forms.layout.RowSpec;
import com.jgoodies.forms.factories.FormFactory;
import java.awt.Font;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;

		opcPath.setText("Loading please wait...");
		opcPath.setColumns(10);
		opcPath.setBounds(43, 89, 184, 20);
		add(opcPath);
		
		JLabel lblScr = new JLabel("Scripts database path:");
		lblScr.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblScr.setBounds(43, 135, 184, 14);
		add(lblScr);
		
		scrPath = new JTextField();
		scrPath.setText("Loading please wait...");
		scrPath.setColumns(10);
		scrPath.setBounds(43, 155, 184, 20);
		add(scrPath);
		
		JLabel lblScrs = new JLabel("Scripts path:");
		lblScrs.setFont(new Font("Tahoma", Font.BOLD, 13));
		lblScrs.setBounds(256, 11, 184, 14);
		add(lblScrs);
		
		scrsPath = new JTextField();
		scrsPath.setText("Loading please wait...");
		scrsPath.setColumns(10);
		scrsPath.setBounds(256, 31, 184, 20);
		add(scrsPath);
		
		JButton btnApply = new JButton("Apply");
		btnApply.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent e) {

				Options options = window.getMain().getOptions();
