|
|||||||||
| 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
com.groovemanager.sampled.waveform.MarkableWaveFormDisplay
This class extends SelectableWaveFormDisplay to implement the Markable interface. The Markers are made visible and editable if wanted.
| Field Summary | |
|---|---|
protected boolean |
editMarkers
Indicates whether Markers can be added, moved or removed on this WaveFormDisplay |
protected java.util.ArrayList |
markableListeners
List of MarkableListeners |
protected java.util.SortedSet |
markers
Set of all markers |
protected static int |
MOUSE_TOLERANCE
|
protected Marker |
selectedMarker
The currently selected Marker if any |
| Fields inherited from class com.groovemanager.sampled.waveform.SelectableWaveFormDisplay |
|---|
left, mouseDown, pos, right, selectableListeners, selStartedAt |
| Fields inherited from class com.groovemanager.sampled.waveform.AbstractWaveFormDisplay |
|---|
channelSpacing, leftOffset, listeners, scrollFactor, source, topOffset, zoomFactor |
| Constructor Summary | |
|---|---|
MarkableWaveFormDisplay()
|
|
| Method Summary | |
|---|---|
void |
addMarkableListener(MarkableListener listener)
Add a MarkableListener that will be notified of any changes made to this Markable instance |
void |
addMarker(int position,
java.lang.String name)
Add a Marker with the given name to this Markable at the given position |
protected void |
addMarker(Marker m)
Internal method for adding a Marker |
private void |
deHighlightMarker(Marker m)
Dehighlight the given marker to indicate this one is no more the currently selected Marker |
void |
deselectMarker()
Deselect the currently selected Marker, if any |
protected abstract void |
drawHighlightedMarker(Marker m)
Draw the given Marker in selected state |
protected abstract void |
drawMarker(Marker m)
Draw the given Marker on the WaveFormDisplay |
protected abstract void |
eraseHighlightedMarker(Marker m)
Erase the given Marker that has been drawn in selected state before |
protected abstract void |
eraseMarker(Marker m)
Erase the given marker from the WaveformDisplay |
Marker |
getMarker(int index)
Get the Marker at the given index |
int |
getMarkerCount()
Get the current number of Markers contained in this Markable |
protected Marker |
getMarkerFromMousePos(int mousePos)
Get the Marker that is nearest to the given mouse position, but only if it is not more than MOUSE_TOLERANCE pixels away. |
Marker[] |
getMarkers()
Get all Markers currently assigned to this Markable |
Marker |
getSelectedMarker()
Get the currently selected Marker |
private void |
highlightMarker(Marker m)
Highlight the given Marker to indicate that this one is the currently selected Marker |
protected Marker |
identifyMarker(int position)
Internal method for identifying a Marker by its position |
protected Marker |
identifyMarker(java.lang.String name)
Internal method for identifying a Marker by its name |
protected Marker |
identifyMarker(java.lang.String name,
int position)
Internal method for identifying a Marker by its name and position |
protected Marker |
identifyMarkerIndex(int index)
Internal method for identifying a Marker by its index |
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. |
void |
moveMarker(int oldPos,
int newPos)
Move a Marker from the specified position to a new position |
protected void |
moveMarker(Marker m,
int newPos)
Internal method for moving a amrker |
void |
moveMarker(java.lang.String name,
int newPos)
Move the Marker identified by the given name to the specified position |
void |
moveMarker(java.lang.String name,
int oldPos,
int newPos)
Move the Marker identified by the given name and currently located at the given position to the a new position |
void |
moveMarkerIndex(int index,
int newPos)
Move the Marker at the given index to the given new position |
protected void |
redrawMarker(Marker m)
Redraw the given marker |
void |
removeMarkableListener(MarkableListener listener)
Remove a MarkableListener |
void |
removeMarker(int position)
Remove a marker from the given position |
void |
removeMarker(int position,
java.lang.String name)
Remove a Marker identified by the given name and located at the given position |
protected void |
removeMarker(Marker m)
Internal Method for removing a marker |
void |
removeMarker(java.lang.String name)
Remove a marker identified by the given name |
void |
removeMarkerIndex(int index)
Remove the Marker at the given index |
void |
selectMarker(int position)
Select the Marker at the given position |
protected void |
selectMarker(Marker m)
Internal method for selecting a marker |
void |
selectMarker(java.lang.String name)
Select the Marker with the given name |
void |
selectMarker(java.lang.String name,
int position)
Select the Marker with the given name and positon |
void |
selectMarkerIndex(int index)
Select the Marker at the given index |
void |
setEditMarkers(boolean edit)
Specify whether the user should be able to edit (create, move or remove) Markers on this WaveformDisplay or not |
| Methods inherited from class com.groovemanager.sampled.waveform.SelectableWaveFormDisplay |
|---|
addSelectableListener, drawPosition, drawSelection, erasePosition, eraseSelection, getPosition, getSelection, redrawPosition, redrawSelection, removeSelectableListener, setPosition, setSelection, showSelection |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected boolean editMarkers
protected java.util.ArrayList markableListeners
protected java.util.SortedSet markers
protected static final int MOUSE_TOLERANCE
protected Marker selectedMarker
| Constructor Detail |
|---|
public MarkableWaveFormDisplay()
| Method Detail |
|---|
public void addMarkableListener(MarkableListener listener)
Markable
addMarkableListener in interface Markablelistener - The MarkableListener to addMarkable.addMarkableListener(com.groovemanager.sampled.waveform.MarkableListener)
public void addMarker(int position,
java.lang.String name)
Markable
addMarker in interface Markableposition - The position where the Marker should be createdname - The name of the MarkerMarkable.addMarker(int, java.lang.String)protected void addMarker(Marker m)
m - The Marker to addprivate void deHighlightMarker(Marker m)
m - The Marker to dehighlightpublic void deselectMarker()
protected abstract void drawHighlightedMarker(Marker m)
m - The Marker to drawprotected abstract void drawMarker(Marker m)
m - The Marker to drawprotected abstract void eraseHighlightedMarker(Marker m)
m - The Marker to eraseprotected abstract void eraseMarker(Marker m)
m - The Marker to erasepublic Marker getMarker(int index)
index - The zero-based index of the marker in question
null, if no Marker
exists at the given index.public int getMarkerCount()
Markable
getMarkerCount in interface MarkableMarkable.getMarkerCount()protected Marker getMarkerFromMousePos(int mousePos)
MOUSE_TOLERANCE pixels away.
mousePos - The mouse x position
null, if the nearest Marker is too far awaypublic Marker[] getMarkers()
Markable
getMarkers in interface MarkableMarkable.getMarkers()public Marker getSelectedMarker()
null, if no Marker
is currently selectedprivate void highlightMarker(Marker m)
m - The Marker to highlightprotected Marker identifyMarker(int position)
position - The position of the Marker to identify
null, if no
Marker could be found at the given positionprotected Marker identifyMarker(java.lang.String name)
name - The name of the Marker to identify
null, if no Marker
could be found with the given name
protected Marker identifyMarker(java.lang.String name,
int position)
name - The name of the Marker to identifyposition - The position of the Marker to identify
null, if no Marker with the given name and position could be
foundprotected Marker identifyMarkerIndex(int index)
index - The zero-based index of the Marker to be identified
null, if no Marker
exists at the given index
protected void mouseDown(int realX,
int realY,
boolean shiftPressed,
boolean ctrlPressed)
SelectableWaveFormDisplay
mouseDown in class SelectableWaveFormDisplayrealX - 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)
SelectableWaveFormDisplay
mouseMove in class SelectableWaveFormDisplayrealX - 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)
SelectableWaveFormDisplay
mouseUp in class SelectableWaveFormDisplayrealX - 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
public void moveMarker(int oldPos,
int newPos)
Markable
moveMarker in interface MarkableoldPos - The position at which the Marker is currently positionednewPos - The position to which the Marker should be movedMarkable.moveMarker(int, int)
protected void moveMarker(Marker m,
int newPos)
m - The Marker to movenewPos - The position to move the Marker to
public void moveMarker(java.lang.String name,
int newPos)
Markable
moveMarker in interface Markablename - The name of the Marker to movenewPos - The position to which the Marker should be movedMarkable.moveMarker(java.lang.String, int)
public void moveMarker(java.lang.String name,
int oldPos,
int newPos)
Markable
moveMarker in interface Markablename - The name of the Marker to moveoldPos - The position at which the Marker is currently locatednewPos - The position to which the Marker should be movedMarkable.moveMarker(java.lang.String, int, int)
public void moveMarkerIndex(int index,
int newPos)
Markable
moveMarkerIndex in interface Markableindex - The zero-based index of the Marker to movenewPos - The position to move the Marker toMarkable.moveMarkerIndex(int, int)protected void redrawMarker(Marker m)
m - The Marker to redrawpublic void removeMarkableListener(MarkableListener listener)
Markable
removeMarkableListener in interface Markablelistener - The MarkableListener to removeMarkable.removeMarkableListener(com.groovemanager.sampled.waveform.MarkableListener)public void removeMarker(int position)
Markable
removeMarker in interface Markableposition - The position from where the Marker should be removedMarkable.removeMarker(int)
public void removeMarker(int position,
java.lang.String name)
Markable
removeMarker in interface Markableposition - The position from where the Marker should be removedname - The name of the Marker to removeMarkable.removeMarker(int, java.lang.String)protected void removeMarker(Marker m)
m - The Marker to removepublic void removeMarker(java.lang.String name)
Markable
removeMarker in interface Markablename - The name of the Marker to removeMarkable.removeMarker(java.lang.String)public void removeMarkerIndex(int index)
Markable
removeMarkerIndex in interface Markableindex - The zero-based index of the Marker to removeMarkable.removeMarkerIndex(int)public void selectMarker(int position)
position - The position of the Marker to selectprotected void selectMarker(Marker m)
m - The Marker to selectpublic void selectMarker(java.lang.String name)
name - The name of the Marker to select
public void selectMarker(java.lang.String name,
int position)
name - The name of the Marker to selectposition - The position of the marker to selectpublic void selectMarkerIndex(int index)
index - The zero-based index of the Marker to selectpublic void setEditMarkers(boolean edit)
edit - true, if editing Markers should be possible, false otherwise
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||