/// <summary> /// Constructor. </summary> /// <param name="data"> the data to display in the worksheet. Can be null or empty, in /// which case an empty worksheet is shown. </param> /// <param name="titleString"> the String to display in the title of the GUI. </param> /// <param name="editable"> whether the data in the JFrame can be edited or not. If true /// the data can be edited, if false they can not. </param> /// <param name="precip"> if true, then the climate stations to view are precip stations. /// If false, they are evap stations. </param> /// <exception cref="Exception"> if there is an error building the worksheet. </exception> //JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET: //ORIGINAL LINE: public StateMod_ReservoirClimate_Data_JFrame(java.util.List data, String titleString, boolean editable, boolean precip) throws Exception public StateMod_ReservoirClimate_Data_JFrame(System.Collections.IList data, string titleString, bool editable, bool precip) : base() { int j = 0; int size = 0; int size2 = 0; StateMod_Reservoir r = null; StateMod_ReservoirClimate c = null; System.Collections.IList climates = null; System.Collections.IList v = new List <object>(); if (data != null) { size = data.Count; } for (int i = 0; i < size; i++) { r = (StateMod_Reservoir)data[i]; climates = r.getClimates(); if (climates == null) { continue; } size2 = climates.Count; for (j = 0; j < size2; j++) { c = (StateMod_ReservoirClimate)climates[j]; if (c == null) { // skip } else if (!precip && c.getType() == StateMod_ReservoirClimate.CLIMATE_EVAP) { c.setCgoto(r.getID()); v.Add(c); } else if (precip && c.getType() == StateMod_ReservoirClimate.CLIMATE_PTPX) { c.setCgoto(r.getID()); v.Add(c); } } } initialize(v, titleString, editable); setSize(377, getHeight()); }
private IList <StateMod_ReservoirClimate> getEvaporationStations(IList <StateMod_ReservoirClimate> stations) { IList <StateMod_ReservoirClimate> v = new List <StateMod_ReservoirClimate>(); StateMod_ReservoirClimate s = null; for (int i = 0; i < stations.Count; i++) { s = stations[i]; if (s.getType() == StateMod_ReservoirClimate.CLIMATE_EVAP) { v.Add(s); } } return(v); }