private void drawGrid(Graphics g,Point2D mPos){      
        
        if(alwaysDrawPlaneOnCenter){
            int localScreenShiftX = (int)(mPos.getX()*pixcelsPerGrid/meterPerGrid);
            int localScreenShiftY = (int)(mPos.getY()*pixcelsPerGrid/meterPerGrid);
            
            g.setColor(Color.BLACK);
            g.drawLine(0, localScreenShiftY, screenWidth, localScreenShiftY);
            g.drawLine(localScreenShiftX , 0, localScreenShiftX, screenHeight);

            g.setColor(Color.lightGray);

            for (int i = localScreenShiftX+pixcelsPerGrid; i < screenWidth; i+=pixcelsPerGrid) {
                //tate right side
                g.drawLine(i, 0, i, screenHeight);
            }
            for (int i = localScreenShiftX-pixcelsPerGrid; 0 < i ; i-=pixcelsPerGrid) {
                //tate right side
                g.drawLine(i, 0, i, screenHeight);
            }
            for (int i = localScreenShiftY+pixcelsPerGrid; i < screenHeight; i+=pixcelsPerGrid) {
                //yoko down side
                g.drawLine(0, i, screenWidth, i);
            }
            for (int i = localScreenShiftY-pixcelsPerGrid; 0 < i ; i-=pixcelsPerGrid) {
                //yoko up side
                g.drawLine(0, i, screenWidth, i);
            }
        }else{
            g.setColor(Color.BLACK);
            g.drawLine(0, screenShiftY, screenWidth, screenShiftY);
            g.drawLine(screenShiftX , 0, screenShiftX, screenHeight);

            g.setColor(Color.lightGray);

            for (int i = screenShiftX+pixcelsPerGrid; i < screenWidth; i+=pixcelsPerGrid) {
                //tate right side
                g.drawLine(i, 0, i, screenHeight);
            }
            for (int i = screenShiftX-pixcelsPerGrid; 0 < i ; i-=pixcelsPerGrid) {
                //tate right side
                g.drawLine(i, 0, i, screenHeight);
            }
            for (int i = screenShiftY+pixcelsPerGrid; i < screenHeight; i+=pixcelsPerGrid) {
                //yoko down side
                g.drawLine(0, i, screenWidth, i);
            }
            for (int i = screenShiftY-pixcelsPerGrid; 0 < i ; i-=pixcelsPerGrid) {
                //yoko up side
                g.drawLine(0, i, screenWidth, i);
            }
        }
    }