예제 #1
0
	/// <summary>
	/// Constructor. </summary>
	/// <param name="delaysVector"> the list of delays to show </param>
	/// <param name="delayTable"> the delay table to display. </param>
	/// <param name="monthly_data"> If true, display the monthly delay tables.  If false,
	/// display the daily delay tables. </param>
	/// <param name="editable"> whether the data is editable or not </param>
	public StateMod_DelayTable_JFrame(IList<StateMod_DelayTable> delaysVector, StateMod_DelayTable delayTable, bool monthly_data, bool editable)
	{
		__monthly_data = monthly_data;
		JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
		string interval = " (Monthly)";
		if (__monthly_data)
		{
			__window_type = StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY;
			__componentType = StateMod_DataSet.COMP_DELAY_TABLES_MONTHLY;
		}
		else
		{
			__window_type = StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY;
			__componentType = StateMod_DataSet.COMP_DELAY_TABLES_DAILY;
			interval = " (Daily)";
		}
		StateMod_GUIUtil.setTitle(this, null, "Delay Tables" + interval, null);

		__delaysVector = delaysVector;

		int size = __delaysVector.Count;
		StateMod_DelayTable dt = null;
		for (int i = 0; i < size; i++)
		{
			dt = __delaysVector[i];
			dt.createBackup();
		}

		string id = delayTable.getID();
		int index = StateMod_Util.IndexOf(__delaysVector, id);

		__editable = editable;
		setupGUI(index);
	}
예제 #2
0
	/// <summary>
	/// Selects the desired ID in the table and displays the appropriate data
	/// in the remainder of the window. </summary>
	/// <param name="id"> the identifier to select in the list. </param>
	public virtual void selectID(string id)
	{
		int rows = __worksheetL.getRowCount();
		StateMod_DelayTable dt = null;
		for (int i = 0; i < rows; i++)
		{
			dt = (StateMod_DelayTable)__worksheetL.getRowData(i);
			if (dt.getID().Trim().Equals(id.Trim()))
			{
				selectLeftTableIndex(i, true, true);
				return;
			}
		}
	}
예제 #3
0
        /// <summary>
        /// Sets up the data to be displayed in the table. </summary>
        /// <param name="data"> a Vector of StateMod_DelayTable objects from which the data to b
        /// be displayed in the table will be gathered. </param>
        private void setupData(System.Collections.IList data)
        {
            int num  = 0;
            int size = data.Count;
            StateMod_DelayTable dt = null;
            string id = null;

            __data = new System.Collections.IList[__COLUMNS];
            for (int i = 0; i < __COLUMNS; i++)
            {
                __data[i] = new List <object>();
            }

            __rowMap = new List <object>();

            double total    = 0;
            int    rowCount = 0;

            for (int i = 0; i < size; i++)
            {
                total = 0;
                dt    = (StateMod_DelayTable)data[i];
                id    = dt.getID();
                num   = dt.getNdly();
                for (int j = 0; j < num; j++)
                {
                    __data[COL_ID].Add(id);
                    __data[COL_DATE].Add(new int?(j + 1));
                    __data[COL_RETURN_AMT].Add(new double?(dt.getRet_val(j)));
                    total += dt.getRet_val(j);
                    __rowMap.Add(new int?(rowCount));
                    rowCount++;
                }

                __data[COL_ID].Add("TOTAL " + id);
                __data[COL_DATE].Add(new int?(-999));
                __data[COL_RETURN_AMT].Add(new double?(total));

                rowCount++;
            }
            _rows = rowCount;
        }
예제 #4
0
	/// <summary>
	/// Constructor. </summary>
	/// <param name="dataset"> the dataset containing the data to display </param>
	/// <param name="dataset_wm"> the dataset window manager or null if the data set windows
	/// are not being managed. </param>
	/// <param name="delayTable"> the delay table to display. </param>
	/// <param name="monthly_data"> If true, display the monthly delay tables.  If false,
	/// display the daily delay tables. </param>
	/// <param name="editable"> whether the data is editable or not </param>
	public StateMod_DelayTable_JFrame(StateMod_DataSet dataset, StateMod_DataSet_WindowManager dataset_wm, StateMod_DelayTable delayTable, bool monthly_data, bool editable)
	{
		__dataset = dataset;
		__dataset_wm = dataset_wm;
		__monthly_data = monthly_data;
		JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
		string interval = " (Monthly)";
		if (__monthly_data)
		{
			__window_type = StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY;
			__delayComponent = __dataset.getComponentForComponentType(StateMod_DataSet.COMP_DELAY_TABLES_MONTHLY);
			__componentType = StateMod_DataSet.COMP_DELAY_TABLES_MONTHLY;
		}
		else
		{
			__window_type = StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY;
			__delayComponent = __dataset.getComponentForComponentType(StateMod_DataSet.COMP_DELAY_TABLES_DAILY);
			__componentType = StateMod_DataSet.COMP_DELAY_TABLES_DAILY;
			interval = " (Daily)";
		}
		StateMod_GUIUtil.setTitle(this, dataset, "Delay Tables" + interval, null);

//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_DelayTable> delaysList = (java.util.List<StateMod_DelayTable>)__delayComponent.getData();
		IList<StateMod_DelayTable> delaysList = (IList<StateMod_DelayTable>)__delayComponent.getData();
		__delaysVector = delaysList;

		int size = __delaysVector.Count;
		StateMod_DelayTable dt = null;
		for (int i = 0; i < size; i++)
		{
			dt = __delaysVector[i];
			dt.createBackup();
		}

		string id = delayTable.getID();
		int index = StateMod_Util.IndexOf(__delaysVector, id);

		__editable = editable;
		setupGUI(index);
	}
        /// <summary>
        /// Responds to action performed events sent by popup menus of the tree nodes. </summary>
        /// <param name="event"> the ActionEvent that happened. </param>
        public virtual void actionPerformed(ActionEvent @event)
        {
            string action  = @event.getActionCommand();
            string routine = "StateMod_DataSet_JTree.actionPerformed";

            object data = __popup_Node.getData();

            if (data is DataSetComponent)
            {
                DataSetComponent comp = (DataSetComponent)data;
                int comp_type         = comp.getComponentType();
                if (comp_type == StateMod_DataSet.COMP_CONTROL_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_CONTROL, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_STREAMGAGE_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DELAY_TABLE_MONTHLY_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DELAY_TABLE_DAILY_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_DIVERSION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_PRECIPITATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PRECIPITATION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_EVAPORATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_EVAPORATION, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_RESERVOIR_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_INSTREAM_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_WELL_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_WELL, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_PLAN_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_STREAMESTIMATE_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_RIVER_NETWORK_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK, __editable);
                }
                else if (comp_type == StateMod_DataSet.COMP_OPERATION_GROUP)
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT, __editable);
                }
            }
            // Below here are specific instances of objects.  Similar to above,
            // display the main window but then also select the specific object...
            else if (data is StateMod_StreamGage)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE, __editable);
                ((StateMod_StreamGage_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMGAGE)).selectID(((StateMod_StreamGage)data).getID());
            }
            else if (data is StateMod_DelayTable)
            {
                StateMod_DelayTable dt = (StateMod_DelayTable)data;
                if (dt.isMonthly())
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY, __editable);
                    ((StateMod_DelayTable_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_MONTHLY)).selectID(dt.getID());
                }
                else
                {
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY, __editable);
                    ((StateMod_DelayTable_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DELAY_TABLE_DAILY)).selectID(dt.getID());
                }
            }
            else if (data is StateMod_Diversion)
            {
                if (action.IndexOf(__SUMMARIZE_HOW1, StringComparison.Ordinal) >= 0)
                {
                    PropList props = new PropList("Diversion");
                    props.set("Title=" + ((StateMod_Diversion)data).getID() + " Diversion use in Data Set");
                    new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_DIVERSION_STATIONS, ((StateMod_Diversion)data).getID()), props);
                }
                else
                {
                    // Assume properties...
                    __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION, __editable);
                    ((StateMod_Diversion_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_DIVERSION)).selectID(((StateMod_Diversion)data).getID());
                }
            }
            else if (data is TS)
            {
                // Might be precipitation or evaporation.  Check the data type to determine...
                TS       ts    = (TS)data;
                PropList props = new PropList("Precipitation/Evaporation");
                if (action.IndexOf(__SUMMARIZE_HOW1, StringComparison.Ordinal) >= 0)
                {
                    if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "e"))
                    {
                        props.set("Title=" + ts.getLocation() + " Evaporation TS use in Data Set");
                        new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_EVAPORATION_TS_MONTHLY, ts.getLocation()), props);
                    }
                    else if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "p"))
                    {
                        props.set("Title=" + ts.getLocation() + " Precipitation TS use in Data Set");
                        new ReportJFrame(__dataset.getDataObjectDetails(StateMod_DataSet.COMP_PRECIPITATION_TS_MONTHLY, ts.getLocation()), props);
                    }
                }
                else if (action.IndexOf(__PROPERTIES, StringComparison.Ordinal) >= 0)
                {
                    if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "e"))
                    {
                        props.set("Title=Evaporation");
                    }
                    else if (StringUtil.startsWithIgnoreCase(ts.getDataType(), "p"))
                    {
                        props.set("Title=Precipitation");
                    }
                    props.set("InitialView=Graph");
                    props.set("GraphType=Bar");
                    System.Collections.IList tslist = new List <object>(1);
                    tslist.Add(ts);
                    try
                    {
                        new TSViewJFrame(tslist, props);
                    }
                    catch (Exception)
                    {
                        Message.printWarning(1, routine, "Error displaying data.");
                    }
                }
            }
            else if (data is StateMod_Reservoir)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR, __editable);
                ((StateMod_Reservoir_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_RESERVOIR)).selectID(((StateMod_Reservoir)data).getID());
            }
            else if (data is StateMod_InstreamFlow)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM, __editable);
                ((StateMod_InstreamFlow_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_INSTREAM)).selectID(((StateMod_InstreamFlow)data).getID());
            }
            else if (data is StateMod_Well)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_WELL, __editable);
                ((StateMod_Well_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_WELL)).selectID(((StateMod_Well)data).getID());
            }
            else if (data is StateMod_Plan)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN, __editable);
                ((StateMod_Plan_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_PLAN)).selectID(((StateMod_Plan)data).getID());
            }
            else if (data is StateMod_StreamEstimate)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE, __editable);
                ((StateMod_StreamEstimate_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_STREAMESTIMATE)).selectID(((StateMod_StreamEstimate)data).getID());
            }
            else if (data is StateMod_RiverNetworkNode)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK, __editable);
                ((StateMod_RiverNetworkNode_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_RIVER_NETWORK)).selectID(((StateMod_RiverNetworkNode)data).getID());
            }
            else if (data is StateMod_OperationalRight)
            {
                __dataset_wm.displayWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT, __editable);
                ((StateMod_OperationalRight_JFrame)__dataset_wm.getWindow(StateMod_DataSet_WindowManager.WINDOW_OPERATIONAL_RIGHT)).selectID(((StateMod_OperationalRight)data).getID());
            }
        }
예제 #6
0
        /// <summary>
        /// Writes a list of StateMod_DelayTable objects to a list file.  A header is
        /// printed to the top of the file, containing the commands used to generate the
        /// file.  Any strings in the body of the file that contain the field delimiter will be wrapped in "...". </summary>
        /// <param name="filename"> the name of the file to which the data will be written. </param>
        /// <param name="delimiter"> the delimiter to use for separating field values. </param>
        /// <param name="update"> whether to update an existing file, retaining the current
        /// header (true) or to create a new file with a new header. </param>
        /// <param name="data"> the list of objects to write. </param>
        /// <param name="newComments"> the list of new comments to write to the header, or null if none. </param>
        /// <param name="comp"> the component type being written (to distinguish between daily and monthly delay tables),
        /// either StateMod_DataSet.COMP_DELAY_TABLES_DAILY or StateMod_DataSet.COMP_DELAY_TABLES_MONTHLY. </param>
        /// <exception cref="Exception"> if an error occurs. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public static void writeListFile(String filename, String delimiter, boolean update, java.util.List<StateMod_DelayTable> data, java.util.List<String> newComments, int comp) throws Exception
        public static void writeListFile(string filename, string delimiter, bool update, IList <StateMod_DelayTable> data, IList <string> newComments, int comp)
        {
            int size = 0;

            if (data != null)
            {
                size = data.Count;
            }

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

            fields.Add("DelayTableID");
            fields.Add("Date");
            fields.Add("ReturnAmount");

            int fieldCount = fields.Count;

            string[] names   = new string[fieldCount];
            string[] formats = new string[fieldCount];
            string   s       = null;

            for (int i = 0; i < fieldCount; i++)
            {
                s          = (string)fields[i];
                names[i]   = StateMod_Util.lookupPropValue(comp, "FieldName", s);
                formats[i] = StateMod_Util.lookupPropValue(comp, "Format", s);
            }

            string oldFile = null;

            if (update)
            {
                oldFile = IOUtil.getPathUsingWorkingDir(filename);
            }

            int                 j                 = 0;
            int                 k                 = 0;
            int                 num               = 0;
            PrintWriter         @out              = null;
            StateMod_DelayTable delay             = null;
            IList <string>      commentIndicators = new List <string>(1);

            commentIndicators.Add("#");
            IList <string> ignoredCommentIndicators = new List <string>(1);

            ignoredCommentIndicators.Add("#>");
            string[]      line   = new string[fieldCount];
            string        id     = null;
            StringBuilder buffer = new StringBuilder();

            try
            {
                // Add some basic comments at the top of the file.  Do this to a copy of the
                // incoming comments so that they are not modified in the calling code.
                IList <string> newComments2 = null;
                if (newComments == null)
                {
                    newComments2 = new List <string>();
                }
                else
                {
                    newComments2 = new List <string>(newComments);
                }
                newComments2.Insert(0, "");
                if (comp == StateMod_DataSet.COMP_DELAY_TABLES_DAILY)
                {
                    newComments2.Insert(1, "StateMod delay tables (daily) as a delimited list file.");
                }
                else
                {
                    newComments2.Insert(1, "StateMod delay tables (monthly) as a delimited list file.");
                }
                newComments2.Insert(2, "");
                @out = IOUtil.processFileHeaders(IOUtil.getPathUsingWorkingDir(oldFile), IOUtil.getPathUsingWorkingDir(filename), newComments2, commentIndicators, ignoredCommentIndicators, 0);

                for (int i = 0; i < fieldCount; i++)
                {
                    buffer.Append("\"" + names[i] + "\"");
                    if (i < (fieldCount - 1))
                    {
                        buffer.Append(delimiter);
                    }
                }

                @out.println(buffer.ToString());

                for (int i = 0; i < size; i++)
                {
                    delay = (StateMod_DelayTable)data[i];

                    id  = delay.getID();
                    num = delay.getNdly();
                    for (j = 0; j < num; j++)
                    {
                        line[0] = StringUtil.formatString(id, formats[0]).Trim();
                        line[1] = StringUtil.formatString((j + 1), formats[1]).Trim();
                        line[2] = StringUtil.formatString(delay.getRet_val(j), formats[2]).Trim();

                        buffer = new StringBuilder();
                        for (k = 0; k < fieldCount; k++)
                        {
                            if (k > 0)
                            {
                                buffer.Append(delimiter);
                            }
                            if (line[k].IndexOf(delimiter, StringComparison.Ordinal) > -1)
                            {
                                line[k] = "\"" + line[k] + "\"";
                            }
                            buffer.Append(line[k]);
                        }

                        @out.println(buffer.ToString());
                    }
                }
                @out.flush();
                @out.close();
                @out = null;
            }
            catch (Exception e)
            {
                // TODO SAM 2009-01-11 Log it?
                throw e;
            }
            finally
            {
                if (@out != null)
                {
                    @out.flush();
                    @out.close();
                }
            }
        }
예제 #7
0
	/// <summary>
	/// Responds to action performed events. </summary>
	/// <param name="e"> the ActionEvent that happened. </param>
	public virtual void actionPerformed(ActionEvent e)
	{
		string routine = "StateMod_DelayTable_JFrame"
			+ ".actionPerformed";
		if (Message.isDebugOn)
		{
			Message.printDebug(1, routine, "In actionPerformed: " + e.getActionCommand());
		}

		string action = e.getActionCommand();

		if (action.Equals(__BUTTON_HELP))
		{
			// REVISIT HELP (JTS - 2003-06-09)
		}
		else if (action.Equals(__BUTTON_CLOSE))
		{
			closeWindow();
		}
		else if (action.Equals(__BUTTON_APPLY))
		{
			saveDelayTable();
			int size = __delaysVector.Count;
			StateMod_DelayTable dt = null;
			bool changed = false;
			for (int i = 0; i < size; i++)
			{
				dt = (StateMod_DelayTable)__delaysVector[i];
				if (!changed && dt.changed())
				{
					changed = true;
				}
				dt.createBackup();
			}
			if (changed)
			{
				__dataset.setDirty(__componentType, true);
			}
		}
		else if (action.Equals(__BUTTON_CANCEL))
		{
			__worksheetR.deselectAll();
			int size = __delaysVector.Count;
			StateMod_DelayTable dt = null;
			bool changed = false;
			for (int i = 0; i < size; i++)
			{
				dt = (StateMod_DelayTable)__delaysVector[i];
				if (!changed && dt.changed())
				{
					changed = true;
				}
				dt.restoreOriginal();
			}
			if (__dataset_wm != null)
			{
				__dataset_wm.closeWindow(__window_type);
			}
			else
			{
				JGUIUtil.close(this);
			}
		}
		else if (action.Equals(__BUTTON_ADD_RETURN))
		{
			int row = __worksheetR.getSelectedRow();

			int total_num_rows = __worksheetR.getRowCount() - 1;

			if (row == -1)
			{
				row = total_num_rows;
			}

			if (row != -1)
			{
				if (row == total_num_rows)
				{
					int x = new ResponseJDialog(this, "Insert row", "Do you wish to add a new row above " + "the last row?\n" + "uniquetempvar.response();
					if (x == ResponseJDialog.CANCEL)
					{
						return;
					}
					else if (x == ResponseJDialog.NO)
					{
						row += 1;
					}
				}
				__worksheetR.insertRowAt(new double?(0), row);
				__worksheetR.scrollToRow(row);
				__worksheetR.selectRow(row);
			}
			else
			{
				__worksheetR.addRow(new double?(0));
				__worksheetR.scrollToRow(0);
				__worksheetR.selectRow(0);
			}
			__deleteReturn.setEnabled(true);
		}
		else if (action.Equals(__BUTTON_DELETE_RETURN))
		{
			int row = __worksheetR.getSelectedRow();
			if (row != -1)
			{
				int x = (new ResponseJDialog(this, "Delete Return", "Delete return?", ResponseJDialog.YES | ResponseJDialog.NO)).response();
				if (x == ResponseJDialog.NO)
				{
					return;
				}
				//StateMod_DelayTable dt = (StateMod_DelayTable)
					//__worksheetL.getRowData(
					//__worksheetL.getSelectedRow());
				__worksheetR.deleteRow(row);
				__deleteReturn.setEnabled(false);
			}
			else
			{
				Message.printWarning(1, routine, "Must select desired right to delete.");
			}
		}
		else if (e.getSource() == __findNextDelay)
		{
			searchLeftWorksheet(__worksheetL.getSelectedRow() + 1);
		}
		else if (e.getSource() == __searchID)
		{
			searchLeftWorksheet();
		}
		else
		{
			if (__worksheetL.getSelectedRow() == -1)
			{
				new ResponseJDialog(this, "You must first select a delay from the list.", ResponseJDialog.OK);
				return;
			}
			else if (e.getSource() == __graphDelayJButton)
			{
				try
				{
					__worksheetR.deselectAll();

					int index = __worksheetL.getSelectedRow();
					if (index == -1)
					{
						return;
					}

					StateMod_DelayTable currentDelay = ((StateMod_DelayTable) __delaysVector[index]);

					int j;

					DateTime date;

					TSIdent tsident = new TSIdent();
					tsident.setLocation(currentDelay.getID());
					tsident.setSource("StateMod");
					if (__monthly_data)
					{
						tsident.setInterval("Month");
					}
					else
					{
						tsident.setInterval("Day");
					}
					tsident.setType("Delay");

					DateTime date1 = null;
					DateTime date2 = null;
					int interval_base;
					if (__monthly_data)
					{
						date1 = new DateTime(DateTime.PRECISION_MONTH);
						date2 = new DateTime(DateTime.PRECISION_MONTH);
						interval_base = TimeInterval.MONTH;
					}
					else
					{
						date1 = new DateTime(DateTime.PRECISION_DAY);
						date2 = new DateTime(DateTime.PRECISION_DAY);
						interval_base = TimeInterval.DAY;
					}
					date1.setMonth(1);
					date1.setYear(1);
					date2.setMonth(1);
					date2.setYear(1);
					date2.addInterval(interval_base, (currentDelay.getNdly() - 1));

					TS ts = null;
					if (__monthly_data)
					{
						ts = new MonthTS();
					}
					else
					{
						ts = new DayTS();
					}
					ts.setDate1(date1);
					ts.setDate2(date2);
					ts.setIdentifier(tsident);
					if (__monthly_data)
					{
						ts.setDescription(ts.getLocation() + " Monthly Delay Table");
					}
					else
					{
						ts.setDescription(ts.getLocation() + " Daily Delay Table");
					}
					ts.setDataType("Delay");
					ts.setDataUnits(currentDelay.getUnits());
					ts.allocateDataSpace();

					double max = 0.0;
					for (date = new DateTime(date1), j = 0; date.lessThanOrEqualTo(date2); date.addInterval(interval_base, 1), j++)
					{
						ts.setDataValue(date, currentDelay.getRet_val(j));
						if (currentDelay.getRet_val(j) > max)
						{
							max = currentDelay.getRet_val(j);
						}
					}
					IList<TS> tslist = new List<TS>();
					tslist.Add(ts);

					PropList graphProps = new PropList("TSView");
					// If dealing with small values, use a high
					// of precision...
					if (max < 1.0)
					{
						graphProps.set("YAxisPrecision","6");
						graphProps.set("OutputPrecision","6");
					}
					else
					{
						graphProps.set("YAxisPrecision","3");
						graphProps.set("OutputPrecision","3");
					}
					graphProps.set("InitialView", "Graph");
					graphProps.set("TotalWidth", "600");
					graphProps.set("TotalHeight", "400");
					if (__monthly_data)
					{
						graphProps.set("Title", ts.getLocation() + " Monthly Delay Table");
					}
					else
					{
						graphProps.set("Title", ts.getLocation() + " Daily Delay Table");
					}
					graphProps.set("DisplayFont", "Courier");
					graphProps.set("DisplaySize", "11");
					graphProps.set("PrintFont", "Courier");
					graphProps.set("PrintSize", "7");
					graphProps.set("PageLength", "100");
					new TSViewJFrame(tslist, graphProps);
				}
				catch (Exception)
				{
					Message.printWarning(1, routine, "Unable to graph delay. ");
				}
			}
		}
	}