@Override
	public void actionPerformed(ActionEvent e) {
		if (OPEN_COMMAND.equals(e.getActionCommand())) {
			JFileChooser fc = new JFileChooser();
			fc.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
			int selectedOption = fc.showDialog(main, "Open File or Directory");
			if (selectedOption == JFileChooser.APPROVE_OPTION) {
				File file = fc.getSelectedFile();
				main.openFile(file);
			}
		} else if (PRINT_COMMAND.equals(e.getActionCommand())) {
			PrinterJob printJob = Printer.getPrinterJob(main.getSettings());
			
			boolean doPrint = printJob.printDialog();
			if (doPrint) {
				try {
					printJob.print();
				} catch (PrinterException e1) {
					e1.printStackTrace();
				}
			}
			
		} else if (ZOOM_IN_COMMAND.equals(e.getActionCommand())) {
			main.zoomIn();
		} else if (ZOOM_OUT_COMMAND.equals(e.getActionCommand())) {
			main.zoomOut();
		} else if (HIDE_LEADING_AND_TRALING_MEASURES_COMMAND.equals(e.getActionCommand())) {
			main.invertMeasureTrimming();
		} else if (ABOUT_COMMAND.equals(e.getActionCommand())) {
			JOptionPane.showMessageDialog(null, new AboutDialog(), "About", JOptionPane.INFORMATION_MESSAGE);
		}
		
	}