com.frinika.sequencer.gui.selection
Class MidiSelection
java.lang.Object
com.frinika.sequencer.gui.selection.SelectionContainer<MultiEvent>
com.frinika.sequencer.gui.selection.MultiEventSelection
com.frinika.sequencer.gui.selection.MidiSelection
- All Implemented Interfaces:
- SelectionFocusable, SelectionListener
public class MidiSelection
- extends MultiEventSelection
- implements SelectionListener
Keeps track of changes in selections on MIDI events and
switches on/off menu items related t MIDI funcitons. Also provides
a uniform interface for subclasses of AbstractMidiAction to get the MIDI data
to operate on.
This MidiSelection works as SelectionListener on both
PartSelection and MultiEvent selection. If one of these
contains a MIDI event, MidiSelection will fire a selectionChanged
event to its listeners.
MidiSelection "joins" PartSelection and MultiEventSelection,
and filters out non-Midi selections among those.
- Author:
- Jens Gulden
Field Summary |
protected java.util.Collection<javax.swing.JMenuItem> |
menuItems
|
Methods inherited from class com.frinika.sequencer.gui.selection.SelectionContainer |
addSelected, addSelected, addSelectionListener, clearSelection, getFocus, getObjects, getSelected, getSelectionLeftColumn, getSelectionStartTick, notifyListeners, removeSelected, removeSelected, removeSelectionListener, setDirty, setFocus, setSelected, setSelected, setSelectedX, setSelectionLeftColumn, setSelectionStartTick |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
menuItems
protected java.util.Collection<javax.swing.JMenuItem> menuItems
MidiSelection
public MidiSelection(ProjectContainer project)
selectionChanged
public void selectionChanged(SelectionContainer sc)
- Description copied from interface:
SelectionListener
- Notify observers that the slection has changed.
- Specified by:
selectionChanged
in interface SelectionListener
setMetaFocus
public void setMetaFocus()
- Description copied from class:
SelectionContainer
- Override this null implementation to get focus to follow containers
- Overrides:
setMetaFocus
in class MultiEventSelection
isSelectionAvailable
public boolean isSelectionAvailable()
getMidiPart
public MidiPart getMidiPart()
- Get currently selected MidiPart, or null if no MidiPart is selected
- Returns:
getMidiLane
public MidiLane getMidiLane()
getMultiEventsFromSelection
protected static java.util.Vector<MultiEvent> getMultiEventsFromSelection(java.util.Collection<Selectable> sel)
addMenuItem
public void addMenuItem(javax.swing.JMenuItem item)
updateItems
protected void updateItems()