Package org.csstudio.ui.util
Class CustomMediaFactory
java.lang.Object
org.csstudio.ui.util.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
Modifier and TypeFieldDescriptionstatic final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final RGB
static final FontData
the font Arial in height of 9 -
Method Summary
Modifier and TypeMethodDescriptiongetColor
(int r, int g, int b) Create theColor
for the given color information.Create theColor
for the givenRGB
.getDefaultFont
(int style) Return the system's default font.Create theFont
for the given information.Create theFont
for the givenFontData
and the given style code.Create theFont
for the givenFontData
.Create theFont
for the givenFontData
and the given style code.getImageDescriptorFromPlugin
(String pluginId, String relativePath) Load theImageDescriptor
from the given path in the given plugin.getImageFromPlugin
(String pluginId, String relativePath) Load theImage
from the given path in the given plugin.getImageFromPlugin
(Plugin plugin, String pluginId, String relativePath) Load theImage
from the given path in the given plugin.static CustomMediaFactory
-
Field Details
-
COLOR_LIGHT_BLUE
-
COLOR_BLUE
-
COLOR_WHITE
-
COLOR_GRAY
-
COLOR_DARK_GRAY
-
COLOR_BLACK
-
COLOR_RED
-
COLOR_GREEN
-
COLOR_YELLOW
-
COLOR_PINK
-
COLOR_CYAN
-
COLOR_ORANGE
-
COLOR_PURPLE
-
COLOR_X11_PURPLE
-
FONT_ARIAL
the font Arial in height of 9
-
-
Method Details
-
getInstance
-
getColor
Create theColor
for the given color information. -
getColor
Create theColor
for the givenRGB
. -
getFont
Create theFont
for the given information. -
getFont
Create theFont
for the givenFontData
. -
getFont
Create theFont
for the givenFontData
and the given style code. -
getFont
Create theFont
for the givenFontData
and the given style code. -
getDefaultFont
Return the system's default font.- Parameters:
style
- additional styles, e.g. SWT.Bold- Returns:
- The system's default font.
-
getImageFromPlugin
Load theImage
from the given path in the given plugin.- Parameters:
pluginId
- The id of the plugin that contains the requested image.relativePath
- The resource path of the requested image.- Returns:
- The
Image
from the given path in the given plugin.
-
getImageFromPlugin
Load theImage
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.- Parameters:
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.- Returns:
- The
Image
from the given path in the given plugin.
-
getImageDescriptorFromPlugin
Load theImageDescriptor
from the given path in the given plugin.- Parameters:
pluginId
- The id of the plugin that contains the requested image.relativePath
- The resource path of the requested image.- Returns:
- The
ImageDescriptor
from the given path in the given plugin.
-