Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.graphics.Path;

public class Main {
    /**
     * Coordinates of the Star
        
          A
         / \
        /   \
     C-----B     J-----I
       \             /
     D         H
    /     F     \
       /   /     \   \
      E               G
        
     * */
    //coord_POINT [coordOut_X, coordOut_Y, coordIn_X, coordIn_Y]
    private static float[] coord_A = new float[4];
    private static float[] coord_B = new float[4];
    private static float[] coord_C = new float[4];
    private static float[] coord_D = new float[4];
    private static float[] coord_E = new float[4];
    private static float[] coord_F = new float[4];
    private static float[] coord_G = new float[4];
    private static float[] coord_H = new float[4];
    private static float[] coord_I = new float[4];
    private static float[] coord_J = new float[4];

    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();

        return padding;
    }
}