/**
   * Returns a list of all the SessionNodeWrappers (TetradNodes) and SessionNodeEdges that are model
   * components for the respective SessionNodes and SessionEdges selected in the workbench. Note
   * that the workbench, not the SessionEditorNodes themselves, keeps track of the selection.
   *
   * @return the set of selected model nodes.
   */
  public java.util.List getSelectedModelComponents() {
    java.util.List<Component> selectedComponents = workbench.getSelectedComponents();
    java.util.List<TetradSerializable> selectedModelComponents =
        new ArrayList<TetradSerializable>();

    for (Component comp : selectedComponents) {
      if (comp instanceof DisplayNode) {
        selectedModelComponents.add(((DisplayNode) comp).getModelNode());
      } else if (comp instanceof DisplayEdge) {
        selectedModelComponents.add(((DisplayEdge) comp).getModelEdge());
      }
    }

    return selectedModelComponents;
  }