public class SWTResourceManager extends Object
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.
Copyright (c) 2003 - 2005, Instantiations, Inc.
All Rights Reserved
| Modifier and Type | Field and Description |
|---|---|
static int |
BOTTOM_LEFT
Style constant for placing decorator image in bottom left corner of base image.
|
static int |
BOTTOM_RIGHT
Style constant for placing decorator image in bottom right corner of base image.
|
static int |
TOP_LEFT
Style constant for placing decorator image in top left corner of base image.
|
static int |
TOP_RIGHT
Style constant for placing decorator image in top right corner of base image.
|
| Constructor and Description |
|---|
SWTResourceManager() |
| Modifier and Type | Method and Description |
|---|---|
static org.eclipse.swt.graphics.Image |
decorateImage(org.eclipse.swt.graphics.Image baseImage,
org.eclipse.swt.graphics.Image decorator)
Returns an image composed of a base image decorated by another image.
|
static org.eclipse.swt.graphics.Image |
decorateImage(org.eclipse.swt.graphics.Image baseImage,
org.eclipse.swt.graphics.Image decorator,
int corner)
Returns an image composed of a base image decorated by another image.
|
static void |
dispose()
Dispose of cached objects and their underlying OS resources.
|
static void |
disposeColors()
Dispose of all the cached colors.
|
static void |
disposeCursors()
Dispose all of the cached cursors.
|
static void |
disposeFonts()
Dispose all of the cached fonts.
|
static void |
disposeImages()
Dispose all of the cached images.
|
static void |
disposeImages(String section)
Dispose cached images in specified section.
|
static void |
fixCoolBarSize(org.eclipse.swt.widgets.CoolBar bar)
Fix the layout of the specified CoolBar.
|
static org.eclipse.swt.graphics.Font |
getBoldFont(org.eclipse.swt.graphics.Font baseFont)
Return a bold version of the give font.
|
static org.eclipse.swt.graphics.Color |
getColor(int systemColorID)
Returns the system color matching the specific ID.
|
static org.eclipse.swt.graphics.Color |
getColor(int r,
int g,
int b)
Returns a color given its red, green and blue component values.
|
static org.eclipse.swt.graphics.Color |
getColor(org.eclipse.swt.graphics.RGB rgb)
Returns a color given its RGB value.
|
static org.eclipse.swt.graphics.Cursor |
getCursor(int id)
Returns the system cursor matching the specific ID.
|
static org.eclipse.swt.graphics.Font |
getFont(String name,
int height,
int style)
Returns a font based on its name, height and style.
|
static org.eclipse.swt.graphics.Font |
getFont(String name,
int size,
int style,
boolean strikeout,
boolean underline)
Returns a font based on its name, height and style.
|
static org.eclipse.swt.graphics.Image |
getImage(Class<?> clazz,
String path)
Returns an image stored in the file at the specified path relative to the specified class.
|
static org.eclipse.swt.graphics.Image |
getImage(String path)
Returns an image stored in the file at the specified path.
|
static org.eclipse.swt.graphics.Image |
getImage(String section,
String path)
Returns an image stored in the file at the specified path.
|
public static final int TOP_LEFT
public static final int TOP_RIGHT
public static final int BOTTOM_LEFT
public static final int BOTTOM_RIGHT
public static void dispose()
public static org.eclipse.swt.graphics.Color getColor(int systemColorID)
systemColorID - int The ID value for the colorpublic static org.eclipse.swt.graphics.Color getColor(int r,
int g,
int b)
r - int The red component of the colorg - int The green component of the colorb - int The blue component of the colorpublic static org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
rgb - RGB The RGB value of the colorpublic static void disposeColors()
public static org.eclipse.swt.graphics.Image getImage(String path)
path - String The path to the image filepublic static org.eclipse.swt.graphics.Image getImage(String section, String path)
section - The section to which belongs specified imagepath - String The path to the image filepublic static org.eclipse.swt.graphics.Image getImage(Class<?> clazz, String path)
clazz - Class The class relative to which to find the imagepath - String The path to the image filepublic static org.eclipse.swt.graphics.Image decorateImage(org.eclipse.swt.graphics.Image baseImage,
org.eclipse.swt.graphics.Image decorator)
baseImage - Image The base image that should be decorateddecorator - Image The image to decorate the base imagepublic static org.eclipse.swt.graphics.Image decorateImage(org.eclipse.swt.graphics.Image baseImage,
org.eclipse.swt.graphics.Image decorator,
int corner)
baseImage - Image The base image that should be decorateddecorator - Image The image to decorate the base imagecorner - The corner to place decorator imagepublic static void disposeImages()
public static void disposeImages(String section)
section - the section do disposepublic static org.eclipse.swt.graphics.Font getFont(String name, int height, int style)
name - String The name of the fontheight - int The height of the fontstyle - int The style of the fontpublic static org.eclipse.swt.graphics.Font getFont(String name, int size, int style, boolean strikeout, boolean underline)
name - String The name of the fontsize - int The size of the fontstyle - int The style of the fontstrikeout - boolean The strikeout flag (warning: Windows only)underline - boolean The underline flag (warning: Windows only)public static org.eclipse.swt.graphics.Font getBoldFont(org.eclipse.swt.graphics.Font baseFont)
baseFont - Font The font for whoch a bold version is desiredpublic static void disposeFonts()
public static void fixCoolBarSize(org.eclipse.swt.widgets.CoolBar bar)
bar - CoolBar The CoolBar that shgoud be fixedpublic static org.eclipse.swt.graphics.Cursor getCursor(int id)
id - int The ID value for the cursorpublic static void disposeCursors()