public void paint(Graphics g) {
        // System.out.println("坐标原点：" + oPoint.x + " ， " + oPoint.y);
        //画边框
        g.setColor(Color.BLACK);
        g.draw3DRect(leftPoint.x, upPoint.y, MainFrame.spanX*2 , MainFrame.spanY*2, true);

        //画坐标轴
        g.drawString("X", rightPoint.x + 10, rightPoint.y + 10);
        g.drawLine(leftPoint.x, leftPoint.y, rightPoint.x, rightPoint.y);
        g.drawLine(rightPoint.x, rightPoint.y, rightPoint.x - 10, rightPoint.y + 10);
        g.drawLine(rightPoint.x, rightPoint.y, rightPoint.x - 10, rightPoint.y - 10);
        g.drawString("Y", upPoint.x + 10, upPoint.y - 10);
        g.drawLine(downPoint.x, downPoint.y, upPoint.x, upPoint.y);
        g.drawLine(upPoint.x, upPoint.y, upPoint.x - 10, upPoint.y + 10);
        g.drawLine(upPoint.x, upPoint.y, upPoint.x + 10, upPoint.y + 10);

        //画刻度
        for (int i = leftPoint.x; i <= rightPoint.x; i+=10) {
            if (i%100 == 0 && i != oPoint.x) {
                g.drawString(""+(i-oPoint.x), i - 10, leftPoint.y + 25);
                g.drawLine(i, leftPoint.y, i, leftPoint.y - 10);
            } else {
                g.drawLine(i, leftPoint.y, i, leftPoint.y - 5);
            }
        }
        for (int j = downPoint.y; j >= upPoint.y; j-=10) {
            if ((j + 50)%100 == 0 && j != oPoint.y) {
                g.drawString(""+(oPoint.y-j), downPoint.x - 25, j + 5);
                g.drawLine(downPoint.x, j, downPoint.x + 10, j);
            } else {
                g.drawLine(downPoint.x, j, downPoint.x + 5, j);
            }
        }

        //绘制结果
        if (ifDraw) {
            g.setColor(Color.RED);
            g.drawString("最短距离为：" + minDis, MainFrame.width / 2 - 100, MainFrame.panelHeight - 30);
            Iterator<PointPair> ppIterator = ppList.iterator();
            PointPair pp;
            while(ppIterator.hasNext()) {
                pp = ppIterator.next();
                g.setColor(Color.RED);
                g.drawLine(pp.a.x, pp.a.y, pp.b.x, pp.b.y);
            }
        }
    }