public void actionPerformed(ActionEvent e) {
		
		// Check which button was pressed
		switch( e.getActionCommand()){
		
		// Open pattern details window if the pattern datails button was pressed.
		case "PatternDetails":
			if  (this.details_dialog == null){
				try {
					PreviewImageIcon thumbnail = new PreviewImageIcon();
					thumbnail.setImage(ImageIO.read(this.pattern.getPatternThumbnail()));
			
					this.details_dialog = new PatternDetailsDialog(this.parent, thumbnail, this.pattern.getUsedColorList());
					
				} catch (IOException io_err) {
					JOptionPane.showMessageDialog(this, io_err.getMessage());
				}
			}
				
			this.details_dialog.setVisible(true);
			this.details_dialog.requestFocus();
			
		break;
		
		// if the pegboard switcher button was pressed.
		case "SwitchPegboard":
			if (this.switcher_dialog == null){
				this.switcher_dialog = new SwitchPegboardDialog(this, this.parent,this.pattern.getSize(),this.pegboard_index);
				this.switcher_dialog.setVisible(true);
				
			}
			
			this.switcher_dialog.setVisible(true);
			this.switcher_dialog.requestFocus();
			
		break;
		}
	}