private void doTraverse() {

        myFile = doRead();
        if (myFile == null){
            return;
        }

        final In in = new In(myFile);

        String name = myFile.getName();
        showMessage("processing "+name);

        String inputSource = JOptionPane.showInputDialog(this,
                "Enter source vertex ", "0");

        int sourceVertex;

        try {
            sourceVertex = Integer.parseInt(inputSource);
        } catch (NumberFormatException e) {
            MainViewer.this.showError("Caught exception!\n "+e);
            return;
        }

        //MainViewer.this.showMessage("sourceVertex: "+ sourceVertex +" ");

        String path = null;
        try {
            path = myFile.getCanonicalPath();
        } catch (IOException e) {
            showError("trouble with file canonicalizing");
            return;
        }

        try {
            if (dfs) {
                myModel.DFS(in, sourceVertex);
            } else {
                myModel.BFS(in, sourceVertex);
            }
        } catch (Exception e) {
            MainViewer.this.showError("Caught exception!\n "+e);
            //e.printStackTrace();
            return;
        }

        myFile = null;
    }