package iDSS.beans2;

import java.util.*;
import java.beans.*;



import iDSS.*;
import iDSS.utils.*;
import iDSS.disp.*;
import iDSS.tables.*;
import iDSS.beans.*;
import iDSS.slr.*;


public class ScenarioListJBean {


    private Vector columnNames;
    private Vector rowsOfData;

    private String scenarioName,storeyLineName,scenarioTable;
    private PropertyChangeSupport pcs;

    private Vector scenarios;




    public ScenarioListJBean() {

        pcs = new PropertyChangeSupport(this);

        iDSS.beans.SLRJBean slrBean = new iDSS.beans.SLRJBean();
        slrBean.setEjbName(IDSSAppConstants.slrBean);
        scenarios = slrBean.findAll();

    }//public ScenarioListJBean()






    public void addPropertyChangeListener(PropertyChangeListener l) {

        pcs.addPropertyChangeListener(l);

    } //public void addPropertyChangeListener(PropertyChangeListener l)






    public void removePropertyChangeListener(PropertyChangeListener l) {

        pcs.removePropertyChangeListener(l);

    } //public void removePropertyChangeListener(PropertyChangeListener l)











    public Vector getScenarios() {


        return scenarios;


/**
        if (rowsOfData.size() > 0){

            GeneralTableModel tm = new GeneralTableModel(rowsOfData,columnNames);
            aTable = new JTable(tm);

        } //if


        else {

            JOptionPane.showMessageDialog (null, "No SLR scenario found in database");

        }

**/

    } //public Vector getSLRScenarios(String ejb)






    public DocumentDisplay getStoreyLine(String title,String url) {

        DocumentDisplay docDisp = new DocumentDisplay(title,url);
        return docDisp;

    } //public DocumentDisplay getStoreyLine(String title,String url)



    public ScenarioDetail getScenarioDetail(String scenarioName) {

        ScenarioDetail slrDetail = new ScenarioDetail(scenarioName);
        return slrDetail;

    } //public ScenarioDetail getScenarioDetail()


} //public class ScenarioListJBean
