com.java4less.rchart.gc
Class GraphicsProvider

java.lang.Object
  extended by com.java4less.rchart.gc.GraphicsProvider

public class GraphicsProvider
extends java.lang.Object

Use this class to create graphic objects like fonts, colors and images.
 This class provides a layer on the graphic implementation which allows rchart to be independent of platform. 
 


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 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
 

Constructor Detail

GraphicsProvider

public GraphicsProvider()
Method Detail

getColor

public static ChartColor getColor(java.lang.String c)

getColor

public static ChartColor getColor(int red,
                                  int green,
                                  int blue)

getColorFromObject

public static ChartColor getColorFromObject(java.lang.Object o)

getFont

public static ChartFont getFont(java.lang.String c,
                                int style,
                                int size)
create font from string value

Parameters:
c - name of the font
style - ChartFont.PLAIN, ChartFont.BOLD or ChartFont.ITALIC
size - size of the font
Returns:

getFontFromObject

public static ChartFont getFontFromObject(java.lang.Object o)

getGraphics

public static ChartGraphics getGraphics(java.lang.Object o)
create Graphic context from awt (java.awt.Graphics) or swt (GC) graphic context

Parameters:
o -
Returns:

getImage

public static ChartImage getImage(java.lang.Object o)
create Image from awt (java.awt.Image) or swt image

Parameters:
o -
Returns:

getImageFromFile

public static ChartImage getImageFromFile(java.lang.String file)
create Image from file

Parameters:
file - filename
Returns:

createImage

public static ChartImage createImage(int w,
                                     int h)
create a new image of the given size

Parameters:
w - width
h - height
Returns:

createTransparentImage

public static ChartImage createTransparentImage(int w,
                                                int h,
                                                ChartColor transparent)
create a new transparent image of the given size

Parameters:
w - width
h - height
Returns:

startUIThread

public static void startUIThread(java.lang.Runnable r)
this starts a thread which can execute UI operations (required by SWT)

Parameters:
r -