Java Code Examples for java.awt.MediaTracker#removeImage()
The following examples show how to use
java.awt.MediaTracker#removeImage() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MultiResolutionImageTest.java From dragonwell8_jdk with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 2
Source File: MultiResolutionImageTest.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 3
Source File: MultiResolutionImageTest.java From jdk8u60 with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 4
Source File: MultiResolutionImageTest.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 5
Source File: MultiResolutionImageTest.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 6
Source File: MultiResolutionImageTest.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 7
Source File: MultiResolutionImageTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 8
Source File: MultiResolutionImageTest.java From hottub with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 9
Source File: MultiResolutionImageTest.java From jdk8u_jdk with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 10
Source File: MultiResolutionImageTest.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 11
Source File: MultiResolutionImageTest.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
static void testToolkitMultiResolutionImageLoad(Image image) throws Exception { MediaTracker tracker = new MediaTracker(new JPanel()); tracker.addImage(image, 0); tracker.waitForID(0); if (tracker.isErrorAny()) { throw new RuntimeException("Error during image loading"); } tracker.removeImage(image, 0); testImageLoaded(image); int w = image.getWidth(null); int h = image.getHeight(null); Image resolutionVariant = ((MultiResolutionImage) image) .getResolutionVariant(2 * w, 2 * h); if (image == resolutionVariant) { throw new RuntimeException("Resolution variant is not loaded"); } testImageLoaded(resolutionVariant); }
Example 12
Source File: Util.java From triplea with GNU General Public License v3.0 | 5 votes |
public static void ensureImageLoaded(final Image anImage) { final MediaTracker tracker = new MediaTracker(component); tracker.addImage(anImage, 1); try { tracker.waitForAll(); tracker.removeImage(anImage); } catch (final InterruptedException ignored) { Thread.currentThread().interrupt(); } }
Example 13
Source File: FixedImagePanel.java From visualvm with GNU General Public License v2.0 | 4 votes |
private static Image loadImage(Image image, MediaTracker mTracker) throws InterruptedException { mTracker.addImage(image, 0); mTracker.waitForID(0); mTracker.removeImage(image, 0); return image; }