org.wcb.autohome.implementations
Class RunEvent

java.lang.Object
  extended byorg.wcb.autohome.implementations.RunEvent
All Implemented Interfaces:
IRunEvent, java.io.Serializable

public class RunEvent
extends java.lang.Object
implements IRunEvent, java.io.Serializable

Copyright (C) 1999 Walter Bogaardt This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 Project: Alice X10 Home Automation Filename: $Id: RunEvent.java,v 1.9 2004/02/28 00:21:49 wbogaardt Exp $
Abstract: This is a Run event which should be executed when a monitored event detects activity. The run event can be firing off a x10 module or runing an application program. $Log: RunEvent.java,v $ Revision 1.9 2004/02/28 00:21:49 wbogaardt fixed formating to be compliant with sun coding convention Revision 1.8 2004/02/24 23:16:19 wbogaardt fixed formating to be compliant with checkstyles Revision 1.7 2004/02/06 20:06:36 wbogaardt replaced ampm drop boxes with time buttons which launch a time panel move menu items around on main panel Revision 1.6 2004/01/31 07:40:26 wbogaardt modified layout managers for the panel so that it uses the java standard layoutsrather than the FormLayout api. The purpose is to reduce dependency on non-standard layout api. Revision 1.5 2004/01/20 05:31:05 wbogaardt added speech event for runing Revision 1.4 2004/01/19 22:35:37 wbogaardt added fixes to runing events and emails so they work and added a testing of a monitored event through the table popup on a right mouse click. Revision 1.3 2004/01/18 00:48:33 wbogaardt refactored out unnecessary code and now have a functional initial design of monitoring panel Revision 1.2 2004/01/17 07:21:17 wbogaardt added serialization to run events and allow monitoring of these events to the file system to reload later Revision 1.1 2004/01/17 06:21:55 wbogaardt added new Run event interfaces

See Also:
Serialized Form

Field Summary
static int RUN_APPLICATION
          The run an application constant
static int RUN_MODULE
          The run an X10 event or module constant
static int SEND_EMAIL
          The send email constants
static int SPEAK_COMMAND
          The speak text constant
 
Constructor Summary
RunEvent()
          This constructor automatically runs a set of events
RunEvent(int iT, IX10Module mod, int iAction)
          The Constructor takes a run type see setRunType() method the X10Module interface, and the action to take place.
 
Method Summary
 java.lang.String[] getArguments()
          Returns the argument parameters sent with the application name sometimes an application does not have command line parameters and that should be ok too.
 java.lang.String getCommand()
          Returns the initial command to sent through the command line this is usually the application name.
 int getModuleCommand()
          Return the module command can be one of the following from the X10DeviceConstants, which is an on event or off event; X10DeviceConstants.ON_ACTION or X10DeviceConstants.OFF_ACTION
 int getRunType()
          Returns the run type for this action Should be only three types Either execute a module, execute sending email, or running an outside application; 0 send email, 1 run module, 2 run command
 java.lang.String getSentence()
          Returns the sentence that the user want's the speech engine to speak.
 IX10Module getX10Module()
          Returns the x10 module to run only if the Run type is a value of 0.
 void setArguments(java.lang.String[] args)
          The argument parameters sent with the application name sometimes an application does not have command line parameters and that should be ok too.
 void setCommand(java.lang.String sCmd)
          This is the initial command to send through the command line this is usually the application name.
 void setModuleCommand(int iCmd)
          The module command can be one of the following from the X10DeviceConstants, which is an on event or off event; X10DeviceConstants.ON_ACTION or X10DeviceConstants.OFF_ACTION
 void setRunType(int iT)
          Sets the run type for this action.
 void setSentence(java.lang.String sSentence)
          This saves a string of a sentence that the user wants spoken by the alice speech engine.
 void setX10Module(IX10Module module)
          the x10 module to run only if the Run type is a value of 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SEND_EMAIL

public static final int SEND_EMAIL
The send email constants

See Also:
Constant Field Values

RUN_APPLICATION

public static final int RUN_APPLICATION
The run an application constant

See Also:
Constant Field Values

SPEAK_COMMAND

public static final int SPEAK_COMMAND
The speak text constant

See Also:
Constant Field Values

RUN_MODULE

public static final int RUN_MODULE
The run an X10 event or module constant

See Also:
Constant Field Values
Constructor Detail

RunEvent

public RunEvent()
This constructor automatically runs a set of events


RunEvent

public RunEvent(int iT,
                IX10Module mod,
                int iAction)
The Constructor takes a run type see setRunType() method the X10Module interface, and the action to take place.

Parameters:
iT - The Run type valid valies 0-2
mod - IX10Module interface
iAction - Action type for the X10Module either ON or off
Method Detail

setRunType

public void setRunType(int iT)
Sets the run type for this action. There should be only three types execute a module, execute sending email, or running an outside application. 0 send email, 1 run module, 2 run command

Specified by:
setRunType in interface IRunEvent
Parameters:
iT - Valid values of 0-2

setX10Module

public void setX10Module(IX10Module module)
the x10 module to run only if the Run type is a value of 0. Otherwise the default is sent which is a blank X10Module Object.

Specified by:
setX10Module in interface IRunEvent
Parameters:
module - The X10 device module to run.

setModuleCommand

public void setModuleCommand(int iCmd)
The module command can be one of the following from the X10DeviceConstants, which is an on event or off event; X10DeviceConstants.ON_ACTION or X10DeviceConstants.OFF_ACTION

Specified by:
setModuleCommand in interface IRunEvent
Parameters:
iCmd - Either on or off command value 1 or 0

setCommand

public void setCommand(java.lang.String sCmd)
This is the initial command to send through the command line this is usually the application name.

Specified by:
setCommand in interface IRunEvent
Parameters:
sCmd - The application name.

setArguments

public void setArguments(java.lang.String[] args)
The argument parameters sent with the application name sometimes an application does not have command line parameters and that should be ok too.

Specified by:
setArguments in interface IRunEvent
Parameters:
args - String array of arguments for a command line execution

setSentence

public void setSentence(java.lang.String sSentence)
This saves a string of a sentence that the user wants spoken by the alice speech engine.

Specified by:
setSentence in interface IRunEvent
Parameters:
sSentence - Sentence to speak

getRunType

public int getRunType()
Returns the run type for this action Should be only three types Either execute a module, execute sending email, or running an outside application; 0 send email, 1 run module, 2 run command

Specified by:
getRunType in interface IRunEvent
Returns:
Valid values of 0-2

getX10Module

public IX10Module getX10Module()
Returns the x10 module to run only if the Run type is a value of 0. Otherwise the default is sent which is a blank X10Module Object.

Specified by:
getX10Module in interface IRunEvent
Returns:
The X10 device module to run.

getModuleCommand

public int getModuleCommand()
Return the module command can be one of the following from the X10DeviceConstants, which is an on event or off event; X10DeviceConstants.ON_ACTION or X10DeviceConstants.OFF_ACTION

Specified by:
getModuleCommand in interface IRunEvent
Returns:
Either on or off command value 1 or 0

getCommand

public java.lang.String getCommand()
Returns the initial command to sent through the command line this is usually the application name.

Specified by:
getCommand in interface IRunEvent
Returns:
The application name.

getArguments

public java.lang.String[] getArguments()
Returns the argument parameters sent with the application name sometimes an application does not have command line parameters and that should be ok too.

Specified by:
getArguments in interface IRunEvent
Returns:
String array of arguments for a command line execution

getSentence

public java.lang.String getSentence()
Returns the sentence that the user want's the speech engine to speak.

Specified by:
getSentence in interface IRunEvent
Returns:
Sentence to speak.


Copyright © 1999-2004 Walter Bogaardt. All Rights Reserved.