com.groovemanager.gui.custom
Interface KeyboardKey

All Known Implementing Classes:
Mc909Pad

public interface KeyboardKey

This interface represents a single Key on a musical keyboard. It can be selected (pressed) or not.

Author:
Manu Robledo

Field Summary
static int A
          Constants for the number of a key inside one octave
static int AIS
          Constants for the number of a key inside one octave
static int B
          Constants for the number of a key inside one octave
static int C
          Constants for the number of a key inside one octave
static int CIS
          Constants for the number of a key inside one octave
static int D
          Constants for the number of a key inside one octave
static int DIS
          Constants for the number of a key inside one octave
static int E
          Constants for the number of a key inside one octave
static int F
          Constants for the number of a key inside one octave
static int FIS
          Constants for the number of a key inside one octave
static int G
          Constants for the number of a key inside one octave
static int GIS
          Constants for the number of a key inside one octave
static int OCTAVE_0
          Constants for the offsets of each octave
static int OCTAVE_1
          Constants for the offsets of each octave
static int OCTAVE_2
          Constants for the offsets of each octave
static int OCTAVE_3
          Constants for the offsets of each octave
static int OCTAVE_4
          Constants for the offsets of each octave
static int OCTAVE_5
          Constants for the offsets of each octave
static int OCTAVE_6
          Constants for the offsets of each octave
static int OCTAVE_7
          Constants for the offsets of each octave
static int OCTAVE_8
          Constants for the offsets of each octave
static int OCTAVE_9
          Constants for the offsets of each octave
static int OCTAVE_MINUS_1
          Constants for the offsets of each octave
 
Method Summary
 void addKeyListener(KeyboardKeyListener listener)
          Add a KeyListener that will be notified, when this key is pressed or released
 boolean getHold()
           
 int getKey()
          Get the note value represented by this key.
 boolean isPressed()
          Return whether this key is currently pressed or not
 void press()
          Press this key.
 void release()
          Release this key.y
 void removeKeyListener(KeyboardKeyListener listener)
          Remove a previously registeres KeyListener from this key
 void setHold(boolean hold)
           
 

Field Detail

A

static final int A
Constants for the number of a key inside one octave

See Also:
Constant Field Values

AIS

static final int AIS
Constants for the number of a key inside one octave

See Also:
Constant Field Values

B

static final int B
Constants for the number of a key inside one octave

See Also:
Constant Field Values

C

static final int C
Constants for the number of a key inside one octave

See Also:
Constant Field Values

CIS

static final int CIS
Constants for the number of a key inside one octave

See Also:
Constant Field Values

D

static final int D
Constants for the number of a key inside one octave

See Also:
Constant Field Values

DIS

static final int DIS
Constants for the number of a key inside one octave

See Also:
Constant Field Values

E

static final int E
Constants for the number of a key inside one octave

See Also:
Constant Field Values

F

static final int F
Constants for the number of a key inside one octave

See Also:
Constant Field Values

FIS

static final int FIS
Constants for the number of a key inside one octave

See Also:
Constant Field Values

G

static final int G
Constants for the number of a key inside one octave

See Also:
Constant Field Values

GIS

static final int GIS
Constants for the number of a key inside one octave

See Also:
Constant Field Values

OCTAVE_0

static final int OCTAVE_0
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_1

static final int OCTAVE_1
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_2

static final int OCTAVE_2
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_3

static final int OCTAVE_3
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_4

static final int OCTAVE_4
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_5

static final int OCTAVE_5
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_6

static final int OCTAVE_6
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_7

static final int OCTAVE_7
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_8

static final int OCTAVE_8
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_9

static final int OCTAVE_9
Constants for the offsets of each octave

See Also:
Constant Field Values

OCTAVE_MINUS_1

static final int OCTAVE_MINUS_1
Constants for the offsets of each octave

See Also:
Constant Field Values
Method Detail

addKeyListener

void addKeyListener(KeyboardKeyListener listener)
Add a KeyListener that will be notified, when this key is pressed or released

Parameters:
listener - The KeyListener to add

getHold

boolean getHold()

getKey

int getKey()
Get the note value represented by this key.

Returns:
The note value of this key in the range from 0 (OCTAVE_MINUS_1 + C) to 127 (OCTAVE_9 + G.

isPressed

boolean isPressed()
Return whether this key is currently pressed or not

Returns:
true if the key has recently been pressed and since then not been released, false otherwise

press

void press()
Press this key.


release

void release()
Release this key.y


removeKeyListener

void removeKeyListener(KeyboardKeyListener listener)
Remove a previously registeres KeyListener from this key

Parameters:
listener - The KeyListener to remove

setHold

void setHold(boolean hold)