|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groovemanager.sampled.waveform.AbstractWaveFormDisplay
com.groovemanager.sampled.waveform.SelectableWaveFormDisplay
This class extends AbstractWaveFormDisplay to implement the Selectable interface. The position and selection of the Display are made visible.
| Field Summary | |
|---|---|
protected int |
left
Current selection´s left border |
protected boolean |
mouseDown
Indicates whether the mouse button is currently pressed or not |
protected int |
pos
Current selection´s left border |
protected int |
right
Current selection´s left border |
protected java.util.ArrayList |
selectableListeners
List of SelectableListeners registered with this Display |
protected int |
selStartedAt
Current selection´s left border |
| Fields inherited from class com.groovemanager.sampled.waveform.AbstractWaveFormDisplay |
|---|
channelSpacing, leftOffset, listeners, scrollFactor, source, topOffset, zoomFactor |
| Constructor Summary | |
|---|---|
SelectableWaveFormDisplay()
|
|
| Method Summary | |
|---|---|
void |
addSelectableListener(SelectableListener listener)
Add a SelectableListener that will be notified of changes to this Selectable´s Selection or position |
protected abstract void |
drawPosition(int x,
int y,
int height)
Draw the position pointer at the given position |
protected abstract void |
drawSelection(int x,
int y,
int width,
int height)
Draw the selection in the given area |
protected abstract void |
erasePosition()
Hide the position pointer |
protected abstract void |
eraseSelection()
Hide the current selection |
int |
getPosition()
Get the current position |
Selection |
getSelection()
Get the current Selection |
protected void |
mouseDown(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
Notification about a mouse button being pressed. |
protected void |
mouseMove(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
Notification about the mouse being moved. |
protected void |
mouseUp(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
Notification about a mouse button being released. |
protected void |
redrawPosition(int x,
int y,
int height)
Move the visible position pointer to the specified position or - if it was not visible before - draw it to the given position |
protected abstract void |
redrawSelection(int x,
int y,
int width,
int height)
Adapt the visible selection to the given area or - if it was not visible before - draw it to the given area. |
void |
removeSelectableListener(SelectableListener listener)
Remove a SelectableListener from this Selectable |
void |
setPosition(int pos)
Set the position |
void |
setSelection(Selection sel)
Set the Selection |
void |
showSelection()
Zoom and scroll this display to the current selection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int left
protected boolean mouseDown
protected int pos
protected int right
protected java.util.ArrayList selectableListeners
protected int selStartedAt
| Constructor Detail |
|---|
public SelectableWaveFormDisplay()
| Method Detail |
|---|
public void addSelectableListener(SelectableListener listener)
Selectable
addSelectableListener in interface Selectablelistener - The SelectableListener to add
protected abstract void drawPosition(int x,
int y,
int height)
x - The x-coordinate of the position pointery - The y-coordinate of the position pointer´s topheight - The height of the position pointer
protected abstract void drawSelection(int x,
int y,
int width,
int height)
x - The x-coordinate of the areay - The y-coordinate of the areawidth - The width of the areaheight - The height of the areaprotected abstract void erasePosition()
protected abstract void eraseSelection()
public int getPosition()
Selectable
getPosition in interface Selectablepublic Selection getSelection()
Selectable
getSelection in interface Selectable
protected void mouseDown(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
realX - The x-coordinate of where the mouse button was pressedrealY - The y-coordinate of where the mouse button was pressedshiftPressed - true, if the Shift-Button is currently pressed,
false otherwisectrlPressed - true, if the CTRL-Button is currently pressed, false
otherwise
protected void mouseMove(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
realX - The x-coordinate of where the mouse was moved torealY - The y-coordinate of where the mouse was moved toshiftPressed - true, if the Shift-Button is currently pressed,
false otherwisectrlPressed - true, if the CTRL-Button is currently pressed, false
otherwise
protected void mouseUp(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
realX - The x-coordinate of where the mouse button was releasedrealY - The y-coordinate of where the mouse button was releasedshiftPressed - true, if the Shift-Button is currently pressed,
false otherwisectrlPressed - true, if the CTRL-Button is currently pressed, false
otherwise
protected void redrawPosition(int x,
int y,
int height)
x - The x-coordinate of the position pointery - The y-coordinate of the position pointer´s topheight - The height of the position pointer
protected abstract void redrawSelection(int x,
int y,
int width,
int height)
x - The x-coordinate of the areay - The y-coordinate of the areawidth - The width of the areaheight - The height of the areapublic void removeSelectableListener(SelectableListener listener)
Selectable
removeSelectableListener in interface Selectablelistener - The SelectableListener to removepublic void setPosition(int pos)
Selectable
setPosition in interface Selectablepos - The new positionpublic void setSelection(Selection sel)
Selectable
setSelection in interface Selectablesel - The new Selectionpublic void showSelection()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||