sky.monome.frame
Class DefaultFrame


java.lang.Object

  extended by sky.monome.frame.DefaultFrame

All Implemented Interfaces:
Frame, SizedFrame
Direct Known Subclasses:
CharacterFrame, PictureFrame

public class DefaultFrame
extends java.lang.Object
implements SizedFrame

Sized frame in its simpliest form.

Author:
PJ Skyman

Field Summary
protected  int height
          Height of this frame.
protected  LedButtonCouple.LedState[][] matrix
          Led states matrix of this frame.
protected  int width
          Width of this frame.
 
Constructor Summary
DefaultFrame(int width, int height)
          Constructs a default frame with the specified size.
 
Method Summary
 void clear()
          Clears all led states in the matrix of this frame.
 void clear(LedButtonCouple.LedState ledState)
          Clears all led states in the matrix of this frame.
 LedButtonCouple.LedState get(int x, int y)
          Returns the led state at specified coordinates.
 int getHeight()
          Returns the height of this frame.
 int getWidth()
          Returns the width of this frame.
 void set(int x, int y, LedButtonCouple.LedState ledState)
          Modifies the led state at specified coordinates.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

width


protected final int width
Width of this frame.


height


protected final int height
Height of this frame.


matrix


protected final LedButtonCouple.LedState[][] matrix
Led states matrix of this frame.

Constructor Detail

DefaultFrame


public DefaultFrame(int width,

                    int height)
Constructs a default frame with the specified size.

Parameters:
width - Width of this frame.
height - Height of this frame.
Method Detail

get


public LedButtonCouple.LedState get(int x,

                                    int y)
Returns the led state at specified coordinates.

Specified by:
get in interface Frame
Parameters:
x - X-coordinate of the led state needed.
y - Y-coordinate of the led state needed.
Returns:
The led state at specified coordinates.

set


public void set(int x,

                int y,

                LedButtonCouple.LedState ledState)
Modifies the led state at specified coordinates.

Specified by:
set in interface Frame
Parameters:
x - X-coordinate of the led state to be modified.
y - Y-coordinate of the led state to be modified.
ledState - New led state to affect at specified coordinate.

clear


public void clear()
Clears all led states in the matrix of this frame. The default value LedState.OFF is affected.


clear


public void clear(LedButtonCouple.LedState ledState)
Clears all led states in the matrix of this frame.

Parameters:
ledState - Led state to affect.

getWidth


public int getWidth()
Returns the width of this frame.

Specified by:
getWidth in interface SizedFrame
Returns:
The width of this frame.

getHeight


public int getHeight()
Returns the height of this frame.

Specified by:
getHeight in interface SizedFrame
Returns:
The height of this frame.