// 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/extenders/RandomiserPanel.java
// public abstract class RandomiserPanel extends JPanel implements IGeneratorPanel
// {
//     
//     
// }


import generator.extenders.RandomiserInstance;
import generator.extenders.RandomiserPanel;
import java.net.URL;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.LinkedHashMap;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.apache.log4j.Logger;

                sDateFrom = objValues[0].toString();
                sDateTo   = objValues[1].toString();
                sPercent  = objValues[2].toString();
                dateFrom  = Date.valueOf(sDateFrom);
                dateTo    = Date.valueOf(sDateTo);
                
                if( dateFrom.getTime() > dateTo.getTime())
                {
                    JOptionPane.showMessageDialog(this,"From date has a higher value than To date.","Invalid field",JOptionPane.ERROR_MESSAGE);
                    return false;
                }
                temp = Integer.valueOf(sPercent);
                percent+=temp;
            }
            catch(Exception e)
            {
                logger.warn("Error retrieving data from table",e);
                JOptionPane.showMessageDialog(this,"Values in the table should be dates (from,to) or numerical (percent.).","Invalid field",JOptionPane.ERROR_MESSAGE);
                return false;
            }
        }
        if(percent!=100)
        {
            JOptionPane.showMessageDialog(this,"Percentages in the table should add up to 100.","Invalid field",JOptionPane.ERROR_MESSAGE);
            return false;
        }
               
        return true;
    }
    

// 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/extenders/RandomiserPanel.java
// public abstract class RandomiserPanel extends JPanel implements IGeneratorPanel
// {
//     
//     
// }


// Path: src/main/java/generator/panels/PanelSQLDateRandomiser.java
import generator.extenders.RandomiserInstance;
import generator.extenders.RandomiserPanel;
import java.net.URL;
import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.LinkedHashMap;
import javax.swing.ImageIcon;
import javax.swing.JCheckBox;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;
import org.apache.log4j.Logger;

                sDateFrom = objValues[0].toString();
                sDateTo   = objValues[1].toString();
                sPercent  = objValues[2].toString();
                dateFrom  = Date.valueOf(sDateFrom);
                dateTo    = Date.valueOf(sDateTo);
                
                if( dateFrom.getTime() > dateTo.getTime())
                {
                    JOptionPane.showMessageDialog(this,"From date has a higher value than To date.","Invalid field",JOptionPane.ERROR_MESSAGE);
                    return false;
                }
                temp = Integer.valueOf(sPercent);
                percent+=temp;
            }
            catch(Exception e)
            {
                logger.warn("Error retrieving data from table",e);
                JOptionPane.showMessageDialog(this,"Values in the table should be dates (from,to) or numerical (percent.).","Invalid field",JOptionPane.ERROR_MESSAGE);
                return false;
            }
        }
        if(percent!=100)
        {
            JOptionPane.showMessageDialog(this,"Percentages in the table should add up to 100.","Invalid field",JOptionPane.ERROR_MESSAGE);
            return false;
        }
               
        return true;
    }
    

    public RandomiserInstance getRandomiserInstance()
