|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.haphazard.gui.GlobalImageUtilities
A class that handles loading of images and turning them to BufferedImage
Constructor Summary | |
GlobalImageUtilities()
|
Method Summary | |
static void |
drawString(java.awt.Graphics2D g,
java.awt.Point middleTileScreenCoord,
java.lang.String str,
java.awt.Color color)
A static function to draw a string in a graphics context. |
java.awt.image.BufferedImage |
flipImageHorizontally(java.lang.String entry,
java.awt.image.BufferedImage image)
Flips the imge horizontally and returns the new image |
java.awt.image.BufferedImage |
flipImageVertically(java.lang.String entry,
java.awt.image.BufferedImage image)
Flips the imge vertically and returns the new image |
java.util.Enumeration |
getAvailableFlippedHorizontallyImages()
Gets the available images that has been flipped horizontally |
java.util.Enumeration |
getAvailableFlippedVerticallyImages()
Gets the available images that has been flipped vertically |
java.util.Enumeration |
getAvailableImages()
Gets the available loaded images |
java.awt.image.BufferedImage |
getBufferedImage(java.lang.String entry)
Create Image from a file, then turn that into a BufferedImage. |
java.awt.image.BufferedImage |
getBufferedImage(java.lang.String entry,
int width,
int height)
Create Image from a file, then turn that into a BufferedImage. |
static GlobalImageUtilities |
getInstance()
Gets an instance of the image utilities |
static java.awt.image.BufferedImage |
getStaticBufferedImage(int width,
int height,
int type)
|
void |
init(javax.swing.JPanel owner)
Sets the owning drawing area for images |
static java.util.Vector |
line(java.awt.Point p1,
java.awt.Point p2)
|
static boolean |
waitForImage(java.awt.Image image)
Take an Image associated with a file, and wait until it is done loading. |
boolean |
waitForImages(java.awt.Image[] images)
Take some Images associated with files, and wait until they are done loading. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GlobalImageUtilities()
Method Detail |
public static GlobalImageUtilities getInstance()
public void init(javax.swing.JPanel owner)
owner
- The drawing area of the applicationpublic java.awt.image.BufferedImage getBufferedImage(java.lang.String entry)
public java.awt.image.BufferedImage getBufferedImage(java.lang.String entry, int width, int height)
public static java.awt.image.BufferedImage getStaticBufferedImage(int width, int height, int type)
public java.awt.image.BufferedImage flipImageVertically(java.lang.String entry, java.awt.image.BufferedImage image)
image
- the image to be fliped
public java.awt.image.BufferedImage flipImageHorizontally(java.lang.String entry, java.awt.image.BufferedImage image)
image
- the image to be fliped
public static boolean waitForImage(java.awt.Image image)
image
- The image to wait on
public boolean waitForImages(java.awt.Image[] images)
images
- The images to wait on
public java.util.Enumeration getAvailableImages()
public java.util.Enumeration getAvailableFlippedVerticallyImages()
public java.util.Enumeration getAvailableFlippedHorizontallyImages()
public static java.util.Vector line(java.awt.Point p1, java.awt.Point p2)
public static void drawString(java.awt.Graphics2D g, java.awt.Point middleTileScreenCoord, java.lang.String str, java.awt.Color color)
g
- the Graphics2D contextmiddleTileScreenCoord
- the coordinate on the screen where the middle of the string should bestr
- the string to be drawncolor
- the color of the string
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |