|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--jv.objectGui.PsImage
A class for loading and handling images.
| Field Summary | |
protected java.lang.String |
m_alternateText
Alternate text for display if image is missing or unreachable. |
protected boolean |
m_bDoneLoading
|
protected int |
m_currentTrackerID
|
protected int |
m_explicitHeight
New image dimensions after a setSize() call. |
protected boolean |
m_explicitSize
This flag notes an explicit resize request. |
protected int |
m_explicitWidth
New image dimensions after a setSize() call. |
protected int |
m_height
Width and height of the image. |
protected java.awt.Image |
m_image
The actual Image. |
protected java.lang.String |
m_imageString
The relative path as string of the image. |
protected java.net.URL |
m_imageUrl
The absolute URL of the image. |
protected static int |
m_lastTrackerID
Used by MediaTracker to be sure image is loaded before paint & resize, since you can't find out the size until it is done loading. |
protected java.awt.Component |
m_parentComponent
Component necessay for media tracker. |
protected java.awt.MediaTracker |
m_tracker
The MediaTracker that can tell if image has been loaded before trying to paint it or resize based on its size. |
protected int |
m_width
Width and height of the image. |
| Constructor Summary | |
PsImage(java.awt.Image anImage,
java.lang.String alternateText)
Create an PsImage using the image specified. |
|
PsImage(java.lang.String imageString)
Create an PsImage using the image at relative path specified by the string. |
|
PsImage(java.net.URL url)
Create an PsImage using the image at an absolute URL specified by the string. |
|
| Method Summary | |
static java.awt.Image |
createImageFromPixels(java.awt.Component comp,
int[] pixels,
int width,
int height,
int offset,
int bufferWidth)
|
int |
getHeight()
Get height of loaded image. |
java.awt.Image |
getImage()
Get the image after loading it if not done yet. |
static java.awt.Image |
getImage(java.lang.String imageString)
Get image relative to codeBase of applet or from file system. |
static java.awt.Image |
getImage(java.net.URL url)
Get image from absolute URL. |
static PsImage |
getImageFromArchive(java.lang.String imageName,
java.lang.String jarArchive)
|
static int[] |
getPixels(java.awt.Image image)
|
static int[] |
getPixels(java.awt.Image image,
int x,
int y,
int width,
int height,
int[] pixels,
int off,
int scan)
|
int |
getWidth()
Get width of loaded image. |
void |
init()
Create MediaTracker. |
boolean |
loadImage()
Makes sure that the Image is loaded before returning from this method. |
static boolean |
loadImage(java.awt.Component comp,
java.awt.Image image)
Load image with a media tracker and return when image is loaded or failure occurred. |
void |
setParentComponent(java.awt.Component comp)
Set component used for MediaTracker in init() method |
void |
setSize(int width,
int height)
Resizes the image after loading it if not done yet. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected transient java.awt.Image m_image
protected java.net.URL m_imageUrl
protected java.lang.String m_imageString
protected java.lang.String m_alternateText
protected int m_width
protected int m_height
protected boolean m_explicitSize
protected int m_explicitWidth
protected int m_explicitHeight
protected java.awt.MediaTracker m_tracker
m_parentComponentprotected java.awt.Component m_parentComponent
m_tracker,
init(),
setParentComponent(Component)protected static int m_lastTrackerID
protected int m_currentTrackerID
protected boolean m_bDoneLoading
| Constructor Detail |
public PsImage(java.net.URL url)
url - A String specifying the absolute URL of the image.public PsImage(java.lang.String imageString)
imageString - A String specifying the relative path of the image.
public PsImage(java.awt.Image anImage,
java.lang.String alternateText)
image - The imagealternateText - Alternate text used if image cannot be retrievedcomp - Component necessay for media tracker| Method Detail |
public void init()
public void setParentComponent(java.awt.Component comp)
init() methodpublic boolean loadImage()
public int getWidth()
public int getHeight()
public java.awt.Image getImage()
public void setSize(int width,
int height)
public static int[] getPixels(java.awt.Image image,
int x,
int y,
int width,
int height,
int[] pixels,
int off,
int scan)
public static int[] getPixels(java.awt.Image image)
public static PsImage getImageFromArchive(java.lang.String imageName,
java.lang.String jarArchive)
public static java.awt.Image getImage(java.lang.String imageString)
public static java.awt.Image getImage(java.net.URL url)
public static boolean loadImage(java.awt.Component comp,
java.awt.Image image)
public static java.awt.Image createImageFromPixels(java.awt.Component comp,
int[] pixels,
int width,
int height,
int offset,
int bufferWidth)
|
JavaView® v2.00.008 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||