public class Canvas

  1. Object
  2. Canvas

An internal compatibility class for use by the Charts library. Since the library was ported from an Android library, it made use of Canvas and Paint, so rather than rewriting all of this, we added a Canvas and Paint compatibility layer.

DO NOT USE DIRECTLY

Fields

public Graphics g
public Rectangle bounds
public int absoluteX
public int absoluteY

Constructors

public Canvas()

Methods

public void getClipBounds(Rectangle mRect)
public void drawRect(float left, float top, float right, float bottom, Paint paint)
public void drawText(String string, float x, float y, Paint paint)
public int getHeight()
public int getWidth()
public void drawPath(Shape p, Paint paint)
public void drawLine(float x1, float y1, float x2, float y2, Paint paint)
public void rotate(float angle, float x, float y)
public void scale(float x, float y)
public void translate(float x, float y)
public void drawCircle(float cx, float cy, float r, Paint paint)
public void drawArc(Rectangle2D oval, float currentAngle, float sweepAngle, boolean useCenter, Paint paint)
public void drawArcWithGradient(Rectangle2D oval, float currentAngle, float sweepAngle, boolean useCenter, Paint paint, GradientDrawable gradient)
public void drawPoint(Float get, Float get0, Paint paint)
public void drawRoundRect(Rectangle2D rect, float rx, float ry, Paint mPaint)
public void drawBitmap(Image img, float left, float top, Paint paint)
public boolean isShapeClipSupported()

Inherited methods

Field details

g

public Graphics g

bounds

public Rectangle bounds

absoluteX

public int absoluteX

absoluteY

public int absoluteY

Constructor details

Canvas

public Canvas()

Method details

getClipBounds

public void getClipBounds(Rectangle mRect)

drawRect

public void drawRect(float left, float top, float right, float bottom, Paint paint)

drawText

public void drawText(String string, float x, float y, Paint paint)

getHeight

public int getHeight()

getWidth

public int getWidth()

drawPath

public void drawPath(Shape p, Paint paint)

drawLine

public void drawLine(float x1, float y1, float x2, float y2, Paint paint)

rotate

public void rotate(float angle, float x, float y)

scale

public void scale(float x, float y)

translate

public void translate(float x, float y)

drawCircle

public void drawCircle(float cx, float cy, float r, Paint paint)

drawArc

public void drawArc(Rectangle2D oval, float currentAngle, float sweepAngle, boolean useCenter, Paint paint)

drawArcWithGradient

public void drawArcWithGradient(Rectangle2D oval, float currentAngle, float sweepAngle, boolean useCenter, Paint paint, GradientDrawable gradient)

drawPoint

public void drawPoint(Float get, Float get0, Paint paint)

drawRoundRect

public void drawRoundRect(Rectangle2D rect, float rx, float ry, Paint mPaint)

drawBitmap

public void drawBitmap(Image img, float left, float top, Paint paint)

isShapeClipSupported

public boolean isShapeClipSupported()