コード例 #1
0
  /**
   * Returns BufferedImage for hwComponentType at path of size. If marked, the result image is
   * brighter by 50%.
   *
   * @param hwComponentType
   * @param path
   * @param width
   * @param marked
   * @return
   */
  public BufferedImage getImage(
      HwTypeEnum hwComponentType, String path, Integer width, boolean marked) {
    BufferedImage image;

    image = imageBuffer.getBufferedImage(path, width, marked);

    if (image == null) {
      // load image from file
      image = createImage(hwComponentType, path, width, marked);
      // put image into buffer
      imageBuffer.putBufferedImage(path, width, image, marked);
    }

    return image;
  }
コード例 #2
0
  /**
   * Returns BufferedImage for packetType and packetImageType with width.
   *
   * @param packetType
   * @param packageImageType
   * @param width
   * @return
   */
  public BufferedImage getPacketImage(
      PacketType packetType, PacketImageType packageImageType, int width) {
    BufferedImage image;

    String path = getImagePath(packetType, packageImageType);

    image = imageBuffer.getBufferedImage(path, width, false);

    if (image == null) {
      // load image from file
      image = getScaledBufferedImage(path, width);
      // put image into buffer
      imageBuffer.putBufferedImage(path, width, image, false);
    }

    return image;
  }