|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.melloware.jukes.file.image.ImageFactory
public final class ImageFactory
Class to represent and storage area for all icon references. This will reduce overhead and memory usage throughout the application. Also contains some static helper methods for loading and scaling images.
Copyright: Copyright (c) 2006
Company: Melloware, Inc.
| Field Summary | |
|---|---|
static javax.swing.ImageIcon |
ICO_TRAYICON
|
static javax.swing.ImageIcon |
ICO_TRAYPAUSE
|
static javax.swing.ImageIcon |
ICO_TRAYPLAY
|
static javax.swing.ImageIcon |
ICO_TRAYSTOP
|
static javax.swing.ImageIcon |
IMAGE_NOCOVER
|
| Method Summary | |
|---|---|
static javax.swing.ImageIcon |
getDiscImage(java.lang.String aFileName)
Gets the disc and returns it the correct size. |
static javax.swing.ImageIcon |
getIconFromFile(java.lang.String aFileName)
Method to create a new ImageIcon and return the reference |
static java.awt.Image |
getImageFromUrl(java.lang.String aUrl)
Gets an Image from the URL specified. |
static javax.swing.ImageIcon |
getScaledImage(java.lang.String aFileName,
int height,
int width)
Gets an ImageIcon and scales it to the size requested. |
static java.io.File |
saveImage(java.awt.Image image,
java.lang.String filename)
Saves an image file to disk in the location specified. |
static java.lang.String |
saveImageWithFileFormat(java.awt.Image image,
java.lang.String aFormat,
java.lang.String aDirectory,
java.lang.String aArtist,
java.lang.String aDisc)
Saves this image file based on a format from prefs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final javax.swing.ImageIcon ICO_TRAYICON
public static final javax.swing.ImageIcon ICO_TRAYPLAY
public static final javax.swing.ImageIcon ICO_TRAYPAUSE
public static final javax.swing.ImageIcon ICO_TRAYSTOP
public static final javax.swing.ImageIcon IMAGE_NOCOVER
| Method Detail |
|---|
public static javax.swing.ImageIcon getDiscImage(java.lang.String aFileName)
aFileName - the file location of the disc
public static javax.swing.ImageIcon getIconFromFile(java.lang.String aFileName)
aFileName - filename of icon to load
public static java.awt.Image getImageFromUrl(java.lang.String aUrl)
aUrl - the URL to look for the image
public static javax.swing.ImageIcon getScaledImage(java.lang.String aFileName,
int height,
int width)
aFileName - the filename to getheight - the desired height of the imagewidth - the desired width of the image
public static java.io.File saveImage(java.awt.Image image,
java.lang.String filename)
throws java.io.IOException
image - the image to savefilename - the file to save it as
java.io.IOException - if any error occurs writing the file.
public static java.lang.String saveImageWithFileFormat(java.awt.Image image,
java.lang.String aFormat,
java.lang.String aDirectory,
java.lang.String aArtist,
java.lang.String aDisc)
throws java.io.IOException
image - the image to saveaFormat - the string format like %a - %d = Black Crowes - Amorica.jpgaDirectory - the directory to save the file in.aArtist - the name of the artistaDisc - the name of the disc
java.io.IOException - if any error occurs writing the file out
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||