public Set<AttributedVertex> getAllComponentVerticesFromSelected() {
		Set<AttributedVertex> componentVertices = new HashSet<>(viewer.getSelectedVertices());
		Set<AttributedVertex> downstream = getAllDownstreamVerticesFromSelected();
		Set<AttributedVertex> upstream = getAllUpstreamVerticesFromSelected();
		while (!downstream.isEmpty() || !upstream.isEmpty()) {
			componentVertices.addAll(downstream);
			componentVertices.addAll(upstream);
			downstream = getAllDownstreamVerticesFromSelected();
			upstream = getAllUpstreamVerticesFromSelected();
		}
		return componentVertices;
	}
Gather all source and target vertices until there are no more available.
@return all the vertices in the component(s) of the selected vertices
Ghidra/Features/GraphServices/src/main/java/ghidra/graph/visualization/DefaultGraphDisplay.java