|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.csstudio.ui.util.CustomMediaFactory
public final class CustomMediaFactory
A factory, which provides convinience methods for the creation of Images and Fonts. All resources created via this factory get automatically disposed, when the application is stopped.
Field Summary | |
---|---|
static RGB |
COLOR_BLACK
the color for black |
static RGB |
COLOR_BLUE
the color for blue |
static RGB |
COLOR_CYAN
the color for cyan |
static RGB |
COLOR_DARK_GRAY
the color for dark gray |
static RGB |
COLOR_GRAY
the color for gray |
static RGB |
COLOR_GREEN
the color for green |
static RGB |
COLOR_LIGHT_BLUE
the color for light blue |
static RGB |
COLOR_ORANGE
the color for orange |
static RGB |
COLOR_PINK
the color for pink |
static RGB |
COLOR_PURPLE
the color for orange |
static RGB |
COLOR_RED
the color for red |
static RGB |
COLOR_WHITE
the color for white |
static RGB |
COLOR_YELLOW
the color for yellow |
static FontData |
FONT_ARIAL
the font for Arial in height of 9 |
static FontData |
FONT_TAHOMA
the font for Tahoma in height of 9 |
Method Summary | |
---|---|
Color |
getColor(int r,
int g,
int b)
Create the Color for the given color information. |
Color |
getColor(RGB rgb)
Create the Color for the given RGB . |
Font |
getDefaultFont(int style)
Return the system's default font. |
Font |
getFont(FontData fontData)
Create the Font for the given FontData and the
given style code. |
Font |
getFont(FontData[] fontData)
Create the Font for the given FontData . |
Font |
getFont(FontData[] fontData,
int style)
Create the Font for the given FontData and the
given style code. |
Font |
getFont(java.lang.String name,
int height,
int style)
Create the Font for the given information. |
ImageDescriptor |
getImageDescriptorFromPlugin(java.lang.String pluginId,
java.lang.String relativePath)
Load the ImageDescriptor from the given path in the given
plugin. |
Image |
getImageFromPlugin(Plugin plugin,
java.lang.String pluginId,
java.lang.String relativePath)
Load the Image from the given path in the given plugin. |
Image |
getImageFromPlugin(java.lang.String pluginId,
java.lang.String relativePath)
Load the Image from the given path in the given plugin. |
static CustomMediaFactory |
getInstance()
Return the shared instance of this class. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final RGB COLOR_LIGHT_BLUE
public static final RGB COLOR_BLUE
public static final RGB COLOR_WHITE
public static final RGB COLOR_GRAY
public static final RGB COLOR_DARK_GRAY
public static final RGB COLOR_BLACK
public static final RGB COLOR_RED
public static final RGB COLOR_GREEN
public static final RGB COLOR_YELLOW
public static final RGB COLOR_PINK
public static final RGB COLOR_CYAN
public static final RGB COLOR_ORANGE
public static final RGB COLOR_PURPLE
public static final FontData FONT_ARIAL
public static final FontData FONT_TAHOMA
Method Detail |
---|
public static CustomMediaFactory getInstance()
public Color getColor(int r, int g, int b)
Color
for the given color information.
r
- redg
- greenb
- blue
Color
for the given color information.public Color getColor(RGB rgb)
Color
for the given RGB
.
rgb
- A RGB
object.
Color
for the given RGB
.public Font getFont(java.lang.String name, int height, int style)
Font
for the given information.
name
- The font name.height
- The font height.style
- The font style.
Font
for the given information.public Font getFont(FontData[] fontData)
Font
for the given FontData
.
fontData
- The FontData
Font
for the given FontData
public Font getFont(FontData[] fontData, int style)
Font
for the given FontData
and the
given style code.
fontData
- The FontData
style
- The style code.
Font
for the given FontData
and the
given style code.public Font getFont(FontData fontData)
Font
for the given FontData
and the
given style code.
fontData
- The FontData
Font
for the given FontData
and the
given style code.public Font getDefaultFont(int style)
style
- additional styles, e.g. SWT.Bold
public Image getImageFromPlugin(java.lang.String pluginId, java.lang.String relativePath)
Image
from the given path in the given plugin.
pluginId
- The id of the plugin that contains the requested image.relativePath
- The resource path of the requested image.
Image
from the given path in the given plugin.public Image getImageFromPlugin(Plugin plugin, java.lang.String pluginId, java.lang.String relativePath)
Image
from the given path in the given plugin.
Usually, this is the image found via the the given plug-in relative path.
But this implementation also supports a hack for testing: If no plugin is
running, because for example this is an SWT-only test, the path is used
as is, i.e. relative to the current directory.
plugin
- The plugin that contains the requested image.pluginId
- The id of the plugin.relativePath
- The image's relative path to the root of the plugin.
Image
from the given path in the given plugin.public ImageDescriptor getImageDescriptorFromPlugin(java.lang.String pluginId, java.lang.String relativePath)
ImageDescriptor
from the given path in the given
plugin.
pluginId
- The id of the plugin that contains the requested image.relativePath
- The resource path of the requested image.
ImageDescriptor
from the given path in the given
plugin.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |