public class ImageHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private static java.util.Map<java.lang.Integer,java.lang.Object> |
imgDownMap
Map to store pending images for button widget down image.
|
private static java.util.Map<java.lang.Integer,java.lang.Object> |
imgInsMap
Map to store pending images for button widget disabled image.
|
private static java.util.Map<java.lang.Integer,java.lang.Object> |
imgMap
Map to store pending images for image widget.
|
private static java.util.Map<java.lang.Integer,java.lang.Object> |
imgUpMap
Map to store pending images for button widget up image.
|
private static java.util.Map<MousePointer,java.lang.String> |
mousePointerFiles
Map pre-defined MousePointers w/o AWT/JS counterparts to data files
|
private static java.util.Map<MousePointer,CursorType> |
mousePointerTypes
Map pre-defined MousePointers to AWT/JS ones
|
Constructor and Description |
---|
ImageHelper() |
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
cursorFile(MousePointer ptr)
Get data file name for the mouse pointer
|
static CursorType |
cursorType(MousePointer ptr)
Get AWT/JS cursor type for the mouse pointer
|
static byte[] |
getPendingImageData(int wId,
int type)
Gets the new image data byte array for loading at widget realization stage.
|
static java.lang.String |
getPendingImageName(int wId,
int type)
Gets the new image file name for loading at widget realization stage.
|
static byte[] |
getPrepackagedImageData(java.lang.String fileName)
Gets the new image data byte array for prepackaged images.
|
static boolean |
isPrepackaged(java.lang.String fileName)
Checks if the given image file name belongs to the set of the prepackaged images embedded
into project distribution.
|
static boolean |
storePendingImageData(int wId,
int type,
byte[] imageBytes)
Saves the new image data byte array for further loading at widget realization stage.
|
static boolean |
storePendingImageName(int wId,
int type,
java.lang.String fileName)
Saves the new image name for further loading at widget realization stage.
|
private static final java.util.Map<java.lang.Integer,java.lang.Object> imgMap
private static final java.util.Map<java.lang.Integer,java.lang.Object> imgUpMap
private static final java.util.Map<java.lang.Integer,java.lang.Object> imgDownMap
private static final java.util.Map<java.lang.Integer,java.lang.Object> imgInsMap
private static final java.util.Map<MousePointer,CursorType> mousePointerTypes
private static final java.util.Map<MousePointer,java.lang.String> mousePointerFiles
public static boolean storePendingImageName(int wId, int type, java.lang.String fileName)
wId
- ID of the widget will own the image.type
- Image type to load. Up, Down or Insensitive for buttons or image.fileName
- The file name for the image to be loaded.TRUE
if operation successful FALSE
otherwise.public static boolean storePendingImageData(int wId, int type, byte[] imageBytes)
wId
- ID of the widget will own the image.type
- Image type to load. Up, Down or Insensitive for buttons or image.imageBytes
- The byte array data for the image to be loaded.TRUE
if operation successful FALSE
otherwise.public static byte[] getPendingImageData(int wId, int type)
wId
- ID of the widget will own the image.type
- Image type to load. Up, Down or Insensitive for buttons or image.public static java.lang.String getPendingImageName(int wId, int type)
wId
- ID of the widget will own the image.type
- Image type to load. Up, Down or Insensitive for buttons or image.public static boolean isPrepackaged(java.lang.String fileName)
fileName
- The file name for the image to be checked.TRUE
if given image is prepackaged FALSE
otherwise.public static byte[] getPrepackagedImageData(java.lang.String fileName)
fileName
- The file name for the image to be loaded from p2j.jar.public static CursorType cursorType(MousePointer ptr)
ptr
- mouse pointerpublic static java.lang.String cursorFile(MousePointer ptr)
ptr
- mouse pointer