Search in sources :

Example 1 with HIGHLIGHT

use of main.system.images.ImageManager.HIGHLIGHT in project Eidolons by IDemiurge.

the class MiniObjComp method applyHighlights.

private void applyHighlights() {
    if (hl != null) {
        Map<HIGHLIGHT, BufferedImage> highlightedImageCache = highlightedImageCacheMap.get(image);
        if (highlightedImageCache == null) {
            highlightedImageCache = new HashMap<>();
            highlightedImageCacheMap.put(image, highlightedImageCache);
        }
        BufferedImage buffer = highlightedImageCache.get(hl);
        if (buffer == null) {
            buffer = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
            buffer.getGraphics().drawImage(image, 0, 0, width, height, null);
            Image sizedVersion = ImageManager.getSizedIcon(hl.getBorder().getImagePath(), size).getImage();
            buffer.getGraphics().drawImage(sizedVersion, 0, 0, null);
            highlightedImageCache.put(hl, buffer);
        }
        image = buffer;
    }
    boolean terrain = (obj instanceof DC_Cell);
    if (terrain) {
    // green?
    } else if (obj.isInfoSelected()) {
        image = ImageManager.applyImageNew(image, ImageManager.BORDER_INFO_SELECTION_HIGHLIGHT.getImage());
    }
// image = ImageManager.applyBorder(image,
// ImageManager.BORDER_INFO_SELECTION_HIGHLIGHT);
}
Also used : DC_Cell(eidolons.entity.obj.DC_Cell) HIGHLIGHT(main.system.images.ImageManager.HIGHLIGHT) BufferedImage(java.awt.image.BufferedImage) BufferedImage(java.awt.image.BufferedImage)

Aggregations

DC_Cell (eidolons.entity.obj.DC_Cell)1 BufferedImage (java.awt.image.BufferedImage)1 HIGHLIGHT (main.system.images.ImageManager.HIGHLIGHT)1