Exemple #1
0
        /// <summary>
        /// Checks to see if a row can be added to the table.  Rows cannot be added if the first row is not fully
        /// filled out.
        /// TODO (JTS - 2006-03-06)
        /// I think this is bad code.  I think the elementAt() call should return the
        /// last data value -- as it is, it is only checking that the first row is
        /// set up properly. </summary>
        /// <returns> true if a new row can be added, false if not. </returns>
        public virtual bool canAddRow()
        {
            if (_rows == 0)
            {
                return(true);
            }
            StateMod_GraphNode gn = (StateMod_GraphNode)_data.get(0);

            if (gn.getFileName().Trim().Equals(""))
            {
                return(false);
            }
            if (gn.getType().Trim().Equals(""))
            {
                return(false);
            }
            if (gn.getDtype().Trim().Equals(""))
            {
                return(false);
            }
            if (gn.getYrAve().Trim().Equals(""))
            {
                return(false);
            }
            if (gn.getID().Trim().Equals(""))
            {
                return(false);
            }
            return(true);
        }
Exemple #2
0
        /// <summary>
        /// From AbstractTableModel; returns the data that should be placed in the JTable
        /// at the given row and column. </summary>
        /// <param name="row"> the row for which to return data. </param>
        /// <param name="col"> the column for which to return data. </param>
        /// <returns> the data that should be placed in the JTable at the given row and col. </returns>
        public virtual object getValueAt(int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }

            StateMod_GraphNode gn = (StateMod_GraphNode)_data.get(row);

            switch (col)
            {
            case COL_FILE:
                return(gn.getFileName());

            case COL_TYPE:
                return(gn.getType());

            case COL_PARM:
                string s = gn.getDtype();
                // FIXME SAM 2008-03-24 No need to do this with newer StateMod
                // since binary file uses underscores for data types.
                //s = (s.replace('_', ' ')).trim();
                return(s);

            case COL_YEAR:
                return(gn.getYrAve());

            case COL_ID:
                return(gn.getID());

            default:
                return("");
            }
        }
Exemple #3
0
        /// <summary>
        /// Inserts the specified value into the table at the given position. </summary>
        /// <param name="value"> the object to store in the table cell. </param>
        /// <param name="row"> the row of the cell in which to place the object. </param>
        /// <param name="col"> the column of the cell in which to place the object. </param>
        public virtual void setValueAt(object value, int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }
            setDirty(true);
            StateMod_GraphNode gn = (StateMod_GraphNode)_data.get(row);

            switch (col)
            {
            case COL_TYPE:
                string type = gn.getType();
                if (type.Equals((string)value))
                {
                    break;
                }
                gn.setType((string)value);
                gn.setID("");
                gn.setSwitch(-1);
                setValueAt("", row, 1);
                setValueAt("", row, 2);
                fireTableDataChanged();
                overrideCellEdit(row, 1, true);
                overrideCellEdit(row, 2, false);
                fillIDColumn(row, (string)value);
                break;

            case COL_ID:
                gn.setID((string)value);
                gn.setSwitch(-1);
                setValueAt("", row, 2);
                fireTableDataChanged();
                overrideCellEdit(row, 2, true);
                break;

            case COL_SWITCH:
                string offOn = (string)value;
                if (offOn.Equals("Off"))
                {
                    gn.setSwitch(0);
                }
                else if (offOn.Equals("On"))
                {
                    gn.setSwitch(1);
                }
                else
                {
                    gn.setSwitch(-1);
                }
                break;
            }

            base.setValueAt(value, row, col);
        }
Exemple #4
0
        /// <summary>
        /// Fills the parameter column in the given row based on the station type selected for that row. </summary>
        /// <param name="row"> the row for which to fill the parameter column. </param>
        /// <param name="type"> the type of the station in the given row. </param>
        public virtual void fillParameterColumn(int row, string type)
        {
            IList <string> datatypes = new List <string>();

            // Get the model output data types (no input since SmDelta deals with output).
            if (type.Equals("Diversion", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.DIVERSION_TYPE, false);
            }
            else if (type.Equals("Instream flow", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.INSTREAM_TYPE, false);
            }
            else if (type.Equals("Reservoir", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.RESERVOIR_TYPE, false);
            }
            else if (type.Equals("Streamflow", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.STREAM_TYPE, false);
            }
            else if (type.Equals("Well", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.WELL_TYPE, false);
            }
            else if (type.Equals("Stream ID (0* Gages)", StringComparison.OrdinalIgnoreCase))
            {
                datatypes = StateMod_GraphNode.getGraphDataType(StateMod_GraphNode.STREAM_TYPE, false);
            }

            IList <string> finalTypes = new List <string>();

            finalTypes.Add("");

            for (int i = 0; i < datatypes.Count; i++)
            {
                // FIXME SAM 2008-03-20 No need to remove underscores for newer versions of StateMod, right?.
                // Use data types from binary file.
                //finalTypes.add(((String)datatypes.elementAt(i)).replace('_', ' '));
                finalTypes.Add(datatypes[i]);
            }

            if (__worksheet != null)
            {
                //System.out.println("Setting cell-specific stuff");
                __worksheet.setCellSpecificJComboBoxValues(row, COL_PARM, finalTypes);
            }
        }
Exemple #5
0
        /// <summary>
        /// Returns the data that should be placed in the JTable at the given row and column. </summary>
        /// <param name="row"> the row for which to return data. </param>
        /// <param name="col"> the column for which to return data. </param>
        /// <returns> the data that should be placed in the JTable at the given row and col. </returns>
        public virtual object getValueAt(int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }

            StateMod_GraphNode gn = (StateMod_GraphNode)_data.get(row);

            string ID = gn.getID();

            switch (col)
            {
            case COL_TYPE:
                string type = gn.getType();
                if (type.Equals(""))
                {
                    return("");
                }
                else if (type.Equals("INS", StringComparison.OrdinalIgnoreCase) || type.Equals("Instream Flow", StringComparison.OrdinalIgnoreCase))
                {
                    return("Instream Flow");
                }
                else if (type.Equals("DIV", StringComparison.OrdinalIgnoreCase) || type.Equals("Diversion", StringComparison.OrdinalIgnoreCase))
                {
                    return("Diversion");
                }
                else if (type.Equals("RES", StringComparison.OrdinalIgnoreCase) || type.Equals("Reservoir", StringComparison.OrdinalIgnoreCase))
                {
                    return("Reservoir");
                }
                else if (type.Equals("STR", StringComparison.OrdinalIgnoreCase) || type.Equals("Streamflow", StringComparison.OrdinalIgnoreCase))
                {
                    return("Streamflow");
                }
                else if (type.Equals("WEL", StringComparison.OrdinalIgnoreCase) || type.Equals("Well", StringComparison.OrdinalIgnoreCase))
                {
                    return("Well");
                }
                else
                {
                    if (ID.Equals("All"))
                    {
                        return("");
                    }
                    return("Other");
                }

            case COL_ID:
                if (ID.Equals("All"))
                {
                    return("All");
                }
                else if (ID.Equals(""))
                {
                    return("");
                }
                return(findIDMatch(gn.getType(), gn.getID()));

            case COL_SWITCH:
                if (ID.Equals("All"))
                {
                    return("");
                }
                if (gn.getSwitch() == 0)
                {
                    return("Off");
                }
                else if (gn.getSwitch() == 1)
                {
                    return("On");
                }
                else
                {
                    return("");
                }

            default:
                return("");
            }
        }
Exemple #6
0
        /// <summary>
        /// Saves form data to the data set. </summary>
        /// <param name="worksheetData"> the data in the worksheet to save. </param>
        /// <returns> a list of data objects created from the data in the worksheet. </returns>
        public virtual IList <StateMod_GraphNode> formSaveData(IList <StateMod_GraphNode> worksheetData)
        {
            int rows = worksheetData.Count;

            if (rows == 0)
            {
                return(new List <StateMod_GraphNode>());
            }

            // gnw will be a node used to read data FROM the _W_orksheet nodes
            StateMod_GraphNode gnw = worksheetData[0];

            string pfile  = gnw.getFileName().Trim();
            string ptype  = gnw.getType().Trim();
            string pdtype = gnw.getDtype().Trim();
            string pyear  = gnw.getYrAve().Trim();
            string pid    = gnw.getID().Trim();

            string file  = null;
            string type  = null;
            string dtype = null;
            string year  = null;
            string id    = null;

            // gno will be a node used for creating the _O_utput nodes
            StateMod_GraphNode gno = new StateMod_GraphNode();

            gno.setFileName(pfile);
            gno.setType(ptype);
            gno.setDtype(pdtype);
            gno.setYrAve(pyear);
            int paren = pid.IndexOf("(", StringComparison.Ordinal);

            if (paren > -1)
            {
                gno.addID(pid.Substring(0, paren).Trim());
            }
            else
            {
                gno.addID(pid);
            }

            IList <StateMod_GraphNode> v = new List <StateMod_GraphNode>();

            for (int i = 1; i < rows; i++)
            {
                gnw = worksheetData[i];

                file = gnw.getFileName().Trim();
                if (file.Equals(""))
                {
                    file = pfile;
                }
                type = gnw.getType().Trim();
                if (type.Equals(""))
                {
                    type = ptype;
                }
                dtype = gnw.getDtype().Trim();
                if (dtype.Equals(""))
                {
                    dtype = pdtype;
                }
                year = gnw.getYrAve().Trim();
                if (year.Equals(""))
                {
                    year = pyear;
                }
                id = gnw.getID().Trim();
                if (id.Equals(""))
                {
                    id = pid;
                }

                if (file.Equals(pfile) && type.Equals(ptype) && dtype.Equals(pdtype) && year.Equals(pyear))
                {
                    // all the fields match, so this is a different ID
                    // added to the Vector of IDs in the node's vector.
                    paren = id.IndexOf("(", StringComparison.Ordinal);
                    if (paren > -1)
                    {
                        gno.addID(id.Substring(0, paren).Trim());
                    }
                    else
                    {
                        gno.addID(id);
                    }
                }
                else
                {
                    // otherwise, values other than just the ID are
                    // different, so a new node needs created
                    v.Add(gno);

                    gno = new StateMod_GraphNode();
                    gno.setFileName(file);
                    gno.setType(type);
                    gno.setDtype(dtype);
                    gno.setYrAve(year);
                    paren = id.IndexOf("(", StringComparison.Ordinal);
                    if (paren > -1)
                    {
                        gno.addID(id.Substring(0, paren).Trim());
                    }
                    else
                    {
                        gno.addID(id);
                    }
                }

                pfile  = file;
                ptype  = type;
                pdtype = dtype;
                pyear  = year;
                pid    = id;
            }

            v.Add(gno);

            return(v);
        }
Exemple #7
0
        /// <summary>
        /// Creates a list of objects suitable for use in the worksheet from the data
        /// read from a delta plot file. </summary>
        /// <param name="fileData"> the fileData to process. </param>
        /// <returns> a list of objects suitable for use within a form. </returns>
        public virtual IList <StateMod_GraphNode> formLoadData(IList <StateMod_GraphNode> fileData)
        {
            int rows = fileData.Count;

            if (rows == 0)
            {
                return(new List <StateMod_GraphNode>());
            }

            // gnf will be a node used to read data FROM the _F_ile nodes
            StateMod_GraphNode gnf = fileData[0];

            string pfile = "";
            string ptype = "";
            string pyear = "";

            string file  = null;
            string type  = null;
            string dtype = null;
            string year  = null;

            // gnw will be a node used for creating the _W_orksheet nodes
            StateMod_GraphNode gnw = null;

            IList <StateMod_GraphNode> v = new List <StateMod_GraphNode>();

            int ids = 0;

            for (int i = 0; i < rows; i++)
            {
                gnf = fileData[i];
                ids = gnf.getIDVectorSize();

                file  = gnf.getFileName().Trim();
                type  = gnf.getType().Trim();
                dtype = gnf.getDtype().Trim();
                year  = gnf.getYrAve().Trim();

                for (int j = 0; j < ids; j++)
                {
                    if (j == 0)
                    {
                        gnw = new StateMod_GraphNode();
                        if (!file.Equals(pfile))
                        {
                            gnw.setFileName(file);
                        }
                        else
                        {
                            gnw.setFileName("");
                        }
                        if (!type.Equals(ptype))
                        {
                            gnw.setType(type);
                        }
                        else
                        {
                            gnw.setType("");
                        }
                        if (!dtype.Equals(dtype))
                        {
                            gnw.setDtype(dtype);
                        }
                        else
                        {
                            gnw.setDtype("");
                        }
                        if (!year.Equals(pyear))
                        {
                            gnw.setYrAve(year);
                        }
                        else
                        {
                            gnw.setYrAve("");
                        }
                        gnw.setID(gnf.getID(0).Trim());
                    }
                    else
                    {
                        gnw.setFileName("");
                        gnw.setType("");
                        gnw.setDtype("");
                        gnw.setYrAve("");
                        gnw.setID(gnf.getID(j).Trim());
                    }
                    gnw.setSwitch(gnf.getSwitch());
                    v.Add(gnw);
                }

                pfile = file;
                ptype = type;
                pyear = year;
            }

            return(v);
        }
Exemple #8
0
        /// <summary>
        /// Inserts the specified value into the table at the given position. </summary>
        /// <param name="value"> the object to store in the table cell. </param>
        /// <param name="row"> the row of the cell in which to place the object. </param>
        /// <param name="col"> the column of the cell in which to place the object. </param>
        public virtual void setValueAt(object value, int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }

            if (row >= _data.size())
            {
                // this is probably happening as a result of an edit that did not end in time.
            }

            StateMod_GraphNode gn = (StateMod_GraphNode)_data.get(row);

            //Message.printStatus(1, "", "Set value at: " + row + ", " + col + " '" + value + "'");
            switch (col)
            {
            case COL_FILE:
                string filename    = (string)value;
                string oldFilename = (string)(getValueAt(row, col));
                if (filename.Equals(oldFilename))
                {
                    return;
                }

                if (filename.Equals(StateMod_RunSmDelta_JFrame.OPTION_BROWSE, StringComparison.OrdinalIgnoreCase))
                {
                    string newfile = browseForFile();
                    gn.setFileName(newfile);
                    if (row == 0)
                    {
                        if (newfile.Trim().Equals(""))
                        {
                            setCellAttributes(row, col, true);
                        }
                        else
                        {
                            setCellAttributes(row, col, false);
                        }
                    }
                    base.setValueAt(newfile, row, col);
                    return;
                }
                else
                {
                    gn.setFileName(filename);
                }
                if (row == 0)
                {
                    if (filename.Trim().Equals(""))
                    {
                        setCellAttributes(row, col, true);
                    }
                    else
                    {
                        setCellAttributes(row, col, false);
                    }
                }
                break;

            case COL_TYPE:
                string type    = (string)value;
                string oldType = (string)(getValueAt(row, col));

                if (type.Equals(oldType))
                {
                    return;
                }

                gn.setType(type);

                if (type.Equals(""))
                {
                    if (row == 0)
                    {
                        setCellAttributes(row, col, true);
                        emptyParmIDComboBoxes(0);
                    }
                    else
                    {
                        string aboveType = getNearestType(row);
                        if (aboveType.Equals(""))
                        {
                            // error!
                            emptyParmIDComboBoxes(row);
                        }
                        else
                        {
                            setParmIDComboBoxes(row, aboveType);
                        }
                    }
                }
                else
                {
                    if (row == 0)
                    {
                        setCellAttributes(row, col, false);
                    }
                    string aboveType = getNearestType(row);
                    if (!type.Equals(aboveType))
                    {
                        setCellAttributes(row, COL_PARM, true);
                        setParmIDComboBoxes(row, type);
                    }
                    else
                    {
                        setCellAttributes(row, COL_PARM, false);
                    }
                }

                break;

            case COL_PARM:
                string dtype = ((string)value).Trim();
                // FIXME SAM 2008-03-24 No need to do this with newer StateMod
                // since binary file uses underscores for data types.
                //dtype = dtype.replace(' ', '_');
                string oldDtype = (string)(getValueAt(row, col));
                if (dtype.Equals(oldDtype))
                {
                    return;
                }
                gn.setDtype(dtype);
                if (row == 0)
                {
                    if (dtype.Trim().Equals(""))
                    {
                        setCellAttributes(row, col, true);
                    }
                    else
                    {
                        setCellAttributes(row, col, false);
                    }
                }
                else if (!dtype.Trim().Equals(""))
                {
                    setCellAttributes(row, col, false);
                }
                break;

            case COL_YEAR:
                string year    = ((string)value).Trim();
                string oldYear = (string)(getValueAt(row, col));
                if (year.Equals(oldYear))
                {
                    return;
                }
                gn.setYrAve(year);
                if (row == 0)
                {
                    if (year.Trim().Equals(""))
                    {
                        setCellAttributes(row, col, true);
                    }
                    else
                    {
                        setCellAttributes(row, col, false);
                    }
                }
                break;

            case COL_ID:
                string id    = (string)value;
                string oldID = (string)(getValueAt(row, col));
                if (id.Equals(oldID))
                {
                    return;
                }

                /*
                 * int index = id.indexOf("(");
                 * if (index > -1) {
                 *      id = id.substring(0, index);
                 * }
                 * id = id.trim();
                 */
                gn.setID(id);
                if (id.Trim().Equals(""))
                {
                    setCellAttributes(row, col, true);
                }
                else
                {
                    setCellAttributes(row, col, false);
                }
                break;
            }
            base.setValueAt(value, row, col);
        }
        /// <summary>
        /// Responds to action performed events. </summary>
        /// <param name="ae"> the ActionEvent that happened. </param>
        public virtual void actionPerformed(ActionEvent ae)
        {
            string routine = "StateMod_OutputControl_JFrame.actionPerformed";
            string action  = ae.getActionCommand();

            if (action.Equals(__BUTTON_ADD_ROW))
            {
                if (!__tableModel.canAddNewRow())
                {
                    return;
                }
                __dirty = true;
                int row = __worksheet.getRowCount();

                StateMod_GraphNode n = new StateMod_GraphNode();
                __worksheet.addRow(n);
                n.setType("");
                n.setID("");
                n.setSwitch(-1);
                __tableModel.setDirty(true);

                // when a row is added, mark the second and third columns
                // as uneditable.  They will be set to editable as soon as
                // the user enters a value in the first column
                __worksheet.setCellEditable(row, 1, false);
                __worksheet.setCellEditable(row, 2, false);
            }
            else if (action.Equals(__BUTTON_CLEAR_LIST))
            {
                __dirty = true;
                __worksheet.clear();
                setMessages("Add station to list.", "Ready");
                __tableModel.setDirty(true);
            }
            else if (action.Equals(__BUTTON_CLOSE))
            {
                closeWindow();
            }
            else if (action.Equals(__BUTTON_DELETE_ROW))
            {
                int[] rows = __worksheet.getSelectedRows();

                int length = rows.Length;
                __tableModel.setDirty(true);

                if (length == 0)
                {
                    return;
                }

                for (int i = (length - 1); i >= 0; i--)
                {
                    __worksheet.deleteRow(rows[i]);
                }
                __dirty = true;
                setMessages("Time series list has changed.", "Ready");
            }
            else if (action.Equals(__BUTTON_HELP))
            {
                // REVISIT HELP (JTS - 2003-07-09)
            }
            else if (action.Equals(__BUTTON_SAVE_FILE))
            {
                JGUIUtil.setWaitCursor(this, true);
                string lastDirectorySelected = JGUIUtil.getLastFileDialogDirectory();

                JFileChooser fc = null;
                if (!string.ReferenceEquals(lastDirectorySelected, null))
                {
                    fc = new JFileChooser(lastDirectorySelected);
                }
                else
                {
                    fc = new JFileChooser();
                }

                fc.setDialogTitle("Select Output Control File");
                SimpleFileFilter @out = new SimpleFileFilter("out", "StateMod Output Control Files");
                fc.addChoosableFileFilter(@out);
                SimpleFileFilter tpl = new SimpleFileFilter("tpo", "StateMod Output Control Files");
                fc.addChoosableFileFilter(tpl);
                SimpleFileFilter xou = new SimpleFileFilter("xou", "StateMod Output Control Files");
                fc.addChoosableFileFilter(xou);
                fc.setAcceptAllFileFilterUsed(false);
                fc.setFileFilter(tpl);
                fc.setDialogType(JFileChooser.SAVE_DIALOG);

                JGUIUtil.setWaitCursor(this, false);

                int retVal = fc.showSaveDialog(this);
                if (retVal != JFileChooser.APPROVE_OPTION)
                {
                    return;
                }

                string currDir = (fc.getCurrentDirectory()).ToString();

                if (!currDir.Equals(lastDirectorySelected, StringComparison.OrdinalIgnoreCase))
                {
                    JGUIUtil.setLastFileDialogDirectory(currDir);
                }
                string filename = fc.getSelectedFile().getName();

                FileFilter ff = fc.getFileFilter();
                if (ff == @out)
                {
                    filename = IOUtil.enforceFileExtension(filename, "out");
                }
                else if (ff == tpl)
                {
                    filename = IOUtil.enforceFileExtension(filename, "tpo");
                }
                else if (ff == xou)
                {
                    filename = IOUtil.enforceFileExtension(filename, "xou");
                }

                __dirty = false;
                __tableModel.setDirty(false);

                System.Collections.IList theGraphNodes = __worksheet.getAllData();

                try
                {
                    StateMod_GraphNode.writeStateModOutputControlFile(null, currDir + File.separator + filename, theGraphNodes, null);
                }
                catch (Exception e)
                {
                    Message.printWarning(1, routine, "Error saving output control file\n" + "\"" + currDir + File.separator + filename + "\"", this);
                    Message.printWarning(2, routine, e);
                }
            }
            else if (action.Equals(__BUTTON_LOAD_FILE))
            {
                JGUIUtil.setWaitCursor(this, true);
                string lastDirectorySelected = JGUIUtil.getLastFileDialogDirectory();

                JFileChooser fc = null;
                if (!string.ReferenceEquals(lastDirectorySelected, null))
                {
                    fc = new JFileChooser(lastDirectorySelected);
                }
                else
                {
                    fc = new JFileChooser();
                }

                fc.setDialogTitle("Select Output Control File");
                SimpleFileFilter @out = new SimpleFileFilter("out", "StateMod Output Control Files");
                fc.addChoosableFileFilter(@out);
                SimpleFileFilter tpl = new SimpleFileFilter("tpo", "StateMod Output Control Files");
                fc.addChoosableFileFilter(tpl);
                SimpleFileFilter xou = new SimpleFileFilter("xou", "StateMod Output Control Files");
                fc.addChoosableFileFilter(xou);
                fc.setAcceptAllFileFilterUsed(false);
                fc.setFileFilter(tpl);
                fc.setDialogType(JFileChooser.OPEN_DIALOG);

                JGUIUtil.setWaitCursor(this, false);
                int retVal = fc.showOpenDialog(this);
                if (retVal != JFileChooser.APPROVE_OPTION)
                {
                    return;
                }

                string currDir = (fc.getCurrentDirectory()).ToString();

                if (!currDir.Equals(lastDirectorySelected, StringComparison.OrdinalIgnoreCase))
                {
                    JGUIUtil.setLastFileDialogDirectory(currDir);
                }
                string filename = fc.getSelectedFile().getName();

                JGUIUtil.setWaitCursor(this, true);

                __dirty = false;

                System.Collections.IList theGraphNodes = new List <object>(20, 1);

                try
                {
                    __worksheet.clear();
                    __tableModel.setDirty(false);
                    StateMod_GraphNode.readStateModOutputControlFile(theGraphNodes, currDir + File.separator + filename);

                    int size             = theGraphNodes.Count;
                    StateMod_GraphNode g = null;
                    int row = 0;
                    for (int i = 0; i < size; i++)
                    {
                        row = __worksheet.getRowCount();
                        g   = (StateMod_GraphNode)theGraphNodes[i];
                        if (i == 0)
                        {
                            if (g.getID().Equals("All"))
                            {
                                __useAllJCheckBox.setSelected(true);
                            }
                            else
                            {
                                __useAllJCheckBox.setSelected(false);
                            }
                        }
                        __worksheet.addRow(g);

                        __tableModel.fillIDColumn(row, g.getType());
                    }
                    __worksheet.setData(theGraphNodes);
                }
                catch (Exception e)
                {
                    Message.printWarning(1, routine, "Error loading output control file\n" + "\"" + currDir + File.separator + filename + "\"", this);
                    Message.printWarning(2, routine, e);
                }
                JGUIUtil.setWaitCursor(this, false);
            }
            else if (action.Equals(__CHECKBOX_USE_ALL))
            {
                // if the use all checkbox is selected, subtle changes from the
                // default functionality are made.  The buttons to add and
                // delete rows are disabled, and the ID of the only record
                // in the worksheet is set to "All".  This ID value is used
                // in the table model to determine when the checkbox is
                // selected.  In addition, the ComboBox functionality of the
                // first and third data columns is turned off.

                if (__useAllJCheckBox.isSelected())
                {
                    __addRowButton.setEnabled(false);
                    __deleteRowButton.setEnabled(false);
                    __worksheet.setColumnJComboBoxValues(0, null);
                    __worksheet.setColumnJComboBoxValues(2, null);
                    __worksheet.clear();
                    StateMod_GraphNode g = new StateMod_GraphNode();
                    g.setID("All");
                    __worksheet.setCellEditable(0, 0, false);
                    __worksheet.setCellEditable(0, 1, false);
                    __worksheet.setCellEditable(0, 2, false);
                    __worksheet.addRow(g);
                }
                else
                {
                    __addRowButton.setEnabled(true);
                    __deleteRowButton.setEnabled(true);
                    System.Collections.IList v = StateMod_Util.arrayToList(StateMod_GraphNode.node_types);
                    v.Add("Other");
                    __worksheet.setColumnJComboBoxValues(0, v);
                    __worksheet.clear();
                    System.Collections.IList offOn = new List <object>();
                    offOn.Add("Off");
                    offOn.Add("On");
                    __worksheet.setCellEditable(0, 0, true);
                    __worksheet.setColumnJComboBoxValues(2, offOn);
                }
            }
        }