// Path: src/main/java/generator/extenders/RandomiserPanel.java
// public abstract class RandomiserPanel extends JPanel implements IGeneratorPanel
// {
//     
//     
// }
// 
// Path: src/main/java/generator/extenders/RandomiserInstance.java
// public class RandomiserInstance
// {
//     //the name of the randomiser type to load
//     private String randomiserType; 
//     
//     //name and description are standard fields for all the user-defined cases.
//     private String name;       
//     private String description;
//     
//     //any object can be stored in the properties hashmap, however, it will be
//     //its String representation that will be saved in the XML file.
//     private LinkedHashMap properties;
//     
//     
//     public RandomiserInstance()
//     {        
//     }
//     
// 
//     public RandomiserInstance( String randomiserType,
//                                String name,
//                                String description,
//                                LinkedHashMap properties)
//     {
//         this.randomiserType = randomiserType;
//         this.name = name;
//         this.description = description;
//         this.properties = properties;
//     }
//     
//     
//     public String getRandomiserType()
//     {
//         return randomiserType;
//     }
// 
//     public void setRandomiserType(String randomiserType)
//     {
//         this.randomiserType = randomiserType;
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public void setName(String name)
//     {
//         this.name = name;
//     }
// 
//     public String getDescription()
//     {
//         return description;
//     }
// 
//     public void setDescription(String description)
//     {
//         this.description = description;
//     }
// 
//     public LinkedHashMap getProperties()
//     {
//         return properties;
//     }
// 
//     public void setProperties(LinkedHashMap properties)
//     {
//         this.properties = properties;
//     }
// 
//     public String toString()
//     {
//         return name;        
//     }
// }


import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.LinkedHashMap;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.apache.log4j.Logger;
import generator.extenders.RandomiserPanel;
import generator.extenders.IGeneratorPanel;
import generator.extenders.RandomiserInstance;



package generator.panels;


public class PanelListItemsSequencer  extends RandomiserPanel
{
    
    Logger logger = Logger.getLogger(PanelListItemsSequencer.class);
    /** Creates new form PanelDoubleGenerator */
    
    
    /** Creates new form PanelListItemGenerator */
    public PanelListItemsSequencer()
    {
        initComponents();
        radFile.setSelected(true);        
        newModel.addColumn("Item");
        
        tblItems.setModel(newModel);
        enableList(false);
        loadButtonImages();
    }
    
    private void loadButtonImages() {
        URL urlAdd = this.getClass().getClassLoader().getResource("resources/images/list-add-small.png");
        URL urlRemSelect = this.getClass().getClassLoader().getResource("resources/images/list-remove-small.png");
        URL urlBrowse = this.getClass().getClassLoader().getResource("resources/images/document-open-small.png");
        
        btnAddItem.setIcon(new ImageIcon(urlAdd));
        btnRemove.setIcon(new ImageIcon(urlRemSelect));
        btnBrowse.setIcon(new ImageIcon(urlBrowse));
    }
   
    public boolean isFormValid()
    {
        String name;
        String fname, temp;
        int percent, ival;
        Integer intValue;
        
        
        name = txtName.getText().trim();

        //run checks
        if(name.length()==0)
        {
            JOptionPane.showMessageDialog(this,"Please provide a value for the name.","Required field",JOptionPane.ERROR_MESSAGE); 
            return false;
        }        
        
        if(radFile.isSelected())
        {
            fname = txtFilename.getText().trim();
            if(fname.length()==0)
            {
                JOptionPane.showMessageDialog(this,"Please provide a value for the filename.","Required field",JOptionPane.ERROR_MESSAGE); 
                return false;
            }                    
        }
        if(radList.isSelected())
        {
            int listCount = newModel.getRowCount();
            if(listCount<1)
            {
                JOptionPane.showMessageDialog(this,"Please provide at least two items.","Required fields",JOptionPane.ERROR_MESSAGE); 
                return false;
            }                    
        }

        return true;
    }
    

// Path: src/main/java/generator/extenders/RandomiserPanel.java
// public abstract class RandomiserPanel extends JPanel implements IGeneratorPanel
// {
//     
//     
// }
// 
// Path: src/main/java/generator/extenders/RandomiserInstance.java
// public class RandomiserInstance
// {
//     //the name of the randomiser type to load
//     private String randomiserType; 
//     
//     //name and description are standard fields for all the user-defined cases.
//     private String name;       
//     private String description;
//     
//     //any object can be stored in the properties hashmap, however, it will be
//     //its String representation that will be saved in the XML file.
//     private LinkedHashMap properties;
//     
//     
//     public RandomiserInstance()
//     {        
//     }
//     
// 
//     public RandomiserInstance( String randomiserType,
//                                String name,
//                                String description,
//                                LinkedHashMap properties)
//     {
//         this.randomiserType = randomiserType;
//         this.name = name;
//         this.description = description;
//         this.properties = properties;
//     }
//     
//     
//     public String getRandomiserType()
//     {
//         return randomiserType;
//     }
// 
//     public void setRandomiserType(String randomiserType)
//     {
//         this.randomiserType = randomiserType;
//     }
// 
//     public String getName()
//     {
//         return name;
//     }
// 
//     public void setName(String name)
//     {
//         this.name = name;
//     }
// 
//     public String getDescription()
//     {
//         return description;
//     }
// 
//     public void setDescription(String description)
//     {
//         this.description = description;
//     }
// 
//     public LinkedHashMap getProperties()
//     {
//         return properties;
//     }
// 
//     public void setProperties(LinkedHashMap properties)
//     {
//         this.properties = properties;
//     }
// 
//     public String toString()
//     {
//         return name;        
//     }
// }


// Path: src/main/java/generator/panels/PanelListItemsSequencer.java
import java.io.File;
import java.net.URL;
import java.util.HashMap;
import java.util.LinkedHashMap;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.apache.log4j.Logger;
import generator.extenders.RandomiserPanel;
import generator.extenders.IGeneratorPanel;
import generator.extenders.RandomiserInstance;



package generator.panels;


public class PanelListItemsSequencer  extends RandomiserPanel
{
    
    Logger logger = Logger.getLogger(PanelListItemsSequencer.class);
    /** Creates new form PanelDoubleGenerator */
    
    
    /** Creates new form PanelListItemGenerator */
    public PanelListItemsSequencer()
    {
        initComponents();
        radFile.setSelected(true);        
        newModel.addColumn("Item");
        
        tblItems.setModel(newModel);
        enableList(false);
        loadButtonImages();
    }
    
    private void loadButtonImages() {
        URL urlAdd = this.getClass().getClassLoader().getResource("resources/images/list-add-small.png");
        URL urlRemSelect = this.getClass().getClassLoader().getResource("resources/images/list-remove-small.png");
        URL urlBrowse = this.getClass().getClassLoader().getResource("resources/images/document-open-small.png");
        
        btnAddItem.setIcon(new ImageIcon(urlAdd));
        btnRemove.setIcon(new ImageIcon(urlRemSelect));
        btnBrowse.setIcon(new ImageIcon(urlBrowse));
    }
   
    public boolean isFormValid()
    {
        String name;
        String fname, temp;
        int percent, ival;
        Integer intValue;
        
        
        name = txtName.getText().trim();

        //run checks
        if(name.length()==0)
        {
            JOptionPane.showMessageDialog(this,"Please provide a value for the name.","Required field",JOptionPane.ERROR_MESSAGE); 
            return false;
        }        
        
        if(radFile.isSelected())
        {
            fname = txtFilename.getText().trim();
            if(fname.length()==0)
            {
                JOptionPane.showMessageDialog(this,"Please provide a value for the filename.","Required field",JOptionPane.ERROR_MESSAGE); 
                return false;
            }                    
        }
        if(radList.isSelected())
        {
            int listCount = newModel.getRowCount();
            if(listCount<1)
            {
                JOptionPane.showMessageDialog(this,"Please provide at least two items.","Required fields",JOptionPane.ERROR_MESSAGE); 
                return false;
            }                    
        }

        return true;
    }
    

    public RandomiserInstance getRandomiserInstance()
