sky.monome
Class LedButtonGroup

java.lang.Object
  extended by sky.monome.Component
      extended by sky.monome.Container
          extended by sky.monome.AbstractGroup<LedButtonCouple>
              extended by sky.monome.LedButtonGroup
Direct Known Subclasses:
FrameGroup

public class LedButtonGroup
extends AbstractGroup<LedButtonCouple>

Group that contains exclusively led/button couples. The led/button couples creation is automatic. All led/button couples will have the same type of behaviors.

Author:
PJ Skyman

Field Summary
 
Fields inherited from class sky.monome.AbstractGroup
components
 
Fields inherited from class sky.monome.Container
height, width
 
Fields inherited from class sky.monome.Component
container, eventListenerList, lockObject, name, x, y
 
Constructor Summary
LedButtonGroup(java.lang.String name, Container container, int x, int y, int width, int height, BehaviorFactory behaviorFactory)
          Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.
LedButtonGroup(java.lang.String name, Container container, int x, int y, int width, int height, java.lang.Class<? extends Behavior> behaviorClass, java.lang.Object... argumentsForBehavior)
          Deprecated. Since SkyMonome v1.1, it is preferred to use the LedButtonGroup(String,Container,int,int,int,int,BehaviorFactory) constructor instead of this one.
LedButtonGroup(java.lang.String name, int x, int y, int width, int height, BehaviorFactory behaviorFactory)
          Constructs a led/button group with the specified name, specified coordinates and dimensions and the specified behavior factory.
 
Method Summary
 void addLedButtonCouple(LedButtonCouple ledButtonCouple)
          Adds the specified led/button couple to the list of contained led/button couples.
 LedButtonCouple getLedButtonCouple(int x, int y)
          Returns the led/button couple at specified local coordinates.
 LedButtonCouple[] getLedButtonCouples()
          Returns an array of all contained led/button couples.
 void removeLedButtonCouple(LedButtonCouple ledButtonCouple)
          Removes the specified led/button couple from the list of contained led/button couples.
 void removeLedButtonCouples()
          Removes all led/button couples from the list of the contained led/button couples.
 java.lang.String toString()
          Returns a string representation of this led/button group.
 
Methods inherited from class sky.monome.AbstractGroup
canHaveParentContainer, getAbsoluteX, getAbsoluteY, getBounds, getMonome, isVisible, notify, writeOn
 
Methods inherited from class sky.monome.Container
getHeight, getWidth
 
Methods inherited from class sky.monome.Component
getContainer, getLockObject, getName, getX, getY
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LedButtonGroup

@Deprecated
public LedButtonGroup(java.lang.String name,
                                 Container container,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 java.lang.Class<? extends Behavior> behaviorClass,
                                 java.lang.Object... argumentsForBehavior)
               throws MonomeException
Deprecated. Since SkyMonome v1.1, it is preferred to use the LedButtonGroup(String,Container,int,int,int,int,BehaviorFactory) constructor instead of this one.

Constructs a led/button group with the specified name, specified coordinates and dimensions, the behavior of the specified type (using specified arguments to create the behavior), and contained by the specified container.

Parameters:
name - Name of this led/button group.
container - Container that contains this led/button group.
x - X-coordinate of this led/button group in the local context of its container.
y - Y-coordinate of this led/button group in the local context of its container.
width - Width of this led/button group.
height - Height of this led/button group.
behaviorClass - Type of behavior to use when creating led/button couples.
argumentsForBehavior - Arguments to use when creating led/button couples.
Throws:
MonomeException - When led/button couple creations can't be done, for example when behavior objects can't be created.

LedButtonGroup

@Deprecated
public LedButtonGroup(java.lang.String name,
                                 Container container,
                                 int x,
                                 int y,
                                 int width,
                                 int height,
                                 BehaviorFactory behaviorFactory)
               throws MonomeException
Deprecated. Since SkyMonome v1.2, all components register themselves inside their container, so you don't need to specify the container by calling this constructor.

Constructs a led/button group with the specified name, specified coordinates and dimensions, the specified behavior factory, and contained by the specified container.

Parameters:
name - Name of this led/button group.
container - Container that contains this led/button group.
x - X-coordinate of this led/button group in the local context of its container.
y - Y-coordinate of this led/button group in the local context of its container.
width - Width of this led/button group.
height - Height of this led/button group.
behaviorFactory - Factory for behaviors that are used to create led/button couples.
Throws:
MonomeException - When led/button couple creations can't be done, for example when behavior objects can't be created.
Since:
SkyMonome v1.1

LedButtonGroup

public LedButtonGroup(java.lang.String name,
                      int x,
                      int y,
                      int width,
                      int height,
                      BehaviorFactory behaviorFactory)
               throws MonomeException
Constructs a led/button group with the specified name, specified coordinates and dimensions and the specified behavior factory.

Parameters:
name - Name of this led/button group.
x - X-coordinate of this led/button group in the local context of its container.
y - Y-coordinate of this led/button group in the local context of its container.
width - Width of this led/button group.
height - Height of this led/button group.
behaviorFactory - Factory for behaviors that are used to create led/button couples.
Throws:
MonomeException - When led/button couple creations can't be done, for example when behavior objects can't be created.
Since:
SkyMonome v1.2
Method Detail

toString

public java.lang.String toString()
Returns a string representation of this led/button group.

Specified by:
toString in class Component
Returns:
A string representation of this led/button group.

getLedButtonCouples

public LedButtonCouple[] getLedButtonCouples()
Returns an array of all contained led/button couples.

Returns:
An array of all contained led/button couples.

getLedButtonCouple

public LedButtonCouple getLedButtonCouple(int x,
                                          int y)
Returns the led/button couple at specified local coordinates.

Parameters:
x - X-coordinate of the desired led/button couple.
y - Y-coordinate of the desired led/button couple.
Returns:
The led/button couple at specified local coordinates. If these coordinates are not contained by this group, null is returned. If there's no led/button couple at specified coordinates, so null is also returned.
Since:
SkyMonome v1.3

addLedButtonCouple

public void addLedButtonCouple(LedButtonCouple ledButtonCouple)
                        throws MonomeException
Adds the specified led/button couple to the list of contained led/button couples.

Parameters:
ledButtonCouple - Led/button couple to add to the list of contained led/buton couples.
Throws:
MonomeException - When the bounds of the specified led/button couple intersects with a previously added led/button couple.

removeLedButtonCouple

public void removeLedButtonCouple(LedButtonCouple ledButtonCouple)
Removes the specified led/button couple from the list of contained led/button couples.

Parameters:
ledButtonCouple - Led/button couple to remove from the list of the contained led/button couples.

removeLedButtonCouples

public void removeLedButtonCouples()
Removes all led/button couples from the list of the contained led/button couples.