sky.monome.frame
Class CharacterFrame


java.lang.Object

  extended by sky.monome.frame.DefaultFrame

      extended by sky.monome.frame.CharacterFrame

All Implemented Interfaces:
DynamicFrame<CharacterFrame>, Frame, SizedFrame

public class CharacterFrame
extends DefaultFrame
implements DynamicFrame<CharacterFrame>

Frame which displays a character. This frame has a size of 8x8, and uses a new Font("Lucida Sans Typewriter",Font.PLAIN,8) for displaying the character. The character can be modified after construction, and the frame automatically notifies its frame listeners.

Author:
PJ Skyman

Field Summary
 
Fields inherited from class sky.monome.frame.DefaultFrame
height, matrix, width
 
Constructor Summary
CharacterFrame()
          Constructs a character frame with a default space character.
CharacterFrame(char character)
          Constructs a character frame with the specified character.
 
Method Summary
 void addFrameListener(FrameListener<CharacterFrame> frameListener)
          Adds the specified frame listener to the list of frame listeners.
 void fireFrameChanged(CharacterFrame dynamicFrame)
          Invoked when a frame change occurs.
 char getCharacter()
          Returns the character that is currently being displayed on this frame.
 FrameListener<CharacterFrame>[] getFrameListeners()
          Returns an array of all frame listeners.
 int getHeight()
          Returns the height of this frame.
 int getWidth()
          Returns the width of this frame.
 void removeFrameListener(FrameListener<CharacterFrame> frameListener)
          Removes the specified frame listener from the list of frame listeners.
 void setCharacter(char character)
          Modifies the character that is currently being displayed on this frame.
 
Methods inherited from class sky.monome.frame.DefaultFrame
clear, clear, get, set
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CharacterFrame


public CharacterFrame()
Constructs a character frame with a default space character.


CharacterFrame


public CharacterFrame(char character)
Constructs a character frame with the specified character.

Parameters:
character - Character to display in this character frame.
Method Detail

getCharacter


public char getCharacter()
Returns the character that is currently being displayed on this frame.

Returns:
The character that is currently being displayed in this frame.

setCharacter


public void setCharacter(char character)
Modifies the character that is currently being displayed on this frame.

Parameters:
character - New character that will be displayed on this frame.

addFrameListener


public void addFrameListener(FrameListener<CharacterFrame> frameListener)
Adds the specified frame listener to the list of frame listeners.

Specified by:
addFrameListener in interface DynamicFrame<CharacterFrame>
Parameters:
frameListener - Frame listener to add to the list of frame listeners.

removeFrameListener


public void removeFrameListener(FrameListener<CharacterFrame> frameListener)
Removes the specified frame listener from the list of frame listeners.

Specified by:
removeFrameListener in interface DynamicFrame<CharacterFrame>
Parameters:
frameListener - Frame listener to remove from the list of frame listeners.

getFrameListeners


public FrameListener<CharacterFrame>[] getFrameListeners()
Returns an array of all frame listeners.

Specified by:
getFrameListeners in interface DynamicFrame<CharacterFrame>
Returns:
An array of all frame listeners.

fireFrameChanged


public void fireFrameChanged(CharacterFrame dynamicFrame)
Invoked when a frame change occurs.

Specified by:
fireFrameChanged in interface DynamicFrame<CharacterFrame>
Parameters:
dynamicFrame - Dynamic frame that triggered the frame event.

getWidth


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

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

getHeight


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

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