es.prodevelop.gvsig.mobile.fmap.util
Class ResourceReader

java.lang.Object
  extended byes.prodevelop.gvsig.mobile.fmap.util.ResourceReader

public class ResourceReader
extends java.lang.Object

Utility class to read resource files.

Author:
jldominguez
See Also:
MediaTracker

Field Summary
static java.awt.Image[] GPS_CURSOR_ICON
          Array of GPS icons (16 positions)
static int GPS_CURSOR_ICON_COUNT
          number of positions of the GPS cursor
static int imageCount
           
static java.awt.MediaTracker mt
          Used to read images
static int PROCESS_ICON_SIZE
           
static int PROCESS_ICON_X
           
static int PROCESS_ICON_Y
           
static java.awt.Image PROCESSING_ICON
          Icon shown while the app is processing.
 
Constructor Summary
ResourceReader()
           
 
Method Summary
static int getGpsIconIndexForAngle(double angle, boolean in_radians)
          Gets the GPS icon index for a given angle
static java.awt.Image getImage(byte[] data)
          Gets an image from an array of bytes for a well known format (png, jpg, gif)
static java.awt.Image getImage(java.io.File data)
          Gets an image from a file in a well known format (png, jpg, gif)
static java.io.File getResourceFile(java.lang.String dir, java.lang.String file_name)
          Gets a file from the resource folder
static java.io.File getResourceFolder(java.lang.String dir)
          gets a subfolder from the resources folder
static java.awt.Image getResourceImage(java.lang.String dir, java.lang.String file_name)
          Gets an image from the resources folder
static java.io.File getWorkingDir(java.lang.String dir)
          Gets the working subfolder
static java.io.File getWorkingDirFile(java.lang.String dir, java.lang.String file_name)
          gets a file from the working directory
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROCESSING_ICON

public static java.awt.Image PROCESSING_ICON
Icon shown while the app is processing.


GPS_CURSOR_ICON

public static java.awt.Image[] GPS_CURSOR_ICON
Array of GPS icons (16 positions)


GPS_CURSOR_ICON_COUNT

public static int GPS_CURSOR_ICON_COUNT
number of positions of the GPS cursor


PROCESS_ICON_X

public static int PROCESS_ICON_X

PROCESS_ICON_Y

public static int PROCESS_ICON_Y

PROCESS_ICON_SIZE

public static int PROCESS_ICON_SIZE

mt

public static java.awt.MediaTracker mt
Used to read images


imageCount

public static int imageCount
Constructor Detail

ResourceReader

public ResourceReader()
Method Detail

getGpsIconIndexForAngle

public static int getGpsIconIndexForAngle(double angle,
                                          boolean in_radians)
Gets the GPS icon index for a given angle

Parameters:
angle - heading
in_radians - whether it is radians or degrees
Returns:
the GPS icon index

getResourceImage

public static java.awt.Image getResourceImage(java.lang.String dir,
                                              java.lang.String file_name)
Gets an image from the resources folder

Parameters:
dir - the resources subfolder
file_name - the file name
Returns:
the image from the resources folder

getImage

public static java.awt.Image getImage(byte[] data)
Gets an image from an array of bytes for a well known format (png, jpg, gif)

Parameters:
data - the byte array
Returns:
the image

getImage

public static java.awt.Image getImage(java.io.File data)
Gets an image from a file in a well known format (png, jpg, gif)

Parameters:
data - the image file
Returns:
the image object

getWorkingDirFile

public static java.io.File getWorkingDirFile(java.lang.String dir,
                                             java.lang.String file_name)
gets a file from the working directory

Parameters:
dir - subfolder
file_name - file name
Returns:
the file object

getWorkingDir

public static java.io.File getWorkingDir(java.lang.String dir)
Gets the working subfolder

Parameters:
dir - subfolder name
Returns:
the working subfolder

getResourceFile

public static java.io.File getResourceFile(java.lang.String dir,
                                           java.lang.String file_name)
Gets a file from the resource folder

Parameters:
dir -
file_name -
Returns:
the file object

getResourceFolder

public static java.io.File getResourceFolder(java.lang.String dir)
gets a subfolder from the resources folder

Parameters:
dir - the subfolder name
Returns:
the file object