001        package com.croftsoft.apps.neuro;
002         
003        import com.croftsoft.core.lang.NullArgumentException;
004         
005        /***********************************************************************
006        * Neuro enumerated type message.
007        * 
008        * Use to pass messages between the model, view, and controller.
009        * 
010        * @version
011        *   $Id: NeuroMessage.java,v 1.4 2008/08/30 01:37:30 croft Exp $
012        * @since
013        *   2008-08-17
014        * @author
015        *   <a href="https://www.croftsoft.com/">David Wallace Croft</a>
016        ***********************************************************************/
017    
018        public final class  NeuroMessage
019        ////////////////////////////////////////////////////////////////////////
020        ////////////////////////////////////////////////////////////////////////
021        {
022           
023        public static final NeuroMessage
024          TOGGLE_CHANNEL_REQUEST_INSTANCE
025            = new NeuroMessage ( Type.TOGGLE_CHANNEL_REQUEST ),
026          TOGGLE_FRAME_RATE_REQUEST_INSTANCE
027            = new NeuroMessage ( Type.TOGGLE_FRAME_RATE_REQUEST ),
028          TOGGLE_PAUSE_REQUEST_INSTANCE
029            = new NeuroMessage ( Type.TOGGLE_PAUSE_REQUEST );
030         
031        //
032         
033        public enum  Type
034        {
035          TOGGLE_CHANNEL_REQUEST,
036          TOGGLE_FRAME_RATE_REQUEST,
037          TOGGLE_PAUSE_REQUEST
038        }
039         
040        //
041           
042        private final Type    type;
043         
044        private final Object  content;
045         
046        ////////////////////////////////////////////////////////////////////////
047        ////////////////////////////////////////////////////////////////////////
048         
049        public  NeuroMessage (
050          final Type    type,
051          final Object  content )
052        ////////////////////////////////////////////////////////////////////////
053        {
054          NullArgumentException.check ( this.type = type );
055           
056          this.content = content;
057        }
058         
059        public  NeuroMessage ( final Type  type )
060        ////////////////////////////////////////////////////////////////////////
061        {
062          this ( type, null );
063        }
064         
065        ////////////////////////////////////////////////////////////////////////
066        ////////////////////////////////////////////////////////////////////////
067         
068        public Type    getType    ( ) { return type;    }
069         
070        public Object  getContent ( ) { return content; }
071         
072        ////////////////////////////////////////////////////////////////////////
073        ////////////////////////////////////////////////////////////////////////
074        }