Package observer

Class DrawingObserver

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

    public class DrawingObserver
    extends java.lang.Object
    implements java.beans.PropertyChangeListener
    • Field Summary

      Fields 
      Modifier and Type Field Description
      (package private) DrawingFrame frame  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addListener​(javax.swing.JButton button, java.awt.event.MouseAdapter adapter)
      Method that add listener to some button and enable it.
      void propertyChange​(java.beans.PropertyChangeEvent evt)
      Listen to changes from DrawingModel that sends Subject - DrawingController to update buttons depend on state of draw in DrawingFrame.
      void removeListener​(javax.swing.JButton button, java.awt.event.MouseAdapter adapter)
      Method that remove listener from some button and disable it.
      • Methods inherited from class java.lang.Object

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

      • DrawingObserver

        public DrawingObserver​(DrawingFrame frame)
    • Method Detail

      • addListener

        public void addListener​(javax.swing.JButton button,
                                java.awt.event.MouseAdapter adapter)
        Method that add listener to some button and enable it.
        Parameters:
        button - Represent button which need to be updated.
        adapter - Represent adapter for that button.
      • removeListener

        public void removeListener​(javax.swing.JButton button,
                                   java.awt.event.MouseAdapter adapter)
        Method that remove listener from some button and disable it.
        Parameters:
        button - Represent button which need to be updated.
        adapter - Represent adapter for that button.
      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        Listen to changes from DrawingModel that sends Subject - DrawingController to update buttons depend on state of draw in DrawingFrame.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener