Package jmri.jmrit.etcs
Class ResourceUtil
java.lang.Object
jmri.jmrit.etcs.ResourceUtil
Class to locate ERTMS Graphical and Audio resources.
-
Method Summary
Modifier and TypeMethodDescriptionstatic BufferedImageConvert an image containing the DMI Background Colour to a transparent background.static FilegetImageFile(String fileName) Get the File for an Image.static ImageIcongetImageIcon(String fileName) Get the Image Icon for a given FileName.static BufferedImagestatic voidplayDmiSound(int sound) Play one of the DMI UI Sounds. 1 - S1_toofast.wav - 2 secs 2 - S2_warning.wav - 3 secs 3 - S_info.wav - 1 sec 4 - click.wav - 1 secstatic BufferedImagestatic voidstopDmiSound(int sound) Stop a DMI Sound from playing.
-
Method Details
-
getImageFile
Get the File for an Image. Note this File may not actually exist.- Parameters:
fileName- the Filename to search for.- Returns:
- File with appropriate Directory.
-
getImageIcon
Get the Image Icon for a given FileName.- Parameters:
fileName- the FileName to search for.- Returns:
- ImageIcon, or null if image not located.
-
getTransparentImage
-
readFile
-
convertColorToTransparent
@CheckForNull public static BufferedImage convertColorToTransparent(@CheckForNull BufferedImage image) Convert an image containing the DMI Background Colour to a transparent background.- Parameters:
image- the Image to convert.- Returns:
- converted image, or null.
-
playDmiSound
Play one of the DMI UI Sounds. 1 - S1_toofast.wav - 2 secs 2 - S2_warning.wav - 3 secs 3 - S_info.wav - 1 sec 4 - click.wav - 1 sec- Parameters:
sound- which Sound, plays once.- Throws:
IllegalArgumentException- when needed
-
stopDmiSound
Stop a DMI Sound from playing.- Parameters:
sound- normally 2, the only sound which plays in a loop.
-