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
FieldsModifier and TypeFieldDescriptionstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final RGBstatic final FontDatathe font Arial in height of 9 -
Method Summary
Modifier and TypeMethodDescriptiongetColor(int r, int g, int b) Create theColorfor the given color information.Create theColorfor the givenRGB.getDefaultFont(int style) Return the system's default font.Create theFontfor the given information.Create theFontfor the givenFontDataand the given style code.Create theFontfor the givenFontData.Create theFontfor the givenFontDataand the given style code.getImageDescriptorFromPlugin(String pluginId, String relativePath) Load theImageDescriptorfrom the given path in the given plugin.getImageFromPlugin(String pluginId, String relativePath) Load theImagefrom the given path in the given plugin.getImageFromPlugin(Plugin plugin, String pluginId, String relativePath) Load theImagefrom 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 theColorfor the given color information. -
getColor
Create theColorfor the givenRGB. -
getFont
Create theFontfor the given information. -
getFont
Create theFontfor the givenFontData. -
getFont
Create theFontfor the givenFontDataand the given style code. -
getFont
Create theFontfor the givenFontDataand 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 theImagefrom 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
Imagefrom the given path in the given plugin.
-
getImageFromPlugin
Load theImagefrom 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
Imagefrom the given path in the given plugin.
-
getImageDescriptorFromPlugin
Load theImageDescriptorfrom 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
ImageDescriptorfrom the given path in the given plugin.
-