public GraphPreferencesDialog(GUI parent){
		super(parent, "Preferences", true);
		GuiHelper.setWindowIcon(this);
		this.parent = parent;

		JPanel cp = new JPanel();
		cp.setLayout(new BorderLayout());
		cp.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
		
		JPanel visualDetails = new JPanel();
		visualDetails.setBorder(BorderFactory.createTitledBorder("Visual Details:"));
		visualDetails.setLayout(new BoxLayout(visualDetails, BoxLayout.Y_AXIS));
		
		drawArrowsCB.setSelected(Configuration.drawArrows);
		visualDetails.add(drawArrowsCB);
		
// Feature not yet implemented
//		drawRulerCB.setSelected(Configuration.drawRulers);
//		visualDetails.add(drawRulerCB);
		
		drawNodesCB.setSelected(Configuration.drawNodes);
		visualDetails.add(drawNodesCB);

		drawEdgesCB.setSelected(Configuration.drawEdges);
		visualDetails.add(drawEdgesCB);
		
		usePerspectiveCB.setSelected(Configuration.usePerspectiveView);
		if(Configuration.dimensions == 3) { // only show in 3D
			visualDetails.add(usePerspectiveCB);
		}
		
		cp.add(visualDetails, BorderLayout.NORTH);
		
		JPanel simulationDetails = new JPanel();
		simulationDetails.setLayout(new GridLayout(3,2, 3, 3));
		simulationDetails.setBorder(BorderFactory.createTitledBorder("Simulation Details:"));
		
		
		// Edges implemenations
		
		Font f = typeOfEdges.getFont().deriveFont(Font.PLAIN);
		typeOfEdges.setFont(f);
		fillTypesOfEdges();
		simulationDetails.add(new JLabel("Type of Edges: "));
		simulationDetails.add(typeOfEdges);
		
		// Transmission model
		selectedTransmissionModel.setFont(f);
		fillTransmissionModel();
		simulationDetails.add(new JLabel("Transmission Model: "));
		simulationDetails.add(selectedTransmissionModel);
		
		simulationDetails.add(new JLabel(""));
		allModelsCheckBox = new JCheckBox("Show all implementations");
		allModelsCheckBox.setSelected(Configuration.showModelsOfAllProjects);
		allModelsCheckBox.addChangeListener(new ChangeListener() {
			public void stateChanged(ChangeEvent e) {
				if(Configuration.showModelsOfAllProjects != allModelsCheckBox.isSelected()) {
					Configuration.showModelsOfAllProjects = allModelsCheckBox.isSelected();
					fillTypesOfEdges();
					fillTransmissionModel();
				}
			}
		});
		simulationDetails.add(allModelsCheckBox);
		JPanel centerPanel = new JPanel();
		centerPanel.setLayout(new BorderLayout());
		centerPanel.setBorder(BorderFactory.createEmptyBorder());
		centerPanel.add(simulationDetails, BorderLayout.NORTH);
		
		JLabel label = new JLabel("<html><table><tr valign='top'><td><b>Note:</b></td><td> These settings affect only this simulation; they are not stored <br>in the config file for further runs.</td></tr></table></html>");
		label.setFont(label.getFont().deriveFont(Font.PLAIN, 11));
		centerPanel.add(label, BorderLayout.SOUTH);

		cp.add(centerPanel, BorderLayout.CENTER);
		
		JPanel buttons = new JPanel();
		
		ok.addActionListener(this);
		buttons.add(ok);
		
		cancel.addActionListener(this);
		buttons.add(cancel);
		
		cp.add(buttons, BorderLayout.SOUTH);
		
		this.setContentPane(cp);
		
		// Detect ESCAPE button
		KeyboardFocusManager focusManager = KeyboardFocusManager.getCurrentKeyboardFocusManager();
		focusManager.addKeyEventPostProcessor(new KeyEventPostProcessor() {
			public boolean postProcessKeyEvent(KeyEvent e) {
				if(!e.isConsumed() && e.getID() == KeyEvent.KEY_PRESSED && e.getKeyCode() == KeyEvent.VK_ESCAPE) {
					GraphPreferencesDialog.this.setVisible(false);
				}
				return false;
			}
		});
		
		
		this.getRootPane().setDefaultButton(ok);
		this.pack();
		this.setLocationRelativeTo(parent);
		this.setVisible(true);
	}