com.java4less.rchart.gc.android
Class ChartAndroidGraphics

java.lang.Object
  extended by com.java4less.rchart.gc.ChartGraphics
      extended by com.java4less.rchart.gc.android.ChartAndroidGraphics

public class ChartAndroidGraphics
extends ChartGraphics


Field Summary
 
Fields inherited from class com.java4less.rchart.gc.ChartGraphics
ROTATE_CENTER, ROTATE_LEFTTOP, STROKE_DASHED, STROKE_DOTTED, STROKE_NORMAL
 
Constructor Summary
ChartAndroidGraphics(java.lang.Object g)
           
 
Method Summary
 void createFadeArea(ChartColor colorFrom, ChartColor colorUntil, int x, int y, int w, int h, boolean vertical, boolean cyclic)
          creates a gradient filling
 void drawArc(int x, int y, int w, int h, int a1, int a2)
          paint an arc
 void drawImage(ChartImage image, int x, int y)
          paint image at given position
 void drawImage(ChartImage image, int x1Dest, int y1Dest, int x2Dest, int y2Dest, int x1Source, int y1Source, int x2Source, int y2Source)
          paint image from source position to destination position
 void drawLine(int x1, int y1, int x2, int y2)
          paint a line
 void drawPolygon(int[] x1, int[] y1, int count)
          draw polygon
 void drawRect(int x1, int y1, int w, int h)
          draw rectangle
 boolean drawRotatedText(ChartFont descFont, ChartColor descColor, java.lang.String txt, int angle, int x, int y, boolean b)
          paint vertical text
 void drawString(java.lang.String s, int x, int y)
          draw string at position x,y
 void fillArc(int x, int y, int w, int h, int a1, int a2)
          Fills an arc
 void fillPolygon(int[] x1, int[] y1, int count)
          fill polygon
 void fillRect(int x1, int y1, int w, int h)
          fill rectangle
 java.lang.Object getAlphaComposite()
          get transparency value
 ChartColor getColor()
          get current color in context
 ChartFont getFont()
          get current font in context
 int getFontHeight(ChartFont font)
          get the height of the current font
 int getFontWidth(ChartFont font, java.lang.String s)
          get the width of a string using the current font
 void paintRotatedImage(ChartImage srcImage, int angle, int x, int y, int alignment)
          rotate image and paint it
 void setAlpha(float a)
          set transparency value
 void setAlphaComposite(java.lang.Object a)
          set transparency value
 void setColor(ChartColor color)
          set current color in context
 void setFont(ChartFont font)
          set current font in context
 void setLineStyle(int style)
          sets style of line
 void setLineWidth(int w)
          sets style of line
 
Methods inherited from class com.java4less.rchart.gc.ChartGraphics
dispose, drawLineWithStyle, drawRoundedRect, fillRoundRect, getFontHeight, getFontWidth, setTexture
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartAndroidGraphics

public ChartAndroidGraphics(java.lang.Object g)
Method Detail

setColor

public void setColor(ChartColor color)
set current color in context

Overrides:
setColor in class ChartGraphics
Parameters:
color -

setFont

public void setFont(ChartFont font)
set current font in context

Overrides:
setFont in class ChartGraphics
Parameters:
f -

getColor

public ChartColor getColor()
get current color in context

Overrides:
getColor in class ChartGraphics
Returns:
color

getFont

public ChartFont getFont()
get current font in context

Overrides:
getFont in class ChartGraphics
Returns:
f

drawArc

public void drawArc(int x,
                    int y,
                    int w,
                    int h,
                    int a1,
                    int a2)
paint an arc

Overrides:
drawArc in class ChartGraphics
Parameters:
x -
y -
w -
h -
a1 -
a2 -

drawLine

public void drawLine(int x1,
                     int y1,
                     int x2,
                     int y2)
paint a line

Overrides:
drawLine in class ChartGraphics
Parameters:
x1 -
y1 -
x2 -
y2 -

getFontHeight

public int getFontHeight(ChartFont font)
get the height of the current font

Overrides:
getFontHeight in class ChartGraphics
Returns:

getFontWidth

public int getFontWidth(ChartFont font,
                        java.lang.String s)
get the width of a string using the current font

Overrides:
getFontWidth in class ChartGraphics
Returns:

drawRotatedText

public boolean drawRotatedText(ChartFont descFont,
                               ChartColor descColor,
                               java.lang.String txt,
                               int angle,
                               int x,
                               int y,
                               boolean b)
paint vertical text

Overrides:
drawRotatedText in class ChartGraphics
Parameters:
g -
DescFont -
DescColor -
txt -
x -
y -
b -

paintRotatedImage

public void paintRotatedImage(ChartImage srcImage,
                              int angle,
                              int x,
                              int y,
                              int alignment)
rotate image and paint it

Overrides:
paintRotatedImage in class ChartGraphics
Parameters:
srcImage - source image (must be a square, width=height)
angle - angle
x - position where image must be painted
y - position where image must be painted

drawString

public void drawString(java.lang.String s,
                       int x,
                       int y)
draw string at position x,y

Overrides:
drawString in class ChartGraphics
Parameters:
s -
x -
y -

drawImage

public void drawImage(ChartImage image,
                      int x,
                      int y)
paint image at given position

Overrides:
drawImage in class ChartGraphics
Parameters:
image -
x -
y -

drawImage

public void drawImage(ChartImage image,
                      int x1Dest,
                      int y1Dest,
                      int x2Dest,
                      int y2Dest,
                      int x1Source,
                      int y1Source,
                      int x2Source,
                      int y2Source)
paint image from source position to destination position

Overrides:
drawImage in class ChartGraphics
Parameters:
image -
x1Dest -
y1Dest -
x2Dest -
y2Dest -
x1Source -
y1Source -
x2Source -
y2Source -

fillPolygon

public void fillPolygon(int[] x1,
                        int[] y1,
                        int count)
fill polygon

Overrides:
fillPolygon in class ChartGraphics
Parameters:
x1 -
y1 -
count -

fillRect

public void fillRect(int x1,
                     int y1,
                     int w,
                     int h)
fill rectangle

Overrides:
fillRect in class ChartGraphics
Parameters:
x1 -
y1 -
w -
h -

drawPolygon

public void drawPolygon(int[] x1,
                        int[] y1,
                        int count)
draw polygon

Overrides:
drawPolygon in class ChartGraphics
Parameters:
x1 -
y1 -
count -

drawRect

public void drawRect(int x1,
                     int y1,
                     int w,
                     int h)
draw rectangle

Overrides:
drawRect in class ChartGraphics
Parameters:
x1 -
y1 -
w -
h -

createFadeArea

public void createFadeArea(ChartColor colorFrom,
                           ChartColor colorUntil,
                           int x,
                           int y,
                           int w,
                           int h,
                           boolean vertical,
                           boolean cyclic)
Description copied from class: ChartGraphics
creates a gradient filling

Overrides:
createFadeArea in class ChartGraphics
x - top left corner position
y - top left corner position
w - with of rectangle
h - height of rectangle
vertical - vertical gradient?

fillArc

public void fillArc(int x,
                    int y,
                    int w,
                    int h,
                    int a1,
                    int a2)
Description copied from class: ChartGraphics
Fills an arc

Overrides:
fillArc in class ChartGraphics
Parameters:
x - top left corner of the rectangle
y - top left corner of the rectangle
w - width of the rectngle
h - height of the rectangle
a1 - start arc
a2 - end arc

setAlpha

public void setAlpha(float a)
set transparency value

Overrides:
setAlpha in class ChartGraphics
Parameters:
alpha -

setAlphaComposite

public void setAlphaComposite(java.lang.Object a)
set transparency value

Overrides:
setAlphaComposite in class ChartGraphics
Parameters:
alpha -

getAlphaComposite

public java.lang.Object getAlphaComposite()
get transparency value

Overrides:
getAlphaComposite in class ChartGraphics
Returns:
alpha

setLineStyle

public void setLineStyle(int style)
sets style of line

Overrides:
setLineStyle in class ChartGraphics
Parameters:
style -

setLineWidth

public void setLineWidth(int w)
sets style of line

Overrides:
setLineWidth in class ChartGraphics
Parameters:
style -