コード例 #1
0
 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
コード例 #2
0
 /**
  * <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