/// <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_WellRight wellr = (StateMod_WellRight)_data.get(row); // necessary for table models that display rights for 1+ wells so that // the -1st column (ID) can also be displayed. By doing it this way, // code can be shared between the two kinds of table models and less // maintenance is necessary. if (!__singleWell) { col--; } switch (col) { case COL_WELL_ID: return(wellr.getCgoto()); case COL_RIGHT_ID: return(wellr.getID()); case COL_RIGHT_NAME: return(wellr.getName()); case COL_STRUCT_ID: return(wellr.getCgoto()); case COL_ADMIN_NUM: return(wellr.getIrtem()); case COL_DCR_AMT: return(new double?(wellr.getDcrdivw())); case COL_ON_OFF: return(new int?(wellr.getSwitch())); case COL_PARCEL_YEAR: return(new int?(wellr.getParcelYear())); case COL_PARCEL_CLASS: return(new int?(wellr.getParcelMatchClass())); case COL_PARCEL_ID: return(Convert.ToInt32(wellr.getParcelID())); case COL_COLLECTION_TYPE: return(wellr.getCollectionType()); case COL_COLLECTION_PART_TYPE: return(wellr.getCollectionPartType()); case COL_COLLECTION_PART_ID: return(wellr.getCollectionPartId()); case COL_COLLECTION_PART_ID_TYPE: return(wellr.getCollectionPartIdType()); case COL_X_RIGHT_WDID: return(wellr.getXWDID()); case COL_X_RIGHT_APPROPRIATION_DATE: if (wellr.getXApproDate() == null) { return(null); } else { DateTime dt = new DateTime(wellr.getXApproDate()); return(dt.ToString()); } case COL_X_RIGHT_ADMIN_NUMBER: return(wellr.getXApproDateAdminNumber()); case COL_X_PERMIT_RECEIPT: return(wellr.getXPermitReceipt()); case COL_X_PERMIT_DATE: if (wellr.getXPermitDate() == null) { return(null); } else { DateTime dt = new DateTime(wellr.getXPermitDate()); return(dt.ToString()); } case COL_X_PERMIT_ADMIN_NUMBER: return(wellr.getXPermitDateAdminNumber()); case COL_X_WELL_YIELD_GPM: return(wellr.getXYieldGPM()); case COL_X_WELL_YIELD_CFS: return(wellr.getXYieldGPM() * .002228); case COL_X_APEX_GPM: return(wellr.getXYieldApexGPM()); case COL_X_APEX_CFS: return(wellr.getXYieldApexGPM() * .002228); case COL_X_WELL_FRACTION: return(wellr.getXFractionYield()); case COL_X_DITCH_FRACTION: return(wellr.getXDitchFraction()); case COL_X_YIELD_PRORATED_GPM: return(new double?(wellr.getDcrdivw() / .002228)); default: 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_WellRight wellr = (StateMod_WellRight)_data.get(row); switch (col) { case COL_RIGHT_ID: return(wellr.getID()); case COL_RIGHT_NAME: return(wellr.getName()); case COL_STRUCT_ID: return(wellr.getCgoto()); case COL_ADMIN_NUM: return(wellr.getIrtem()); case COL_DCR_AMT: return(new double?(wellr.getDcrdivw())); case COL_ON_OFF: return(new int?(wellr.getSwitch())); case COL_PARCEL_YEAR: return(new int?(wellr.getParcelYear())); case COL_PARCEL_CLASS: return(new int?(wellr.getParcelMatchClass())); case COL_PARCEL_ID: return(wellr.getParcelID()); case COL_COLLECTION_TYPE: return(wellr.getCollectionType()); case COL_COLLECTION_PART_TYPE: return(wellr.getCollectionPartType()); case COL_COLLECTION_PART_ID: return(wellr.getCollectionPartId()); case COL_COLLECTION_PART_ID_TYPE: return(wellr.getCollectionPartIdType()); case COL_X_RIGHT_WDID: return(wellr.getXWDID()); case COL_X_RIGHT_APPROPRIATION_DATE: if (wellr.getXApproDate() == null) { return(null); } else { DateTime dt = new DateTime(wellr.getXApproDate()); return(dt.ToString()); } case COL_X_RIGHT_ADMIN_NUMBER: return(wellr.getXApproDateAdminNumber()); case COL_X_RIGHT_USE: return(wellr.getXUse()); case COL_X_PERMIT_RECEIPT: return(wellr.getXPermitReceipt()); case COL_X_PERMIT_DATE: if (wellr.getXPermitDate() == null) { return(null); } else { DateTime dt = new DateTime(wellr.getXPermitDate()); return(dt.ToString()); } case COL_X_PERMIT_ADMIN_NUMBER: return(wellr.getXPermitDateAdminNumber()); case COL_X_WELL_YIELD_GPM: return(wellr.getXYieldGPM()); case COL_X_WELL_YIELD_CFS: return(wellr.getXYieldGPM() * .002228); case COL_X_APEX_GPM: return(wellr.getXYieldApexGPM()); case COL_X_APEX_CFS: return(wellr.getXYieldApexGPM() * .002228); case COL_X_WELL_FRACTION: return(wellr.getXFractionYield()); case COL_X_DITCH_FRACTION: return(wellr.getXDitchFraction()); case COL_X_YIELD_PRORATED_GPM: return(new double?(wellr.getDcrdivw() / .002228)); default: return(""); } }