예제 #1
0
  /**
   * getting the image representing a resource given the id of a resource
   *
   * @param svgHandle a svg handle
   * @param resourceId the id of the resource from which the image has been created
   * @param useSmallImage whether the returned image should be small or large
   * @return the image representing the resource
   */
  public Image getImage(SVGHandle svgHandle, String resourceId, boolean useSmallImage) {

    Image image = null;

    if (svgHandle != null && resourceId != null && !resourceId.equals("")) {

      Map<String, ImageRepresentation> idToImageMap = null;

      if (handleToIdToImages.containsKey(svgHandle)) {

        idToImageMap = handleToIdToImages.get(svgHandle);

        if (idToImageMap.containsKey(resourceId)) {

          ImageRepresentation imageRepresentation = idToImageMap.get(resourceId);

          if (imageRepresentation != null) {

            if (useSmallImage) {

              image = imageRepresentation.getSmallImage();

            } else {

              image = imageRepresentation.getLargeImage();
            }
          }
        }
      }
    }

    return image;
  }
예제 #2
0
  /**
   * getting the image representing a resource given the id of a resource
   *
   * @param svgHandle a svg handle
   * @param resourceId the id of the resource from which the image has been created
   * @return the image representation object representing the resource
   */
  public ImageRepresentation getResourceImage(SVGHandle svgHandle, String resourceId) {

    ImageRepresentation imageRepresentation = null;

    if (svgHandle != null && resourceId != null && !resourceId.equals("")) {

      Map<String, ImageRepresentation> idToImageMap = null;

      if (handleToIdToImages.containsKey(svgHandle)) {

        idToImageMap = handleToIdToImages.get(svgHandle);

        if (idToImageMap.containsKey(resourceId)) {

          imageRepresentation = idToImageMap.get(resourceId);
        }
      }
    }

    return imageRepresentation;
  }