@Override
	public void eventSent(PluginEvent event) {
		if (Objects.equals(event.getSourceName(), name)) {
			return;
		}

		if (event instanceof ProgramClosedPluginEvent) {
			ProgramClosedPluginEvent ev = (ProgramClosedPluginEvent) event;
			if (isMyProgram(ev.getProgram())) {
				graphDisplay.close();
				dispose();
			}
		}
		else if (event instanceof ProgramLocationPluginEvent) {
			ProgramLocationPluginEvent ev = (ProgramLocationPluginEvent) event;
			if (isMyProgram(ev.getProgram())) {
				ProgramLocation location = ev.getLocation();
				AttributedVertex vertex = getVertex(location.getAddress());
				// update graph location, but tell it not to send out event
				graphDisplay.setFocusedVertex(vertex, EventTrigger.INTERNAL_ONLY);
			}
		}
		else if (event instanceof ProgramSelectionPluginEvent) {
			ProgramSelectionPluginEvent ev = (ProgramSelectionPluginEvent) event;
			if (isMyProgram(ev.getProgram())) {
				ProgramSelection selection = ev.getSelection();
				Set<AttributedVertex> selectedVertices = getVertices(selection);
				if (selectedVertices != null) {
					// since we are responding to an event, tell the GraphDisplay not to send event
					graphDisplay.selectVertices(selectedVertices, EventTrigger.INTERNAL_ONLY);
				}
			}
		}
	}
Base class for GraphDisplay listeners whose nodes represent addresses.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/graph/AddressBasedGraphDisplayListener.java