TV-Browser 2.7.5 API

util.ui
Class ImageUtilities

java.lang.Object
  extended by util.ui.ImageUtilities

public class ImageUtilities
extends Object

Provides utilities for images.

Author:
Til Schneider, www.murfman.de

Constructor Summary
ImageUtilities()
           
 
Method Summary
static Image createImage(String fileName)
          Returns the image in the specified file.
static Image createImage(String fileName, boolean waitUntilLoaded)
          Returns the image in the specified file.
static Image createImageAsynchronous(String fileName)
           
static Image createImageFromJar(String fileName, Class srcClass)
          Lädt ein Image aus einem Jar-File und gibt es zurück.
static ImageIcon createImageIconFromJar(String fileName, Class srcClass)
          Lädt ein ImageIcon aus einem Jar-File und gibt es zurück.
static void waitForImageData(Image image, Component comp)
          Waits until all the data of an Image is present.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ImageUtilities

public ImageUtilities()
Method Detail

createImage

public static Image createImage(String fileName,
                                boolean waitUntilLoaded)
Returns the image in the specified file.

If the file does not exist null is returned.


createImage

public static Image createImage(String fileName)
Returns the image in the specified file.

If the file does not exist null is returned.


createImageAsynchronous

public static Image createImageAsynchronous(String fileName)

createImageIconFromJar

public static ImageIcon createImageIconFromJar(String fileName,
                                               Class srcClass)
Lädt ein ImageIcon aus einem Jar-File und gibt es zurück.

Ist kein ImageIcon mit diesem Namen im Jar-File, so wird versucht, es vom Dateisystem zu laden.

Wird die ImageIcon-Datei nicht gefunden, so wird null zurück gegeben.

Parameters:
fileName - Der Name der ImageIcon-Datei.
srcClass - Eine Klasse, aus deren Jar-File das ImageIcon geladen werden soll.

createImageFromJar

public static Image createImageFromJar(String fileName,
                                       Class srcClass)
Lädt ein Image aus einem Jar-File und gibt es zurück.

Ist kein Image mit diesem Namen im Jar-File, so wird versucht, es vom Dateisystem zu laden.

Wird die Image-Datei nicht gefunden, so wird null zurück gegeben.

Parameters:
fileName - Der Name der Image-Datei.
srcClass - Eine Klasse, aus deren Jar-File das Image geladen werden soll.

waitForImageData

public static void waitForImageData(Image image,
                                    Component comp)
Waits until all the data of an Image is present.

An Image is after construction only loaded when the data is used. The loading occurs in an extra Thread and can take some time, so it might happen, that an Image is not present after construction (it will be painted partly). This method waits until the whole Image is loaded. The Component comp is needed to monitor the preparing of the Image. You can pass any Component (it will not be changed).

Parameters:
image -
comp -

TV-Browser 2.7.5 API

TV-Browser 2.7.5, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)