/// <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="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); }
// 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(); }
/// <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(); }
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="parent"> the parent GUI that instantiated this GUI. </param> /// <param name="node"> the node for which to edit properties. </param> /// <param name="nodeNum"> the number of the node in the parent GUI. </param> public StateMod_Network_AnnotationProperties_JDialog(StateMod_Network_JComponent parent, bool editable, HydrologyNode node, int nodeNum) { __parent = parent; __editable = editable; __node = node; __nodeNum = nodeNum; JGUIUtil.setIcon(this, JGUIUtil.getIconImage()); 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(); }
/// <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(); }
/// <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 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(); }
/// <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(); }
/// <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(); }
/// <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> /// 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> /// Sets up the GUI. </summary> /// <exception cref="Exception"> if there is an error setting up the worksheet. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: private void setupGUI() throws Exception private void setupGUI() { addWindowListener(this); JPanel panel = new JPanel(); panel.setLayout(new GridBagLayout()); // buildJScrollWorksheet is defined in the derived classes (it is // abstract in this class). It creates a JScrollWorksheet and returns it. __scrollWorksheet = buildJScrollWorksheet(); _worksheet = __scrollWorksheet.getJWorksheet(); JGUIUtil.addComponent(panel, __scrollWorksheet, 0, 0, 1, 1, 1, 1, GridBagConstraints.BOTH, GridBagConstraints.CENTER); getContentPane().add("Center", panel); SimpleJButton exportButton = new SimpleJButton(_BUTTON_EXPORT, this); SimpleJButton printButton = new SimpleJButton(_BUTTON_PRINT, this); SimpleJButton okButton = new SimpleJButton(_BUTTON_OK, this); SimpleJButton applyButton = null; SimpleJButton cancelButton = null; if (_editable) { applyButton = new SimpleJButton(_BUTTON_APPLY, this); cancelButton = new SimpleJButton(_BUTTON_CANCEL, this); } JPanel bottomPanel = new JPanel(); bottomPanel.setLayout(new FlowLayout(FlowLayout.RIGHT)); bottomPanel.add(exportButton); bottomPanel.add(printButton); bottomPanel.add(okButton); if (_editable) { bottomPanel.add(applyButton); bottomPanel.add(cancelButton); } getContentPane().add("South", bottomPanel); JGUIUtil.setIcon(this, JGUIUtil.getIconImage()); setTitle(_titleString); pack(); setSize(800, 400); JGUIUtil.center(this); setVisible(true); JWorksheet_DefaultTableCellRenderer renderer = _worksheet.getCellRenderer(); int[] widths = renderer.getColumnWidths(); if (widths != null) { _worksheet.setColumnWidths(widths); } }