22 package com.realtime.crossfire.jxclient.faces;
24 import java.awt.GraphicsConfiguration;
25 import java.awt.GraphicsDevice;
26 import java.awt.GraphicsEnvironment;
27 import java.awt.Transparency;
28 import javax.swing.ImageIcon;
29 import org.jetbrains.annotations.NotNull;
53 return new FaceImages(originalImageIcon, scaledImageIcon, magicMapImageIcon);
62 final GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
63 final GraphicsDevice graphicsDevice = graphicsEnvironment.getDefaultScreenDevice();
64 final GraphicsConfiguration graphicsConfiguration = graphicsDevice.getDefaultConfiguration();
66 final ImageIcon emptyOriginalImageIcon =
new ImageIcon(graphicsConfiguration.createCompatibleImage(
Face.
SQUARE_SIZE,
Face.
SQUARE_SIZE, Transparency.OPAQUE));
67 final ImageIcon emptyScaledImageIcon =
new ImageIcon(graphicsConfiguration.createCompatibleImage(
Face.
SQUARE_SIZE*2,
Face.
SQUARE_SIZE*2, Transparency.OPAQUE));
68 final ImageIcon emptyMagicMapImageIcon =
new ImageIcon(graphicsConfiguration.createCompatibleImage(
Face.
SQUARE_SIZE/8,
Face.
SQUARE_SIZE/8, Transparency.OPAQUE));
69 return new FaceImages(emptyOriginalImageIcon, emptyScaledImageIcon, emptyMagicMapImageIcon);
static FaceImages newFaceImages(@NotNull final ImageIcon originalImageIcon)
Creates a new FaceImages instance from an "original" face; the "scaled" and "magic map" sized images ...
static final int SQUARE_SIZE
The size of one square in pixels.
Utility class for creating FaceImages instances.
Consists of three ImageIcons representing a Face.
static FaceImages newEmptyFaceImages()
Creates a new FaceImages instance consisting of empty images.
A utility to scale down an image by 8 in both dimensions.
ImageIcon getScaledImage()
Retrieves the scaled image.
ImageIcon getScaledImage()
Returns the scaled image.
A utility to perform the scale2x algorithm on a Java Image.
FaceImagesUtils()
Private constructor to prevent instantiation.