Atomic Developer Documentation
0.3.0-SNAPSHOT
Developer documentation and API
|
Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc. More...
Static Public Member Functions | |
static Color | getColor (int systemColorID) |
Returns the system Color matching the specific ID. More... | |
static Color | getColor (int r, int g, int b) |
Returns a Color given its red, green and blue component values. More... | |
static Color | getColor (RGB rgb) |
Returns a Color given its RGB value. More... | |
static void | disposeColors () |
Dispose of all the cached Color's. | |
static Image | getImage (String path) |
Returns an Image stored in the file at the specified path. More... | |
static Image | getImage (Class<?> clazz, String path) |
Returns an Image stored in the file at the specified path relative to the specified class. More... | |
static Image | decorateImage (Image baseImage, Image decorator) |
Returns an Image composed of a base image decorated by another image. More... | |
static Image | decorateImage (final Image baseImage, final Image decorator, final int corner) |
Returns an Image composed of a base image decorated by another image. More... | |
static void | disposeImages () |
Dispose all of the cached Image's. | |
static Font | getFont (String name, int height, int style) |
Returns a Font based on its name, height and style. More... | |
static Font | getFont (String name, int size, int style, boolean strikeout, boolean underline) |
Returns a Font based on its name, height and style. More... | |
static Font | getBoldFont (Font baseFont) |
Returns a bold version of the given Font. More... | |
static void | disposeFonts () |
Dispose all of the cached Font's. | |
static Cursor | getCursor (int id) |
Returns the system cursor matching the specific ID. More... | |
static void | disposeCursors () |
Dispose all of the cached cursors. | |
static void | dispose () |
Dispose of cached objects and their underlying OS resources. More... | |
Static Public Attributes | |
static final int | TOP_LEFT = 1 |
Style constant for placing decorator image in top left corner of base image. | |
static final int | TOP_RIGHT = 2 |
Style constant for placing decorator image in top right corner of base image. | |
static final int | BOTTOM_LEFT = 3 |
Style constant for placing decorator image in bottom left corner of base image. | |
static final int | BOTTOM_RIGHT = 4 |
Style constant for placing decorator image in bottom right corner of base image. | |
Static Protected Member Functions | |
static Image | getImage (InputStream stream) throws IOException |
Returns an Image encoded by the specified InputStream. More... | |
Static Protected Attributes | |
static final int | LAST_CORNER_KEY = 5 |
Internal value. | |
Utility class for managing OS resources associated with SWT controls such as colors, fonts, images, etc.
!!! IMPORTANT !!! Application code must explicitly invoke the dispose()
method to release the operating system resources managed by cached objects when those objects and OS resources are no longer needed (e.g. on application shutdown)
This class may be freely distributed as part of any application or plugin.
Definition at line 43 of file SWTResourceManager.java.
|
static |
|
static |
Returns an Image composed of a base image decorated by another image.
baseImage | the base Image that should be decorated |
decorator | the Image to decorate the base image |
corner | the corner to place decorator image |
Definition at line 233 of file SWTResourceManager.java.
|
static |
Dispose of cached objects and their underlying OS resources.
This should only be called when the cached objects are no longer needed (e.g. on application shutdown).
Definition at line 441 of file SWTResourceManager.java.
|
static |
Returns a bold version of the given Font.
baseFont | the Font for which a bold version is desired |
Definition at line 373 of file SWTResourceManager.java.
|
static |
Returns the system Color matching the specific ID.
systemColorID | the ID value for the color |
Definition at line 57 of file SWTResourceManager.java.
|
static |
Returns a Color given its red, green and blue component values.
r | the red component of the color |
g | the green component of the color |
b | the blue component of the color |
Definition at line 72 of file SWTResourceManager.java.
|
static |
Returns a Color given its RGB value.
rgb | the RGB value of the color |
Definition at line 82 of file SWTResourceManager.java.
|
static |
Returns the system cursor matching the specific ID.
id | int The ID value for the cursor |
Definition at line 414 of file SWTResourceManager.java.
|
static |
Returns a Font based on its name, height and style.
name | the name of the font |
height | the height of the font |
style | the style of the font |
Definition at line 321 of file SWTResourceManager.java.
|
static |
Returns a Font based on its name, height and style.
Windows-specific strikeout and underline flags are also supported.
name | the name of the font |
size | the size of the font |
style | the style of the font |
strikeout | the strikeout flag (warning: Windows only) |
underline | the underline flag (warning: Windows only) |
Definition at line 340 of file SWTResourceManager.java.
|
staticprotected |
Returns an Image encoded by the specified InputStream.
stream | the InputStream encoding the image data |
Definition at line 116 of file SWTResourceManager.java.
|
static |
Returns an Image stored in the file at the specified path.
path | the path to the image file |
Definition at line 135 of file SWTResourceManager.java.
|
static |
Returns an Image stored in the file at the specified path relative to the specified class.
clazz | the Class relative to which to find the image |
path | the path to the image file, if starts with '/' |
Definition at line 157 of file SWTResourceManager.java.