|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.java4less.rchart.gc.GraphicsProvider
Use this class to create graphic objects like fonts, colors and images. This class provides a layer on the AWT and SWT graphic implementation which allows rchart to be independent of them. You can use the setMode() method to select the AWT of SWT implementation.
Field Summary | |
static int |
MODE_AWT_SWING
AWT /Swing, for JDK 1.2 or later |
static int |
MODE_AWT1
JDK 1.1 compatible mode |
static int |
MODE_SWT
SWT mode |
Constructor Summary | |
GraphicsProvider()
|
Method Summary | |
static ChartImage |
createImage(int w,
int h)
create a new image of the given size |
static ChartImage |
createTransparentImage(int w,
int h,
ChartColor transparent)
create a new transparent image of the given size |
static ChartColor |
getColor(int red,
int green,
int blue)
|
static ChartColor |
getColor(java.lang.String c)
|
static ChartColor |
getColorFromObject(java.lang.Object o)
|
static ChartFont |
getFont(java.lang.String c,
int style,
int size)
create font from string value |
static ChartFont |
getFontFromObject(java.lang.Object o)
|
static ChartGraphics |
getGraphics(java.lang.Object o)
create Graphic context from awt (java.awt.Graphics) or swt (GC) graphic context |
static ChartImage |
getImage(java.lang.Object o)
create Image from awt (java.awt.Image) or swt image |
static ChartImage |
getImageFromFile(java.lang.String file)
create Image from file |
static int |
getMode()
get provider mode |
static void |
setMode(int m)
set provider mode. |
static void |
startUIThread(java.lang.Runnable r)
this starts a thread which can execute UI operations (required by SWT) |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static int MODE_AWT_SWING
public static int MODE_SWT
public static int MODE_AWT1
Constructor Detail |
public GraphicsProvider()
Method Detail |
public static void setMode(int m)
public static int getMode()
public static ChartColor getColor(java.lang.String c)
public static ChartColor getColor(int red, int green, int blue)
public static ChartColor getColorFromObject(java.lang.Object o)
public static ChartFont getFont(java.lang.String c, int style, int size)
c
- name of the fontstyle
- ChartFont.PLAIN, ChartFont.BOLD or ChartFont.ITALICsize
- size of the font
public static ChartFont getFontFromObject(java.lang.Object o)
public static ChartGraphics getGraphics(java.lang.Object o)
o
-
public static ChartImage getImage(java.lang.Object o)
o
-
public static ChartImage getImageFromFile(java.lang.String file)
file
- filename
public static ChartImage createImage(int w, int h)
w
- widthh
- height
public static ChartImage createTransparentImage(int w, int h, ChartColor transparent)
w
- widthh
- height
public static void startUIThread(java.lang.Runnable r)
r
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |