@Override
  public void onGraph2DSelectionEvent(final Graph2DSelectionEvent e) {
    // Node: Animated layout could select bends. Bends should be ignored here.
    // Bend selection should not trigger any action of the listeners.
    if (e.isBendSelection() || e.isEdgeSelection()) {
      return;
    }

    // This function is called for each single event in an
    // event sequence.

    // In this function we fire the event if all event
    // sequences finished.
    if ((sequenceCounter == 0) && fireFlag) {
      updateSelectionState(e.getGraph2D());

      // We have to make sure that this event is only
      // sent once. When the next event sequence starts
      // this flag is reset.
      fireFlag = false;
    }
  }
Adds a graph selection listener that is notified when the selection of the graph changes.

@param listener The listener to add.
java/zylib/src/main/java/com/google/security/zynamics/zylib/yfileswrap/gui/zygraph/ZyGraphSelectionObserver.java