Ejemplo n.º 1
0
        /// <summary>
        /// Returns the data that should be placed in the JTable at the given row and column. </summary>
        /// <param name="row"> the row for which to return data. </param>
        /// <param name="col"> the column for which to return data. </param>
        /// <returns> the data that should be placed in the JTable at the given row and col. </returns>
        public virtual object getValueAt(int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }
            StateMod_OperationalRight smo = (StateMod_OperationalRight)_data.get(row);

            switch (col)
            {
            case COL_ID:
                return(smo.getID());

            case COL_NAME:
                return(smo.getName());

            case COL_TYPE:
                return("" + smo.getItyopr());

            case COL_STRUCTURE_ID:
                return("N/A");
                //return (String)__interns.elementAt(row);
            }
            return(" ");
        }
        /// <summary>
        /// Returns the data that should be placed in the JTable at the given row and column. </summary>
        /// <param name="row"> the row for which to return data. </param>
        /// <param name="col"> the column for which to return data. </param>
        /// <returns> the data that should be placed in the JTable at the given row and col. </returns>
        public virtual object getValueAt(int row, int col)
        {
            if (_sortOrder != null)
            {
                row = _sortOrder[row];
            }

            StateMod_OperationalRight opr = (StateMod_OperationalRight)_data.get(row);

            switch (col)
            {
            case COL_ID:
                return(opr.getID());

            case COL_NAME:
                return(opr.getName());

            case COL_ADMINISTRATION_NUMBER:
                return(opr.getRtem());

            case COL_MONTH_STR_SWITCH:
                return(new int?(opr.getDumx()));

            case COL_ONOFF_SWITCH:
                return(new int?(opr.getSwitch()));

            case COL_DEST:
                return(opr.getCiopde());

            case COL_DEST_ACCOUNT:
                return(opr.getIopdes());

            case COL_SOURCE1:
                return(opr.getCiopso1());

            case COL_SOURCE1_ACCOUNT:
                return(opr.getIopsou1());

            case COL_SOURCE2:
                return(opr.getCiopso2());

            case COL_SOURCE2_ACCOUNT:
                return(opr.getIopsou2());

            case COL_RULE_TYPE:
                return(new int?(opr.getItyopr()));

            case COL_REUSE_PLAN:
                return(opr.getCreuse());

            case COL_DIVERSION_TYPE:
                return(opr.getCdivtyp());

            case COL_LOSS:
                return(new double?(opr.getOprLoss()));

            case COL_LIMIT:
                return(new double?(opr.getOprLimit()));

            case COL_START_YEAR:
                return(new int?(opr.getIoBeg()));

            case COL_END_YEAR:
                return(new int?(opr.getIoEnd()));

            case COL_MONTHLY_SWITCH:
                int[] imonsw = opr.getImonsw();
                if ((imonsw == null) || (imonsw.Length == 0))
                {
                    return("");
                }
                else
                {
                    StringBuilder b = new StringBuilder();
                    for (int i = 0; i < imonsw.Length; i++)
                    {
                        if (i > 0)
                        {
                            b.Append(",");
                        }
                        b.Append("" + imonsw[i]);
                    }
                    return(b.ToString());
                }

            case COL_INTERVENING_STRUCTURES:
                string[] intern = opr.getIntern();
                if ((intern == null) || (intern.Length == 0))
                {
                    return("");
                }
                else
                {
                    StringBuilder b = new StringBuilder();
                    for (int i = 0; i < intern.Length; i++)
                    {
                        if (i > 0)
                        {
                            b.Append(",");
                        }
                        b.Append("" + intern[i]);
                    }
                    return(b.ToString());
                }

            default:
                return("");
            }
        }