// Path: app/src/main/java/com/xd/demi/bean/Point.java
// public class Point  implements Serializable{
//     private float x ;
//     private float y ;
// 
//     public float getX() {
//         return x;
//     }
// 
//     public void setX(float x) {
//         this.x = x;
//     }
// 
//     public float getY() {
//         return y;
//     }
// 
//     public void setY(float y) {
//         this.y = y;
//     }
// 
//     public Point(float x, float y) {
//         this.x = x;
//         this.y = y;
//     }
// }


import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.xd.demi.bean.Point;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;
package com.xd.demi.view;




/**
 * Created by demi on 2017/3/14.
 */

public class NineSquareView extends View {
    private Paint pointPaint;  //画点的画笔
    private Paint linePaint; // 画线的画笔
    private Path path;     //路径
    private static int SQUAREWIDRH = 300; //默认正方形的边长
    private float mSquarewidth = SQUAREWIDRH; //每个正方形的边长 9个
    private float x, y; //手指在滑动的时候那个点的坐标
    private float  startX, startY; //手指首次接触View的那个点的坐标
// Path: app/src/main/java/com/xd/demi/bean/Point.java
// public class Point  implements Serializable{
//     private float x ;
//     private float y ;
// 
//     public float getX() {
//         return x;
//     }
// 
//     public void setX(float x) {
//         this.x = x;
//     }
// 
//     public float getY() {
//         return y;
//     }
// 
//     public void setY(float y) {
//         this.y = y;
//     }
// 
//     public Point(float x, float y) {
//         this.x = x;
//         this.y = y;
//     }
// }


// Path: app/src/main/java/com/xd/demi/view/NineSquareView.java
import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Path;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;
import com.xd.demi.bean.Point;
import java.util.Collection;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.Set;

package com.xd.demi.view;




/**
 * Created by demi on 2017/3/14.
 */

public class NineSquareView extends View {
    private Paint pointPaint;  //画点的画笔
    private Paint linePaint; // 画线的画笔
    private Path path;     //路径
    private static int SQUAREWIDRH = 300; //默认正方形的边长
    private float mSquarewidth = SQUAREWIDRH; //每个正方形的边长 9个
    private float x, y; //手指在滑动的时候那个点的坐标
    private float  startX, startY; //手指首次接触View的那个点的坐标
    private LinkedHashMap<String,Point> points = new LinkedHashMap<>(); //存放手指连接的点