Class AbstractGenericController<M,​V>

  • Type Parameters:
    M - the generic type of the model
    V - the generic type of the view
    All Implemented Interfaces:
    Controller<M,​V>, java.awt.event.ActionListener, java.util.EventListener
    Direct Known Subclasses:
    KeypadController, LoginController

    public abstract class AbstractGenericController<M,​V>
    extends java.lang.Object
    implements Controller<M,​V>, java.awt.event.ActionListener
    The class AbstractGenericController.
    • Constructor Detail

      • AbstractGenericController

        public AbstractGenericController()
        Instantiates a new abstract generic controller.
    • Method Detail

      • actionPerformed

        public void actionPerformed​(java.awt.event.ActionEvent event)
        (non-Javadoc).
        Specified by:
        actionPerformed in interface java.awt.event.ActionListener
        Parameters:
        event - the event
        See Also:
        ActionListener.actionPerformed(java.awt.event.ActionEvent)
      • getChild

        public Controller<M,​V> getChild​(java.lang.String key)
        (non-Javadoc).
        Specified by:
        getChild in interface Controller<M,​V>
        Parameters:
        key - the key
        Returns:
        the child
      • getChildren

        public java.util.Map<java.lang.String,​Controller<M,​V>> getChildren()
        (non-Javadoc).
        Specified by:
        getChildren in interface Controller<M,​V>
        Returns:
        the children
      • getModel

        public M getModel()
        (non-Javadoc).
        Specified by:
        getModel in interface Controller<M,​V>
        Returns:
        the model
      • getName

        public java.lang.String getName()
        Description copied from interface: Controller
        Gets the name from the Controller.
        Specified by:
        getName in interface Controller<M,​V>
        Returns:
        the name from the Controller.
      • getView

        public V getView()
        (non-Javadoc).
        Specified by:
        getView in interface Controller<M,​V>
        Returns:
        the view
      • hasChild

        public boolean hasChild​(Controller<M,​V> controller)
        (non-Javadoc).
        Specified by:
        hasChild in interface Controller<M,​V>
        Parameters:
        controller - the controller
        Returns:
        true, if successful
      • hasChild

        public boolean hasChild​(java.lang.String key)
        (non-Javadoc).
        Specified by:
        hasChild in interface Controller<M,​V>
        Parameters:
        key - the key
        Returns:
        true, if successful
      • initialize

        protected void initialize()
        Initialize.
      • postinitialize

        protected void postinitialize()
        Postinitialize.
      • preinitialize

        protected void preinitialize()
        Preinitialize.
      • process

        public abstract void process​(java.awt.event.ActionEvent event)
        Process.
        Specified by:
        process in interface Controller<M,​V>
        Parameters:
        event - the event
      • removeChild

        public Controller<M,​V> removeChild​(java.lang.String key)
        (non-Javadoc).
        Specified by:
        removeChild in interface Controller<M,​V>
        Parameters:
        key - the key
        Returns:
        the controller
      • setChild

        public java.lang.Object setChild​(java.lang.String key,
                                         Controller<M,​V> controller)
        (non-Javadoc).
        Specified by:
        setChild in interface Controller<M,​V>
        Parameters:
        key - the key
        controller - the controller
        Returns:
        the object
      • setModel

        public void setModel​(M model)
        (non-Javadoc).
        Specified by:
        setModel in interface Controller<M,​V>
        Parameters:
        model - the model
      • setParent

        public void setParent​(Controller<M,​V> controller)
        (non-Javadoc).
        Specified by:
        setParent in interface Controller<M,​V>
        Parameters:
        controller - the controller
      • setView

        public void setView​(V view)
        (non-Javadoc).
        Specified by:
        setView in interface Controller<M,​V>
        Parameters:
        view - the view