title: How to make a complex object an Observable
body: <p>I have multiple JavaFX panes and canvases that reference a complex object with data they need, and I want them to redraw when the object changes.</p>
  
  <p>This would call for the object to be Observable, but which class do I use? JavaFX seems to mostly have ObservableValue subclasses, which wrap a value and allow swapping it out. I don't want to swap out the complex object, just notify the listeners when changes occur. I could do that by implementing <code>addListener</code>, but I'm sure there's a subclass that does it for me already.</p>
  
  <pre><code>class ComplexObject /* extends SomeObservableClass */ {
      public int getValue1 { complex calculations... };
      public int getValue2 { ... };
  
      public void setNewValue1(int newValue) { ... }
  }
  
  class ComplexRenderer extends Canvas implements InvalidationListener {
      private ComplexObject complexObject;
  
      public void setComplexObject(ComplexObject complexObject) {
          this.complexObject = complexObject;
          complexObject.addListener(this);
      }
  
      public void draw() { ... }
  }
  </code></pre>
  
  <p>Which class should ComplexObject extend? Is there something that maintains the list of listeners and has something like fireValueChangedEvent() so I can make it notify all listeners?</p>
  
  <p>Everything I see in JavaFX seems to be geared towards properties, which don't seem the right choice here.</p>