Class Resources
-
Method Summary
Modifier and TypeMethodDescriptionReturns the data resource from the fileString[]Returns the names of the data resources within this bundleReturns the font resource from the fileString[]Returns the names of the fonts within this bundlestatic ResourcesGlobal resources are used by new GUI builder apps to keep track of the applications resourcesReturns the image resource from the fileString[]Returns the names of the images within this bundleReturns a hashmap containing localized String key/value pairs for the given locale nameString[]Returns the names of the localization bundles within this bundleintReturns the version number for this resource file.String[]Returns optional meta-data associated with the resource fileintReturns the minor version number for this resource file This value relates to the value from the header defined by the resource file specification.String[]Returns the names of the resources within this bundlestatic ResourcesGets the system resource which can be located /CN1Images.res.Returns the theme resource from the fileString[]Returns the names of the images within this bundleString[]Returns the names of the ui resources within this bundlebooleanisAnimation(String name) Returns true if this is an animation resourcebooleanReturns true if this is a data resourcestatic booleanstatic booleanReturns
booleanReturns true if this is a font resourcebooleanReturns true if this is an image resourcebooleanReturns true if this is a generic data resourcebooleanReturns true if this is a theme resourcebooleanReturns true if this is a UI resourcel10NLocaleSet(String id) Returns a collection of the l10 locale namesReturns an enumration of the locales supported by this resource idstatic Resourcesopen(InputStream resource) Creates a resource object from the given input streamstatic Resourcesopen(InputStream resource, int dpi) Creates a resource object from the given input streamstatic ResourcesCreates a resource object from the local JAR resource identifierstatic ResourcesCreates a resource object from the local JAR resource identifierstatic ResourcesopenLayered(String resource) Opens a multi-layer resource file that supports overriding features on a specific platform.static ResourcesopenLayered(String resource, int dpi) Opens a multi-layer resource file that supports overriding features on a specific platform.voidoverride(InputStream input) This method allows overriding the data of a resource file with another resource file thus replacing or enhancing existing content with platform specific content.static voidsetEnableMediaQueries(boolean enable) static voidsetFailOnMissingTruetype(boolean aFailOnMissingTruetype) Parameters
static voidGlobal resources are used by new GUI builder apps to keep track of the applications resourcesstatic voidsetPassword(String password) Sets the password to use for password protected resource filesstatic voidsetRuntimeMultiImageEnabled(boolean b) This flag should be off and it is off by default, some special case implementations for development e.g.
-
Method Details
-
isFailOnMissingTruetype
public static boolean isFailOnMissingTruetype()Returns
the failOnMissingTruetype
-
setFailOnMissingTruetype
public static void setFailOnMissingTruetype(boolean aFailOnMissingTruetype) Parameters
aFailOnMissingTruetype: the failOnMissingTruetype to set
-
isEnableMediaQueries
public static boolean isEnableMediaQueries() -
setEnableMediaQueries
public static void setEnableMediaQueries(boolean enable) -
setRuntimeMultiImageEnabled
public static void setRuntimeMultiImageEnabled(boolean b) This flag should be off and it is off by default, some special case implementations for development e.g. the AWT implementation activate this flag in order to use the EncodedImage multi-image support which is entirely for development only!
Deprecated
do not use this method!
-
setPassword
Sets the password to use for password protected resource files
Parameters
password: the password or null to clear the password
-
openLayered
Opens a multi-layer resource file that supports overriding features on a specific platform. Notice that the ".res" extension MUST not be given to this method!
Parameters
resource: @param resource a local reference to a resource using the syntax of Class.getResourceAsStream(String) however the extension MUST not be included in the name! E.g. to reference /x.res use /x
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
open
Creates a resource object from the local JAR resource identifier
Parameters
resource: a local reference to a resource using the syntax of Class.getResourceAsStream(String)
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
open
Creates a resource object from the given input stream
Parameters
resource: stream from which to read the resource
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
openLayered
Opens a multi-layer resource file that supports overriding features on a specific platform. Notice that the ".res" extension MUST not be given to this method!
Parameters
-
resource: @param resource a local reference to a resource using the syntax of Class.getResourceAsStream(String) however the extension MUST not be included in the name! E.g. to reference /x.res use /x -
dpi: the dpi used for the loaded images
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
-
open
Creates a resource object from the local JAR resource identifier
Parameters
-
resource: a local reference to a resource using the syntax of Class.getResourceAsStream(String) -
dpi: the dpi used for the loaded images
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
-
open
Creates a resource object from the given input stream
Parameters
-
resource: stream from which to read the resource -
dpi: the dpi used for the loaded images
Returns
a resource object
Throws
java.io.IOException: if opening/reading the resource fails
- Throws:
IOException
-
-
getSystemResource
Gets the system resource which can be located /CN1Images.res.
Returns
a Resources object which contains the system resources
-
getGlobalResources
Global resources are used by new GUI builder apps to keep track of the applications resources
Returns
the resource object used by default in the GUI builder forms
-
setGlobalResources
Global resources are used by new GUI builder apps to keep track of the applications resources
Parameters
res: the resource object used by default in the GUI builder forms
-
override
This method allows overriding the data of a resource file with another resource file thus replacing or enhancing existing content with platform specific content. E.g. default icons for the application can be overriden on a specific platform
Parameters
input: a new resource file
Throws
IOException: exception thrown from the stream
- Throws:
IOException
-
getMajorVersion
public int getMajorVersion()Returns the version number for this resource file. This value relates to the value from the header defined by the resource file specification. 0 is returned for legacy versions of the resource file format.
Returns
major version number for the resource file
-
getMinorVersion
public int getMinorVersion()Returns the minor version number for this resource file This value relates to the value from the header defined by the resource file specification.
Returns
minor version number for the resource file
-
getMetaData
Returns optional meta-data associated with the resource file
Returns
optional meta-data associated with the file
-
getResourceNames
Returns the names of the resources within this bundle
Returns
array of names of all the resources in this bundle
-
getDataResourceNames
Returns the names of the data resources within this bundle
Returns
array of names of the data resources in this bundle
-
getUIResourceNames
Returns the names of the ui resources within this bundle
Returns
array of names of the ui resources in this bundle
-
getL10NResourceNames
Returns the names of the localization bundles within this bundle
Returns
array of names of the localization resources in this bundle
-
getFontResourceNames
Returns the names of the fonts within this bundle
Returns
array of names of the font resources in this bundle
-
getThemeResourceNames
Returns the names of the images within this bundle
Returns
array of names of the image resources in this bundle
-
getImageResourceNames
Returns the names of the images within this bundle
Returns
array of names of the image resources in this bundle
-
isL10N
Returns true if this is a generic data resource
Parameters
name: the name of the resource
Returns
true if the resource is a data resource
Throws
NullPointerException: if the resource doesn't exist
-
isTheme
Returns true if this is a theme resource
Parameters
name: the name of the resource
Returns
true if the resource is a theme
Throws
NullPointerException: if the resource doesn't exist
-
isFont
Returns true if this is a font resource
Parameters
name: the name of the resource
Returns
true if the resource is a font
Throws
NullPointerException: if the resource doesn't exist
-
isAnimation
Returns true if this is an animation resource
Parameters
name: the name of the resource
Returns
true if the resource is an animation
Throws
NullPointerException: if the resource doesn't exist
Deprecated
animations are no longer distinguished from images in the resource file, use Image.isAnimation instead
-
isData
Returns true if this is a data resource
Parameters
name: the name of the resource
Returns
true if the resource is a data resource
Throws
NullPointerException: if the resource doesn't exist
-
isUI
Returns true if this is a UI resource
Parameters
name: the name of the resource
Returns
true if the resource is a UI resource
Throws
NullPointerException: if the resource doesn't exist
-
isImage
Returns true if this is an image resource
Parameters
name: the name of the resource
Returns
true if the resource is an image
Throws
NullPointerException: if the resource doesn't exist
-
getImage
-
getData
Returns the data resource from the file
Parameters
id: name of the data resource
Returns
newly created input stream that allows reading the data of the resource
-
getL10N
Returns a hashmap containing localized String key/value pairs for the given locale name
Parameters
-
id: the name of the locale resource -
locale: name of the locale resource
Returns
Hashtable containing key value pairs for localized data
-
-
listL10NLocales
Returns an enumration of the locales supported by this resource id
Parameters
id: the name of the locale resource
Returns
enumeration of strings containing bundle names
-
l10NLocaleSet
Returns a collection of the l10 locale names
Parameters
id: the name of the locale resource
Returns
collection of strings containing bundle names
-
getFont
-
getTheme
-