public final class XYGraphMediaFactory
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static org.eclipse.swt.graphics.RGB |
COLOR_BLACK
the color for black
|
static org.eclipse.swt.graphics.RGB |
COLOR_BLUE
the color for blue
|
static org.eclipse.swt.graphics.RGB |
COLOR_CYAN
the color for cyan
|
static org.eclipse.swt.graphics.RGB |
COLOR_DARK_GRAY
the color for dark gray
|
static org.eclipse.swt.graphics.RGB |
COLOR_GRAY
the color for gray
|
static org.eclipse.swt.graphics.RGB |
COLOR_GREEN
the color for green
|
static org.eclipse.swt.graphics.RGB |
COLOR_LIGHT_BLUE
the color for light blue
|
static org.eclipse.swt.graphics.RGB |
COLOR_ORANGE
the color for orange
|
static org.eclipse.swt.graphics.RGB |
COLOR_PINK
the color for pink
|
static org.eclipse.swt.graphics.RGB |
COLOR_PURPLE
the color for orange
|
static org.eclipse.swt.graphics.RGB |
COLOR_RED
the color for red
|
static org.eclipse.swt.graphics.RGB |
COLOR_WHITE
the color for white
|
static org.eclipse.swt.graphics.RGB |
COLOR_YELLOW
the color for yellow
|
static java.lang.String |
CURSOR_GRABBING_ON_AXIS_PATH |
static java.lang.String |
CURSOR_GRABBING_PATH |
static org.eclipse.swt.graphics.FontData |
FONT_ARIAL
the font for Arial in height of 9
|
static org.eclipse.swt.graphics.FontData |
FONT_TAHOMA
the font for Tahoma in height of 9
|
Modifier and Type | Method and Description |
---|---|
void |
disposeResources() |
org.eclipse.swt.graphics.Color |
getColor(int r,
int g,
int b)
Create the
Color for the given color information. |
org.eclipse.swt.graphics.Color |
getColor(org.eclipse.swt.graphics.RGB rgb)
Create the
Color for the given RGB . |
org.eclipse.swt.graphics.Cursor |
getCursor(java.lang.String cursorImagePath) |
org.eclipse.swt.graphics.Font |
getDefaultFont(int style)
Return the system's default font.
|
org.eclipse.swt.graphics.Font |
getFont(org.eclipse.swt.graphics.FontData fontData)
Create the
Font for the given FontData and the
given style code. |
org.eclipse.swt.graphics.Font |
getFont(org.eclipse.swt.graphics.FontData[] fontData)
Create the
Font for the given FontData . |
org.eclipse.swt.graphics.Font |
getFont(org.eclipse.swt.graphics.FontData[] fontData,
int style)
Create the
Font for the given FontData and the
given style code. |
org.eclipse.swt.graphics.Font |
getFont(java.lang.String name,
int height,
int style)
Create the
Font for the given information. |
org.eclipse.swt.graphics.Image |
getImage(java.lang.String relativePath)
Load the
Image from the given path in the given plugin. |
static XYGraphMediaFactory |
getInstance()
Return the shared instance of this class.
|
org.eclipse.swt.graphics.Image |
getRegisteredImage(java.lang.String key) |
void |
registerCursor(java.lang.String key,
org.eclipse.swt.graphics.Cursor cursor)
Register the cursor so it can be disposed when the plugin stopped.
|
void |
registerImage(java.lang.String key,
org.eclipse.swt.graphics.Image img)
Register the image to imageRegistry so it can be disposed when Display
disposed.
|
public static final java.lang.String CURSOR_GRABBING_PATH
public static final java.lang.String CURSOR_GRABBING_ON_AXIS_PATH
public static final org.eclipse.swt.graphics.RGB COLOR_LIGHT_BLUE
public static final org.eclipse.swt.graphics.RGB COLOR_BLUE
public static final org.eclipse.swt.graphics.RGB COLOR_WHITE
public static final org.eclipse.swt.graphics.RGB COLOR_GRAY
public static final org.eclipse.swt.graphics.RGB COLOR_DARK_GRAY
public static final org.eclipse.swt.graphics.RGB COLOR_BLACK
public static final org.eclipse.swt.graphics.RGB COLOR_RED
public static final org.eclipse.swt.graphics.RGB COLOR_GREEN
public static final org.eclipse.swt.graphics.RGB COLOR_YELLOW
public static final org.eclipse.swt.graphics.RGB COLOR_PINK
public static final org.eclipse.swt.graphics.RGB COLOR_CYAN
public static final org.eclipse.swt.graphics.RGB COLOR_ORANGE
public static final org.eclipse.swt.graphics.RGB COLOR_PURPLE
public static final org.eclipse.swt.graphics.FontData FONT_ARIAL
public static final org.eclipse.swt.graphics.FontData FONT_TAHOMA
public void disposeResources()
public org.eclipse.swt.graphics.Cursor getCursor(java.lang.String cursorImagePath)
public static XYGraphMediaFactory getInstance()
public org.eclipse.swt.graphics.Color getColor(int r, int g, int b)
Color
for the given color information.r
- redg
- greenb
- blueColor
for the given color information.public org.eclipse.swt.graphics.Color getColor(org.eclipse.swt.graphics.RGB rgb)
Color
for the given RGB
.rgb
- A RGB
object.Color
for the given RGB
.public org.eclipse.swt.graphics.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 org.eclipse.swt.graphics.Font getFont(org.eclipse.swt.graphics.FontData[] fontData)
Font
for the given FontData
.fontData
- The FontData
Font
for the given FontData
public org.eclipse.swt.graphics.Font getFont(org.eclipse.swt.graphics.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 org.eclipse.swt.graphics.Font getFont(org.eclipse.swt.graphics.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 org.eclipse.swt.graphics.Font getDefaultFont(int style)
style
- additional styles, e.g. SWT.Boldpublic void registerImage(java.lang.String key, org.eclipse.swt.graphics.Image img)
key
- img
- public org.eclipse.swt.graphics.Image getRegisteredImage(java.lang.String key)
public org.eclipse.swt.graphics.Image getImage(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.relativePath
- The image's relative path to the root of the plugin.Image
from the given path in the given plugin.public void registerCursor(java.lang.String key, org.eclipse.swt.graphics.Cursor cursor)
cursor
-