public void actionPerformed(ActionEvent ae) {
		String action_com = ae.getActionCommand();
		
		if (action_com != null && action_com.equals("anadirImagen")) {
			model.addImage(view.list.getModel().getSize());
		} else if (action_com != null && action_com.equals("borrarImagen")) {
			if (!(view.list.isSelectionEmpty())) {
				// If it is the only image in the stack, close all windows
				if (view.list.getModel().getSize() == 1) {
					if (RoiManager.getInstance() != null) {
						RoiManager.getInstance().close();
					}
					ImageManager.getInstance().close();
					if (WindowManager.getCurrentImage() != null) {
						WindowManager.getCurrentImage().close();
						WindowManager.setTempCurrentImage(null);
					}
					return;
				}
				model.deleteImage(view.list.getSelectedIndex());
			} else {
				IJ.error("No hay imagen seleccionada");
			}
		}
		model.refresh(view.list);
	}