sky.monome
Class Group


java.lang.Object

  extended by sky.monome.Component

      extended by sky.monome.Container

          extended by sky.monome.AbstractGroup<Component>

              extended by sky.monome.Group

Direct Known Subclasses:
Monome, Page

public class Group
extends AbstractGroup<Component>

Group of components.

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
Group(java.lang.String name, Container container, int x, int y, int width, int height)
          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.
Group(java.lang.String name, int x, int y, int width, int height)
          Constructs a group with the specified name, specified coordinates and dimensions.
 
Method Summary
 void addComponent(Component component)
          Adds the specified component to the list of contained components.
 Component[] getComponents()
          Returns an array of contained components.
 void removeComponent(Component component)
          Removes the specified component from the list of contained components.
 void removeComponents()
          Removes all components from the list of contained components.
 java.lang.String toString()
          Returns a string representation of this 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

Group


@Deprecated

public Group(java.lang.String name,

                        Container container,

                        int x,

                        int y,

                        int width,

                        int height)
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 group with the specified name, specified coordinates and dimensions, and contained by the specified container.

Parameters:
name - Name of this group.
container - Container that contains this group.
x - X-coordinate of this group in the local context of its container.
y - Y-coordinate of this group in the local context of its container.
width - Width of this group.
height - Height of this group.

Group


public Group(java.lang.String name,

             int x,

             int y,

             int width,

             int height)
Constructs a group with the specified name, specified coordinates and dimensions.

Parameters:
name - Name of this group.
x - X-coordinate of this group in the local context of its container.
y - Y-coordinate of this group in the local context of its container.
width - Width of this group.
height - Height of this group.
Since:
SkyMonome v1.2
Method Detail

getComponents


public Component[] getComponents()
Returns an array of contained components.

Returns:
An array of contained components.

addComponent


public void addComponent(Component component)

                  throws MonomeException
Adds the specified component to the list of contained components.

Parameters:
component - Component to add to the list of contained components.
Throws:
MonomeException - When the bounds of the specified component intersects with a previously added component, or when the specified component can't have parent container.

removeComponent


public void removeComponent(Component component)
Removes the specified component from the list of contained components.

Parameters:
component - Component to remove from the list of contained components.

removeComponents


public void removeComponents()
Removes all components from the list of contained components.


toString


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

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