|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.gui.custom.CustomComposite
com.groovemanager.gui.custom.mc909.Mc909Pad
A Mc909Pad is an implementation of the KeyboardKey the gives a visual representation of one pad of the Roland MC-909. It can be wrapped into a Mc909Key to have a black or white key surrounding the pad just like on the MC-909 itself.
| Field Summary | |
|---|---|
static int |
BLACK
Constant value for a pad being surrounded by a white key |
private boolean |
hold
If this value is true, a pad has to be clicked a second time to be released. otherwise it will be released on mouse release. |
private int |
key
The Key value assigned to this pad |
private static int |
LINE_WIDTH
Constant for the line width |
private java.util.ArrayList |
listeners
The KeyboardKeyListeners registered with this pad |
private org.eclipse.swt.graphics.Color |
padColor
The Color for the pad when it is not pressed |
private boolean |
pressed
true, if this pad is currently pressed, false otherwise |
private org.eclipse.swt.graphics.Color |
pressedColor
The Color for the pad when it is pressed |
private int |
type
The type of this Pad (either BLACK or WHITE |
static int |
WHITE
Constant value for a pad being surrounded by a white key |
| Fields inherited from interface com.groovemanager.gui.custom.KeyboardKey |
|---|
A, AIS, B, C, CIS, D, DIS, E, F, FIS, G, GIS, OCTAVE_0, OCTAVE_1, OCTAVE_2, OCTAVE_3, OCTAVE_4, OCTAVE_5, OCTAVE_6, OCTAVE_7, OCTAVE_8, OCTAVE_9, OCTAVE_MINUS_1 |
| Constructor Summary | |
|---|---|
Mc909Pad(org.eclipse.swt.widgets.Composite parent,
int type,
int key)
Construct a new Mc909Pad |
|
| Method Summary | |
|---|---|
void |
addKeyListener(KeyboardKeyListener listener)
Add a KeyListener that will be notified, when this key is pressed or released |
protected org.eclipse.swt.widgets.Composite |
createComposite(org.eclipse.swt.widgets.Composite parent,
int style)
This method is to be overwritten by concrete subclasses to create the real contents of this CustomComposite |
boolean |
getHold()
|
int |
getKey()
Get the note value represented by this key. |
protected int[] |
getListenerTypes()
For all types of listeners that should be possible to add to this Composite directly, the corresponding SWT.* constant should be contained in the returned Array. |
protected int |
getPossibleStyles()
Get a combination of all allowed SWT.* style constants |
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)
|
| Methods inherited from class com.groovemanager.gui.custom.CustomComposite |
|---|
addListener, checkStyle, getComposite, getData, getListeners, getParent, removeListener, setData, setLayoutData |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static int BLACK
private boolean hold
private final int key
private static final int LINE_WIDTH
private java.util.ArrayList listeners
private final org.eclipse.swt.graphics.Color padColor
private boolean pressed
private final org.eclipse.swt.graphics.Color pressedColor
private final int type
BLACK or WHITE
public static int WHITE
| Constructor Detail |
|---|
public Mc909Pad(org.eclipse.swt.widgets.Composite parent,
int type,
int key)
parent - The parent Compositetype - The pad type (either BLACK or
WHITE)key - The key value assigned to this pad from 0 to 127| Method Detail |
|---|
public void addKeyListener(KeyboardKeyListener listener)
KeyboardKey
addKeyListener in interface KeyboardKeylistener - The KeyListener to addKeyboardKey.addKeyListener(com.groovemanager.gui.custom.KeyboardKeyListener)
protected org.eclipse.swt.widgets.Composite createComposite(org.eclipse.swt.widgets.Composite parent,
int style)
CustomComposite
createComposite in class CustomCompositeparent - The parent Composite under which this Composite should
be createdstyle - Combination of valid SWT.* style constants
CustomComposite.createComposite(org.eclipse.swt.widgets.Composite, int)public boolean getHold()
getHold in interface KeyboardKeyKeyboardKey.getHold()public int getKey()
KeyboardKey
getKey in interface KeyboardKeyOCTAVE_MINUS_1 + C) to 127
(OCTAVE_9 + G.KeyboardKey.getKey()protected int[] getListenerTypes()
CustomComposite
getListenerTypes in class CustomCompositeCustomComposite.getListenerTypes()protected int getPossibleStyles()
CustomComposite
getPossibleStyles in class CustomCompositeSWT.BORDER | SWT.LEFT | SWT.BORDERCustomComposite.getPossibleStyles()public boolean isPressed()
KeyboardKey
isPressed in interface KeyboardKeyKeyboardKey.isPressed()public void press()
KeyboardKey
press in interface KeyboardKeyKeyboardKey.press()public void release()
KeyboardKey
release in interface KeyboardKeyKeyboardKey.release()public void removeKeyListener(KeyboardKeyListener listener)
KeyboardKey
removeKeyListener in interface KeyboardKeylistener - The KeyListener to removeKeyboardKey.removeKeyListener(com.groovemanager.gui.custom.KeyboardKeyListener)public void setHold(boolean hold)
setHold in interface KeyboardKeyKeyboardKey.setHold(boolean)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||