openpiano.piano
Class Key

java.lang.Object
  extended by openpiano.piano.Key

public class Key
extends Object

The Key class for keys in a piano

Version:
1.0, 07/30/08
Author:
Sascha Westermann

Method Summary
 Boolean isKeyMarked()
          Returns true if a key is marked
 void markKey(Boolean mark)
          Marks a key
 void pressKey()
          Presses a key
 void releaseKey()
          Releases a key
 void setMarkKeyFactor(int color, float factor)
          Sets the factor of the color depth of the key (0.0-1.0)
 void setMarkKeyOff()
          Sets the factor of the color depth of the key (0.0-1.0)
 void showKey(Boolean useable)
          Draws the key
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

isKeyMarked

public Boolean isKeyMarked()
Returns true if a key is marked

Returns:
true if a key is marked

markKey

public void markKey(Boolean mark)
Marks a key

Parameters:
mark - true if a key should be marked

pressKey

public void pressKey()
Presses a key


releaseKey

public void releaseKey()
Releases a key


setMarkKeyFactor

public void setMarkKeyFactor(int color,
                             float factor)
Sets the factor of the color depth of the key (0.0-1.0)

Parameters:
factor - the factor of the color depth

setMarkKeyOff

public void setMarkKeyOff()
Sets the factor of the color depth of the key (0.0-1.0)

Parameters:
factor - the factor of the color depth

showKey

public void showKey(Boolean useable)
Draws the key

Parameters:
useable - true if key is playable