// Path: cjwizard/src/main/java/com/github/cjwizard/pagetemplates/DefaultPageTemplate.java
// public class DefaultPageTemplate extends PageTemplate {
//    
//    /**
//     * Log instance
//     */
//    private final Logger log = LoggerFactory.getLogger(WizardContainer.class);
//    
//    private final CardLayout _layout = new CardLayout();
//    
//    public DefaultPageTemplate(){
//       this.setLayout(_layout);
//    }
//    
//    /* (non-Javadoc)
//     * @see com.github.cjwizard.PageTemplate#setPage(com.github.cjwizard.WizardPage)
//     */
//    public void setPage(final WizardPage page){
//       log.debug("Setting page: "+page);
// 
//       // remove the page, just in case it was added before:
//       remove(page);
//       validate();
//       
//       add(page, page.getId());
//       _layout.show(this, page.getId());
//    }
// }
// 
// Path: cjwizard/src/main/java/com/github/cjwizard/pagetemplates/PageTemplate.java
// public abstract class PageTemplate extends JPanel {
// 
//    /**
//     * Reference to the wizard controller that manages this template.
//     */
//    private WizardController _controller = null;
//    
//    /**
//     * Called when a new page is to be displayed in the wizard.
//     * 
//     * @param page The page to display.
//     */
//    public abstract void setPage(final WizardPage page);
// 
//    /**
//     * Registers a WizardController with this class.
//     * 
//     * @param controller a reference to the controller
//     */
//    public void registerController(WizardController controller) {
//       _controller = controller;
//    }
// 
//    /**
//     * @return the WizardController that manages this wizard.
//     */
//    protected WizardController getController() {
//       return _controller;
//    }
// }
// 
// Path: cjwizard/src/main/java/com/github/cjwizard/utilities/ExceptionUtilities.java
// public class ExceptionUtilities {
// 
//    /**
//     * Checks to see if obj is null, and if so throws an
//     * IllegalArgumentException with the given message.
//     * 
//     * @param obj the object to check
//     * @param msg an error message
//     * @throws IllegalArgumentException if the referenced object is null
//     */
//    public static void checkNull(Object obj, String msg) {
//       if (null == obj)
//          throw new IllegalArgumentException(msg);
//    }
// 
// }


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.cjwizard.pagetemplates.DefaultPageTemplate;
import com.github.cjwizard.pagetemplates.PageTemplate;
import com.github.cjwizard.utilities.ExceptionUtilities;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;

      for (WizardListener l : _listeners) {
         l.onCanceled(getPath(), getSettings());
      }
   }

   /*
    * (non-Javadoc)
    * 
    * @see
    * com.github.cjwizard.WizardController#addWizardListener(com.stottlerhenke
    * .presentwell.wizard.WizardListener)
    */
   public void addWizardListener(WizardListener listener) {
      ExceptionUtilities.checkNull(listener, "listener");
      if (!_listeners.contains(listener)) {
         _listeners.add(listener);
         WizardPage curPage = _path.get(_path.size() - 1);
         listener.onPageChanged(curPage, getPath());
      }
   }

   /*
    * (non-Javadoc)
    * 
    * @see
    * com.github.cjwizard.WizardController#removeWizardListener(com.stottlerhenke
    * .presentwell.wizard.WizardListener)
    */
   public void removeWizardListener(WizardListener listener) {
// Path: cjwizard/src/main/java/com/github/cjwizard/pagetemplates/DefaultPageTemplate.java
// public class DefaultPageTemplate extends PageTemplate {
//    
//    /**
//     * Log instance
//     */
//    private final Logger log = LoggerFactory.getLogger(WizardContainer.class);
//    
//    private final CardLayout _layout = new CardLayout();
//    
//    public DefaultPageTemplate(){
//       this.setLayout(_layout);
//    }
//    
//    /* (non-Javadoc)
//     * @see com.github.cjwizard.PageTemplate#setPage(com.github.cjwizard.WizardPage)
//     */
//    public void setPage(final WizardPage page){
//       log.debug("Setting page: "+page);
// 
//       // remove the page, just in case it was added before:
//       remove(page);
//       validate();
//       
//       add(page, page.getId());
//       _layout.show(this, page.getId());
//    }
// }
// 
// Path: cjwizard/src/main/java/com/github/cjwizard/pagetemplates/PageTemplate.java
// public abstract class PageTemplate extends JPanel {
// 
//    /**
//     * Reference to the wizard controller that manages this template.
//     */
//    private WizardController _controller = null;
//    
//    /**
//     * Called when a new page is to be displayed in the wizard.
//     * 
//     * @param page The page to display.
//     */
//    public abstract void setPage(final WizardPage page);
// 
//    /**
//     * Registers a WizardController with this class.
//     * 
//     * @param controller a reference to the controller
//     */
//    public void registerController(WizardController controller) {
//       _controller = controller;
//    }
// 
//    /**
//     * @return the WizardController that manages this wizard.
//     */
//    protected WizardController getController() {
//       return _controller;
//    }
// }
// 
// Path: cjwizard/src/main/java/com/github/cjwizard/utilities/ExceptionUtilities.java
// public class ExceptionUtilities {
// 
//    /**
//     * Checks to see if obj is null, and if so throws an
//     * IllegalArgumentException with the given message.
//     * 
//     * @param obj the object to check
//     * @param msg an error message
//     * @throws IllegalArgumentException if the referenced object is null
//     */
//    public static void checkNull(Object obj, String msg) {
//       if (null == obj)
//          throw new IllegalArgumentException(msg);
//    }
// 
// }


// Path: cjwizard/src/main/java/com/github/cjwizard/WizardContainer.java
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.github.cjwizard.pagetemplates.DefaultPageTemplate;
import com.github.cjwizard.pagetemplates.PageTemplate;
import com.github.cjwizard.utilities.ExceptionUtilities;
import java.awt.BorderLayout;
import java.awt.event.ActionEvent;
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.LinkedList;
import java.util.List;
import java.util.ResourceBundle;
import javax.swing.AbstractAction;
import javax.swing.BorderFactory;
import javax.swing.Box;
import javax.swing.BoxLayout;
import javax.swing.JButton;
import javax.swing.JPanel;


      for (WizardListener l : _listeners) {
         l.onCanceled(getPath(), getSettings());
      }
   }

   /*
    * (non-Javadoc)
    * 
    * @see
    * com.github.cjwizard.WizardController#addWizardListener(com.stottlerhenke
    * .presentwell.wizard.WizardListener)
    */
   public void addWizardListener(WizardListener listener) {
      ExceptionUtilities.checkNull(listener, "listener");
      if (!_listeners.contains(listener)) {
         _listeners.add(listener);
         WizardPage curPage = _path.get(_path.size() - 1);
         listener.onPageChanged(curPage, getPath());
      }
   }

   /*
    * (non-Javadoc)
    * 
    * @see
    * com.github.cjwizard.WizardController#removeWizardListener(com.stottlerhenke
    * .presentwell.wizard.WizardListener)
    */
   public void removeWizardListener(WizardListener listener) {
      ExceptionUtilities.checkNull(listener, "listener");