com.jpeterson.x10.module
Class MacroElement

java.lang.Object
  |
  +--com.jpeterson.x10.module.MacroElement

public class MacroElement
extends java.lang.Object
implements java.io.Serializable

See Also:
Serialized Form

Constructor Summary
protected MacroElement()
          Provided for proper serialization.
  MacroElement(FunctionEvent function)
          Create a MacroElement for the provided FunctionEvent.
 
Method Summary
 void addDevice(int device)
          Add a device to this macro element.
 boolean getBrightenFirst()
          Determine the functions preference for brightening first before dimming.
 byte[] getBytes()
          Get the byte array representing this macro element.
 int[] getDevices()
          Retrieve an array of devices for this macro element.
 FunctionEvent getFunction()
          Get the function event for this macro element.
 void removeDevice(int device)
          Remove a device from this macro element.
 void setBrightenFirst(boolean brightenFirst)
          If this is a dim command, should the device be brought to 100% percent first before applying the dim, or just dim.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MacroElement

protected MacroElement()
Provided for proper serialization.

MacroElement

public MacroElement(FunctionEvent function)
Create a MacroElement for the provided FunctionEvent.
Method Detail

getFunction

public FunctionEvent getFunction()
Get the function event for this macro element.
Returns:
The function event for this macro element.

setBrightenFirst

public void setBrightenFirst(boolean brightenFirst)
If this is a dim command, should the device be brought to 100% percent first before applying the dim, or just dim. By default this is false.
Parameters:
brightenFirst - Set to true if the devices should be brought up to 100% before the dim is performed, false if the devices should be dimmed from their current brightness.

getBrightenFirst

public boolean getBrightenFirst()
Determine the functions preference for brightening first before dimming.
Returns:
True if the macro element will brighten the devices to 100% before applying the dim, or false if the dim is applied to the current brightness level.

addDevice

public void addDevice(int device)
Add a device to this macro element.
Parameters:
device - Device number for this macro element.
Throws:
java.lang.IllegalArgumentException - Thrown if the device number is less than 1 or greater than 16.

removeDevice

public void removeDevice(int device)
Remove a device from this macro element.
Parameters:
device - Device to be removed from this macro element.

getDevices

public int[] getDevices()
Retrieve an array of devices for this macro element.

getBytes

public byte[] getBytes()
Get the byte array representing this macro element.
Returns:
Byte array containing the macro element.