Example usage for android.graphics Path lineTo

List of usage examples for android.graphics Path lineTo

Introduction

In this page you can find the example usage for android.graphics Path lineTo.

Prototype

public void lineTo(float x, float y) 

Source Link

Document

Add a line from the last point to the specified point (x,y).

Usage

From source file:Main.java

public static Path createRightArrowPath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX, aY);/* w ww  . j  ava  2 s  .c om*/
    path.lineTo(aX + aWidth, aY + (aHeight >> 1));
    path.lineTo(aX, aY + aHeight);

    return path;
}

From source file:Main.java

public static Path createDownArrowPath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX, aY);/*from w  w w. j  ava  2s  .c  om*/
    path.lineTo(aX + (aWidth >> 1), aY + aHeight);
    path.lineTo(aX + aWidth, aY);

    return path;
}

From source file:Main.java

public static Path createDownTrianglePath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX, aY);//from w  w w  .  j a  va 2 s  .  c om
    path.lineTo(aX + aWidth, aY);
    path.lineTo(aX + (aWidth >> 1), aY + aHeight);
    path.close();

    return path;
}

From source file:Main.java

public static Path createLeftArrowPath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX + aWidth, aY);//from   w  w  w  . ja va  2s . c  o m
    path.lineTo(aX, aY + (aHeight >> 1));
    path.lineTo(aX + aWidth, aY + aHeight);

    return path;
}

From source file:Main.java

public static Path createUpTrianglePath(int aX, int aY, int aWidth, int aHeight) {
    Path path = new Path();

    path.moveTo(aX, aY + aHeight);//  w  w  w. j av a 2s .  com
    path.lineTo(aX + (aWidth >> 1), aY);
    path.lineTo(aX + aWidth, aY + aHeight);
    path.close();

    return path;
}

From source file:Main.java

private static void arcLineTo(Path pathForTurn, double angle, float cx, float cy, float radius) {
    pathForTurn.lineTo(getProjX(angle, cx, cy, radius), getProjY(angle, cx, cy, radius));
}

From source file:Main.java

private static Path drawPaddingLeft() {
    //Draw the padding Left
    Path paddingLeft = new Path();
    paddingLeft.moveTo(coord_A[0], coord_A[1]); /*A*/
    paddingLeft.lineTo(coord_B[0], coord_B[1]); /*B*/
    paddingLeft.lineTo(coord_C[0], coord_C[1]); /*C*/
    paddingLeft.lineTo(coord_D[0], coord_D[1]); /*D*/
    paddingLeft.lineTo(coord_E[0], coord_E[1]); /*E*/
    paddingLeft.lineTo(coord_F[0], coord_F[1]); /*F*/
    paddingLeft.close();/*from ww w  . jav a2s.c o  m*/

    return paddingLeft;
}

From source file:Main.java

/**
 * Helper method to draw a generic triangle onto the canvas
 * @param canvas the canvas being drawn to
 * @param a point 1/*from  w  ww .  j av a 2s.  co  m*/
 * @param b point 2
 * @param c point 3
 */
public static void drawTriangle(Canvas canvas, Point a, Point b, Point c, Paint paint) {

    Path path = new Path();
    path.setFillType(Path.FillType.EVEN_ODD);
    path.moveTo(b.x, b.y);
    path.lineTo(c.x, c.y);
    path.lineTo(a.x, a.y);
    path.close();

    canvas.drawPath(path, paint);
}

From source file:Main.java

private static Path drawPaddingRight() {
    //Draw the padding Right
    Path paddingRight = new Path();
    paddingRight.moveTo(coord_A[0], coord_A[1]); /*A*/
    paddingRight.lineTo(coord_F[0], coord_F[1]); /*F*/
    paddingRight.lineTo(coord_G[0], coord_G[1]); /*G*/
    paddingRight.lineTo(coord_H[0], coord_H[1]); /*H*/
    paddingRight.lineTo(coord_I[0], coord_I[1]); /*I*/
    paddingRight.lineTo(coord_J[0], coord_J[1]); /*J*/
    paddingRight.close();//from ww  w. j a va2s.c  o m

    return paddingRight;
}

From source file:Main.java

private static Path drawPadding() {
    //Draw the padding
    Path padding = new Path();
    padding.moveTo(coord_A[2], coord_A[3]); /*A*/
    padding.lineTo(coord_B[2], coord_B[3]); /*B*/
    padding.lineTo(coord_C[2], coord_C[3]); /*C*/
    padding.lineTo(coord_D[2], coord_D[3]); /*D*/
    padding.lineTo(coord_E[2], coord_E[3]); /*E*/
    padding.lineTo(coord_F[2], coord_F[3]); /*F*/
    padding.lineTo(coord_G[2], coord_G[3]); /*G*/
    padding.lineTo(coord_H[2], coord_H[3]); /*H*/
    padding.lineTo(coord_I[2], coord_I[3]); /*I*/
    padding.lineTo(coord_J[2], coord_J[3]); /*J*/
    padding.close();/*from   ww  w . java  2 s .  co  m*/

    return padding;
}