Beispiel #1
0
	/// <summary>
	/// Constructor. </summary>
	/// <param name="delay"> the Delay to show </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 gui data is editable or not </param>
	public StateMod_DelayTable_JFrame(StateMod_DelayTable delay, 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 Table" + interval, null);
		__delaysVector = new List<StateMod_DelayTable>();
		__delaysVector.Add(delay);

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

		__editable = editable;

		setupGUI(0);
	}
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset containing the data to show in the form. </param>
        /// <param name="editable"> whether the data on the gui can be edited or not. </param>
        public StateMod_RiverNetworkNode_JFrame(StateMod_DataSet dataset, StateMod_RiverNetworkNode node, bool editable) : base("")
        {
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            StateMod_GUIUtil.setTitle(this, dataset, "River Network Nodes", null);

            __dataset = dataset;
            __riverNetworkNodeComponent = __dataset.getComponentForComponentType(StateMod_DataSet.COMP_RIVER_NETWORK);
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_RiverNetworkNode> riverNetworkNodesList = (java.util.List<StateMod_RiverNetworkNode>)__riverNetworkNodeComponent.getData();
            IList <StateMod_RiverNetworkNode> riverNetworkNodesList = (IList <StateMod_RiverNetworkNode>)__riverNetworkNodeComponent.getData();

            __riverNetworkNodesVector = riverNetworkNodesList;

            int size = __riverNetworkNodesVector.Count;
            StateMod_RiverNetworkNode r = null;

            for (int i = 0; i < size; i++)
            {
                r = (StateMod_RiverNetworkNode)__riverNetworkNodesVector[i];
                r.createBackup();
            }

            string id    = node.getID();
            int    index = StateMod_Util.locateIndexFromID(id, __riverNetworkNodesVector);

            __editable = editable;

            setupGUI(index);
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset that contains the data. </param>
        /// <param name="dataset_wm"> the dataset window manager or null if the data set windows
        /// are not being managed. </param>
        public StateMod_RunReport_JFrame(StateMod_DataSet dataset, StateMod_DataSet_WindowManager dataset_wm)
        {
            StateMod_GUIUtil.setTitle(this, dataset, "Run StateMod Report", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __dataset    = dataset;
            __dataset_wm = dataset_wm;

            setupGUI();
        }
        // TODO SAM 2010-12-18 Needs an editable parameter like for other data files
        /// <summary>
        /// Constructor for output control </summary>
        /// <param name="dataset"> the dataset containing the data </param>
        public StateMod_OutputControl_JFrame(StateMod_DataSet dataset)
        {
            StateMod_GUIUtil.setTitle(this, dataset, "Output Control", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __dataset = dataset;

            __riverNetworkComp = __dataset.getComponentForComponentType(StateMod_DataSet.COMP_RIVER_NETWORK);
            setupGUI();
        }
        private IList <StateMod_Diversion> __matches_Vector        = null; // The list of matching data.

        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the Control data with which to populate
        /// this form is found. </param>
        /// <param name="dataset_wm"> the dataset window manager or null if the data set windows
        /// are not being managed. </param>
        /// <param name="editable"> If true, the data in the window are editable. </param>
        public StateMod_QueryTool_JFrame(StateMod_DataSet dataset, StateMod_DataSet_WindowManager dataset_wm)
        {
            StateMod_GUIUtil.setTitle(this, dataset, "Query Tool", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());

            __dataset    = dataset;
            __dataset_wm = dataset_wm;

            setupGUI();
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="well"> the well for which to shown depletion data. </param>
        /// <param name="editable"> whether the gui data is editable or not </param>
        public StateMod_Well_Depletion_JFrame(StateMod_DataSet dataset, StateMod_Well well, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, well.getName() + " - Well Depletion Information", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentWell = well;

            __dataset = dataset;

            __editable = editable;

            setupGUI();
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="res"> the reservoir for which to display data </param>
        /// <param name="editable"> whether the gui data is editable or not. </param>
        public StateMod_Reservoir_Owner_JFrame(StateMod_DataSet dataset, StateMod_Reservoir res, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, res.getName() + " - Reservoir Owner Accounts", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentRes = res;

            __dataset = dataset;

            __editable = editable;

            setupGUI();
        }
Beispiel #8
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="res"> the reservoir object to display in the frame. </param>
        /// <param name="editable"> whether the gui data is editable or not </param>
        public StateMod_Reservoir_AreaCap_JFrame(StateMod_DataSet dataset, StateMod_Reservoir res, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, res.getName() + " - Reservoir Content/Area/Seepage", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentRes = res;

            __dataset = dataset;

            __editable = editable;

            setupGUI();
        }
Beispiel #9
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data are contained. </param>
        /// <param name="div"> the diversion to display. </param>
        /// <param name="editable"> whether the form data can be edited or not </param>
        public StateMod_Diversion_Right_JFrame(StateMod_DataSet dataset, StateMod_Diversion div, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, div.getName() + " - Diversion Water Rights", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentDiv = div;

            __dataset = dataset;

            __editable = editable;

            setupGUI();
        }
Beispiel #10
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset that is being worked with. </param>
        /// <param name="dataset_wm"> the dataset's window manager </param>
        public StateMod_Response_JFrame(StateMod_DataSet dataset, StateMod_DataSet_WindowManager dataset_wm)
        {
            StateMod_GUIUtil.setTitle(this, dataset, "Response File Contents", null);

            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());

            __dataset      = dataset;
            __dataset_copy = new StateMod_DataSet(dataset, false);
            __dataset_wm   = dataset_wm;

            setupGUI();
        }
Beispiel #11
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="insf"> the InstreamFlow right to display. </param>
        /// <param name="editable"> whether the gui data is editable or not </param>
        public StateMod_InstreamFlow_Right_JFrame(StateMod_DataSet dataset, StateMod_InstreamFlow insf, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, insf.getName() + " - Instream Flow Water Rights", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentInstreamFlow = insf;

            __dataset = dataset;

            __editable = editable;

            setupGUI();
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="plan"> the plan for which to display return information. </param>
        /// <param name="editable"> whether the gui data is editable or not. </param>
        public StateMod_Plan_Return_JFrame(StateMod_DataSet dataset, StateMod_Plan plan, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, plan.getName() + " - Plan Return Flow Table Assignment", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentPlan = plan;
            IList <StateMod_ReturnFlow> allReturns = (IList <StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_PLAN_RETURN).getData();

            __currentPlanReturnList = (IList <StateMod_ReturnFlow>)StateMod_Util.getDataList(allReturns, plan.getID());
            Message.printStatus(2, "", "Have " + __currentPlanReturnList.Count + " return records for plan \"" + __currentPlan.getID() + "\" uniquetempvar.");
            __dataset = dataset;
            // TODO SAM 2011-01-02 For now editing is disabled...
            editable   = false;
            __editable = editable;
            setupGUI();
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset in which the data is contained. </param>
        /// <param name="res"> the Reservoir for which to display return information. </param>
        /// <param name="editable"> whether the gui data is editable or not. </param>
        public StateMod_Reservoir_Return_JFrame(StateMod_DataSet dataset, StateMod_Reservoir res, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, res.getName() + " - Reservoir Return Flow Table Assignment", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __currentRes = res;
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @SuppressWarnings("unchecked") java.util.List<StateMod_ReturnFlow> allReturns = (java.util.List<StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_RETURN).getData();
            IList <StateMod_ReturnFlow> allReturns = (IList <StateMod_ReturnFlow>)dataset.getComponentForComponentType(StateMod_DataSet.COMP_RESERVOIR_RETURN).getData();

            __currentResReturnList = (IList <StateMod_ReturnFlow>)StateMod_Util.getDataList(allReturns, res.getID());
            Message.printStatus(2, "", "Have " + __currentResReturnList.Count + " return records for reservoir \"" + __currentRes.getID() + "\" uniquetempvar.");
            //__dataset = dataset;
            // TODO SAM 2011-01-02 For now editing is disabled...
            editable   = false;
            __editable = editable;
            setupGUI();
        }
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset containing the data. </param>
        public StateMod_OutputFiles_JFrame(StateMod_DataSet dataset)
        {
            StateMod_GUIUtil.setTitle(this, dataset, "View/Edit Ouput Files", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());
            __dataset = dataset;

            __path      = __dataset.getComponentDataFilePath(StateMod_DataSet.COMP_RESPONSE);
            __basinName = __dataset.getBaseName();

            int index = __path.LastIndexOf(File.separator);

            if (index > -1)
            {
                __path = __path.Substring(0, index + 1);
            }

            setupGUI();
        }
Beispiel #15
0
        /// <summary>
        /// Display a graph of reservoir content versus area or content versus seepage. </summary>
        /// <param name="dataset"> The dataset including the reservoir. </param>
        /// <param name="res"> StateMod_Reservoir with data to graph. </param>
        /// <param name="type"> "Area" or "Seepage", indicating the data to graph. </param>
        /// <param name="editable"> Indicate whether the data are editable or not (currently
        /// ignored and treated as not editable through the graph). </param>
        public StateMod_Reservoir_AreaCap_Graph_JFrame(StateMod_DataSet dataset, StateMod_Reservoir res, string type, bool editable)
        {
            StateMod_GUIUtil.setTitle(this, dataset, res.getName() + " - Reservoir Content/" + type + " Curve", null);
            JGUIUtil.setIcon(this, JGUIUtil.getIconImage());

            __res  = res;
            __type = type;

            DefaultTableXYDataset graph_dataset = createDataset();
            JFreeChart            chart         = createChart(graph_dataset);
            ChartPanel            chartPanel    = new ChartPanel(chart);

            chartPanel.setPreferredSize(new Dimension(500, 500));
            getContentPane().add("Center", chartPanel);
            pack();
            JGUIUtil.center(this);
            setVisible(true);
        }
 /// <summary>
 /// Edits the selected file.
 /// </summary>
 private void editSelectedFile()
 {
     if (__fileJList.getSelectedIndex() >= 2)
     {
         StringTokenizer split = new StringTokenizer((string)__fileJList.getSelectedValue());
         if (split != null)
         {
             string filename = __path + split.nextToken();
             try
             {
                 StateMod_GUIUtil.editFile(filename);
             }
             catch (Exception)
             {
                 Message.printWarning(1, "StateMod_OutputFiles_JFrame." + "editSelectedFile", "Unable to view/edit file \"" + filename + "\"");
             }
         }
     }
 }
Beispiel #17
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>
        /// Display the results of the query.
        /// </summary>
        private void displayQueryResults()
        {
            string routine = "StateMod_QueryTool_JFrame.displayQueryResults";
            // For now only diversion stations are supported...
            InputFilter_JPanel ifp = __input_filter_diversion_JPanel;

            if (ifp is StateMod_Diversion_InputFilter_JPanel)
            {
                try
                {
                    StateMod_Diversion_TableModel   tm = new StateMod_Diversion_TableModel(__matches_Vector, false);
                    StateMod_Diversion_CellRenderer cr = new StateMod_Diversion_CellRenderer(tm);
                    TableModel_JFrame f = new TableModel_JFrame(tm, cr, (PropList)null, (PropList)null);
                    StateMod_GUIUtil.setTitle(f, __dataset, "Diversion Station Query Results", null);
                }
                catch (Exception e)
                {
                    Message.printWarning(1, routine, "Error displaying results.", this);
                    Message.printWarning(2, routine, e);
                }
            }
        }