Example #1
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset for which to display data set component information. </param>
        /// <exception cref="Exception"> if an invalid data or dmi was passed in. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public StateMod_Response_TableModel(StateMod_DataSet dataset) throws Exception
        public StateMod_Response_TableModel(StateMod_DataSet dataset)
        {
            __dataset = dataset;
            // get the array of the ints that refer to the groups in
            // the data set.
            int[] groups = __dataset.getComponentGroupNumbers();

            System.Collections.IList ints = new List <object>();
            DataSetComponent         dsc  = null;

            System.Collections.IList v = null;

            // Go through each of the groups and get their data out.  Group data
            // consists of the DataSetComponents the group contains.  For each
            // of the group's DataSetComponents, if it has data, then add its
            // component type to the accumulation vector.
            for (int i = 0; i < groups.Length; i++)
            {
                dsc = __dataset.getComponentForComponentType(groups[i]);
                v   = (System.Collections.IList)dsc.getData();
                if (v == null)
                {
                    v = new List <object>();
                }
                for (int j = 0; j < v.Count; j++)
                {
                    dsc = (DataSetComponent)v[j];
                    // the following makes sure that the response file
                    // is not added here ... the response file is added
                    // below because it must always be in the GUI.
                    if (dsc.getComponentType() != StateMod_DataSet.COMP_RESPONSE && dsc.isVisible())
                    {
                        ints.Add(new int?(dsc.getComponentType()));
                    }
                }
            }

            // now transfer the numbers of the DataSetComponents with data into
            // an int array from the Vector.
            __data    = new int[ints.Count + 1];
            __data[0] = StateMod_DataSet.COMP_RESPONSE;
            for (int i = 0; i < ints.Count; i++)
            {
                __data[i + 1] = ((int?)ints[i]).Value;
            }

            _rows = __data.Length;
        }
Example #2
0
        /// <summary>
        /// Constructor. </summary>
        /// <param name="dataset"> the dataset for which to display information in the worksheet. </param>
        /// <exception cref="Exception"> if an invalid data or dmi was passed in. </exception>
//JAVA TO C# CONVERTER WARNING: Method 'throws' clauses are not available in .NET:
//ORIGINAL LINE: public StateMod_Save_TableModel(StateMod_DataSet dataset) throws Exception
        public StateMod_Save_TableModel(StateMod_DataSet dataset)
        {
            __dataset = dataset;

            // get the array of the ints that refer to the groups in
            // the data set.
            int[] groups = __dataset.getComponentGroupNumbers();

            System.Collections.IList ints = new List <object>();
            DataSetComponent         dsc  = null;

            System.Collections.IList v = null;

            // Go through each of the groups and get their data out.  Group data
            // consists of the DataSetComponents the group contains.  For each
            // of the group's DataSetComponents, if it has data, then add its
            // component type to the accumulation vector.
            for (int i = 0; i < groups.Length; i++)
            {
                dsc = __dataset.getComponentForComponentType(groups[i]);
                v   = (System.Collections.IList)dsc.getData();
                if (v == null)
                {
                    v = new List <object>();
                }
                for (int j = 0; j < v.Count; j++)
                {
                    dsc = (DataSetComponent)v[j];
                    // get the dirty components -- they can be saved
                    // (or not).
                    if (dsc.isDirty())
                    {
                        ints.Add(new int?(dsc.getComponentType()));
                    }
                }
            }

            // now transfer the numbers of the DataSetComponents with data into
            // an int array from the Vector.
            __data = new int[ints.Count];
            for (int i = 0; i < ints.Count; i++)
            {
                __data[i] = ((int?)ints[i]).Value;
            }

            _rows = __data.Length;
        }