|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavoids.Media
public final class Media
A class to load the media files required for this game. The files include, the images, sounds, liscence, readme, and version information.
Field Summary | |
---|---|
private static ImageMap |
imageMap
an image map of all images |
private static boolean |
isSoundEnabled
is the sound enabled |
private static ItemLoader |
item
the item file's text |
private static java.lang.String |
ITEM
the item file name |
private static TextLoader |
license
the license file's text |
private static java.lang.String |
LICENSE
the license file name |
private static TextLoader |
readme
the readme file's text |
private static java.lang.String |
README
the readme file name |
private static long |
serialVersionUID
This is the version used for serializing/deserializing (storing/retrieving) this object |
private static SoundMap |
soundMap
an sound map of all sounds |
private static TextLoader |
version
the version file's text |
private static java.lang.String |
VERSION
the version file name |
private static int |
volumePercent
the volume level (0..100%) |
Constructor Summary | |
---|---|
Media()
|
Method Summary | |
---|---|
static java.awt.Image |
getImage(ImageMap.Name name)
|
static javax.swing.ImageIcon |
getImageIcon(ImageMap.Name name)
|
static java.util.HashMap<ImageMap.Name,java.awt.Image> |
getImages()
|
static java.util.HashMap<Item.Type,Item> |
getItems()
|
static java.lang.String |
getLicense()
|
static int |
getNumberImages()
|
static int |
getNumberSounds()
|
static java.lang.String |
getReadme()
|
static java.awt.Image |
getScaledImage(ImageMap.Name name,
int width,
int height,
int hints)
|
static java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> |
getSounds()
|
static java.lang.String |
getVersion()
|
static int |
getVolume()
|
static void |
play(SoundMap.Sound sound)
|
static void |
setImage(ImageMap.Name name,
java.awt.Image image)
|
static void |
setIsSound(boolean _isSoundEnabled)
|
static void |
setVolume(javax.sound.sampled.Clip clip,
int _volumePercent)
|
static void |
setVolume(int value)
|
static void |
stopAll()
stop all sounds from playing |
java.lang.String |
toString()
Provide a String representation of this object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private static final java.lang.String README
private static final java.lang.String VERSION
private static final java.lang.String LICENSE
private static final java.lang.String ITEM
private static final ImageMap imageMap
private static final SoundMap soundMap
private static final TextLoader readme
private static final TextLoader version
private static final TextLoader license
private static final ItemLoader item
private static boolean isSoundEnabled
private static int volumePercent
Constructor Detail |
---|
public Media()
Method Detail |
---|
public static java.util.HashMap<ImageMap.Name,java.awt.Image> getImages()
public static java.awt.Image getImage(ImageMap.Name name)
name
- the desired image's name
public static javax.swing.ImageIcon getImageIcon(ImageMap.Name name)
name
- the desired icon's name
public static java.awt.Image getScaledImage(ImageMap.Name name, int width, int height, int hints)
name
- the name of the desired imagewidth
- the width of the imageheight
- the height of the imagehints
- rendering hints
public static int getNumberImages()
public static java.util.HashMap<SoundMap.Sound,javax.sound.sampled.Clip> getSounds()
public static java.util.HashMap<Item.Type,Item> getItems()
public static int getNumberSounds()
public static java.lang.String getReadme()
public static java.lang.String getVersion()
public static java.lang.String getLicense()
public static void setIsSound(boolean _isSoundEnabled)
_isSoundEnabled
- set if the sound is enabledpublic static void setImage(ImageMap.Name name, java.awt.Image image)
name
- the image name to setimage
- the image to associate with the image namepublic static void play(SoundMap.Sound sound)
sound
- the name of the sound to playpublic static void setVolume(javax.sound.sampled.Clip clip, int _volumePercent)
clip
- the sound clip to set the volume for_volumePercent
- the volume level to setpublic static int getVolume()
public static void setVolume(int value)
value
- the percent value to set the volume levelpublic static void stopAll()
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |