private Vertex findSingleVertex() { Vertex vertex = selection.getAnyVertex(); // if there is no selection we select an existing vertex if (vertex == null) { vertex = (Vertex) graph.getVertices().next(); } return vertex; }
/** Select all graph vertices. */ private void selectAll() { for (Iterator<? extends Vertex> i = graph.getVertices(); i.hasNext(); ) { selection.add(i.next()); } }