/**
  * Base constructor for invocation by the subclasses. Subclass implementations should make sure
  * that this constructor can be invoked outside of the JavaFX thread.
  *
  * @param c the editor controller (should not be null).
  */
 protected AbstractPanelController(EditorController c) {
   assert c != null;
   this.editorController = c;
   startListeningToEditorSelection();
   startListeningToJobManagerRevision();
   editorController
       .fxomDocumentProperty()
       .addListener(
           new ChangeListener<FXOMDocument>() {
             @Override
             public void changed(
                 ObservableValue<? extends FXOMDocument> ov, FXOMDocument od, FXOMDocument nd) {
               assert editorController.getFxomDocument() == nd;
               if (od != null) {
                 od.sceneGraphRevisionProperty().removeListener(fxomDocumentRevisionListener);
               }
               fxomDocumentDidChange(od);
               if (nd != null) {
                 nd.sceneGraphRevisionProperty().addListener(fxomDocumentRevisionListener);
               }
             }
           });
   if (editorController.getFxomDocument() != null) {
     editorController
         .getFxomDocument()
         .sceneGraphRevisionProperty()
         .addListener(fxomDocumentRevisionListener);
   }
 }