public Color chooseColorByPoint(Vertex vertex)
    {
        if (vertex == vertices.endA)
            return Color.MAGENTA;
        if (vertex == vertices.endB)
            return Color.red;
        if (vertex == draggedFromVertex)
            return Color.orange;
        if (vertex == draggedToVertex)
            return Color.green;
        if (vertex.isVertex())
            return Color.BLACK;
        return Color.gray;
    }