private int findResourceYLoc(final PwResource resourceToFind) { int yLoc = 0; Iterator resourceTransSetItr = resourceTransactionSetList.iterator(); while (resourceTransSetItr.hasNext()) { ResourceTransactionSet resourceTransSet = (ResourceTransactionSet) resourceTransSetItr.next(); if (resourceToFind.getId().equals(resourceTransSet.getResource().getId())) { return resourceTransSet.getTransactionSetYOrigin(); } } return yLoc; } // end findResourceYLoc
/** * <code>findNearestResource</code> * * @param dCoords - <code>Point</code> - * @return - <code>PwResource</code> - */ protected final PwResource findNearestResource(final Point dCoords) { int docY = (int) dCoords.getY(); PwResource resourceCandidate = null; Iterator reourceTransSetItr = resourceTransactionSetList.iterator(); while (reourceTransSetItr.hasNext()) { ResourceTransactionSet resourceTransSet = (ResourceTransactionSet) reourceTransSetItr.next(); if (docY >= resourceTransSet.getTransactionSetYOrigin()) { resourceCandidate = resourceTransSet.getResource(); } else { break; } } return resourceCandidate; } // end findNearestResource