Class WeakBindableModel

  • All Implemented Interfaces:
    BindableModel

    public class WeakBindableModel
    extends java.lang.Object
    implements BindableModel

    Superclass for BindableModel instances, this class handles the binding tasks for subclassed models.

    Basic theory of operation: TODO

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void bind​(Binding binding)
      Binds this model to some component with a Binding object.
      void bindStrongly​(Binding binding)
      Binds this model to a Binding using strong references.
      <T extends java.lang.Enum<T> & ModelUpdate>
      void
      modelUpdated​(java.lang.Object oldValue, java.lang.Object newValue, T... changed)
      Fires a model update if the old and new values are different.
      <T extends java.lang.Enum<T> & ModelUpdate>
      void
      modelUpdated​(T... changed)
      Alert the bindings that the model has updated with the specified change types.
      void unbind​(Binding binding)
      Removes the passed binding from this model.
      void unbindAll()
      Unbinds both weak and strong Binding from this Model.
      void update()
      Called by the implementing Model to notify all listeners that data in the Model has changed.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WeakBindableModel

        public WeakBindableModel()
    • Method Detail

      • bind

        public void bind​(Binding binding)
        Binds this model to some component with a Binding object. This method is called by the various WiringHarness objects to bind individual components to this model.
        Specified by:
        bind in interface BindableModel
      • bindStrongly

        public void bindStrongly​(Binding binding)
        Binds this model to a Binding using strong references.
      • modelUpdated

        public <T extends java.lang.Enum<T> & ModelUpdate> void modelUpdated​(T... changed)
        Alert the bindings that the model has updated with the specified change types.
        Specified by:
        modelUpdated in interface BindableModel
        Parameters:
        changed - list of change types to indicate
      • modelUpdated

        public <T extends java.lang.Enum<T> & ModelUpdate> void modelUpdated​(java.lang.Object oldValue,
                                                                             java.lang.Object newValue,
                                                                             T... changed)
        Fires a model update if the old and new values are different.
        Type Parameters:
        T - A varargs list of enumerated ModelUpdate types.
        Parameters:
        oldValue - original value to be compared
        newValue - new value to compare against
      • update

        public void update()
        Called by the implementing Model to notify all listeners that data in the Model has changed.
      • unbind

        public void unbind​(Binding binding)
        Removes the passed binding from this model.
        Specified by:
        unbind in interface BindableModel