Class AbstractModel

    • Constructor Summary

      Constructors 
      Constructor Description
      AbstractModel()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected <T> void addItemToList​(T item, java.util.List<T> list, java.lang.Enum<?> addEvent)
      Helper method to add an Item to a List.
      void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Adds a PropertyChangeListener to this model element.
      protected <T> void changeField​(T oldValue, T newValue, java.lang.Enum<?> changeEvent)
      Helper method to change a field.
      void firePropertyChange​(java.lang.String property, java.lang.Object oldValue, java.lang.Object newValue)
      Fires a property change event.
      int getX()
      Obtains the X co-ordinate for the model.
      int getY()
      Obtains the Y co-ordinate for the model.
      protected <T> void removeItemFromList​(T item, java.util.List<T> list, java.lang.Enum<?> removeEvent)
      Helper method to remove an Item from a List.
      void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Removes a PropertyChangeListener from this model element.
      void setX​(int x)
      Specifies the X co-ordinate for the model.
      void setY​(int y)
      Specifies the Y co-ordinate for the model.
      • Methods inherited from class java.lang.Object

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

      • AbstractModel

        public AbstractModel()
    • Method Detail

      • firePropertyChange

        public void firePropertyChange​(java.lang.String property,
                                       java.lang.Object oldValue,
                                       java.lang.Object newValue)
        Fires a property change event.
        Parameters:
        property - Property related to the event.
        oldValue - Old value of property.
        newValue - New value of property.
      • addItemToList

        protected <T> void addItemToList​(T item,
                                         java.util.List<T> list,
                                         java.lang.Enum<?> addEvent)
        Helper method to add an Item to a List.
        Type Parameters:
        T - Item type.
        Parameters:
        item - Item to add to list.
        list - List to have item to add.
        addEvent - Event to fire on item being added.
      • removeItemFromList

        protected <T> void removeItemFromList​(T item,
                                              java.util.List<T> list,
                                              java.lang.Enum<?> removeEvent)
        Helper method to remove an Item from a List.
        Type Parameters:
        T - Item type.
        Parameters:
        item - Item to remove from list.
        list - List to have item removed.
        removeEvent - Event to fire on item being removed.
      • changeField

        protected <T> void changeField​(T oldValue,
                                       T newValue,
                                       java.lang.Enum<?> changeEvent)
        Helper method to change a field.
        Type Parameters:
        T - Value type.
        Parameters:
        oldValue - Old value of field.
        newValue - New value of field.
        changeEvent - Event to fire if field is being changed.
      • getX

        public int getX()
        Description copied from interface: Model
        Obtains the X co-ordinate for the model.
        Specified by:
        getX in interface Model
        Returns:
        X co-ordinate for the model.
      • setX

        public void setX​(int x)
        Description copied from interface: Model
        Specifies the X co-ordinate for the model.
        Specified by:
        setX in interface Model
        Parameters:
        x - X co-ordinate for the model.
      • getY

        public int getY()
        Description copied from interface: Model
        Obtains the Y co-ordinate for the model.
        Specified by:
        getY in interface Model
        Returns:
        Y co-ordinate for the model.
      • setY

        public void setY​(int y)
        Description copied from interface: Model
        Specifies the Y co-ordinate for the model.
        Specified by:
        setY in interface Model
        Parameters:
        y - Y co-ordinate for the model.
      • addPropertyChangeListener

        public void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Description copied from interface: Model
        Adds a PropertyChangeListener to this model element.
        Specified by:
        addPropertyChangeListener in interface Model
        Parameters:
        listener - PropertyChangeListener to this model element.
      • removePropertyChangeListener

        public void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Description copied from interface: Model
        Removes a PropertyChangeListener from this model element.
        Specified by:
        removePropertyChangeListener in interface Model
        Parameters:
        listener - PropertyChangeListener.