com.frinika.sequencer.gui.selection
Class MidiSelection

java.lang.Object
  extended by com.frinika.sequencer.gui.selection.SelectionContainer<MultiEvent>
      extended by com.frinika.sequencer.gui.selection.MultiEventSelection
          extended by 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
           
 
Fields inherited from class com.frinika.sequencer.gui.selection.SelectionContainer
focus
 
Constructor Summary
MidiSelection(ProjectContainer project)
           
 
Method Summary
 void addMenuItem(javax.swing.JMenuItem item)
           
 MidiLane getMidiLane()
           
 MidiPart getMidiPart()
          Get currently selected MidiPart, or null if no MidiPart is selected
protected static java.util.Vector<MultiEvent> getMultiEventsFromSelection(java.util.Collection<Selectable> sel)
           
 boolean isSelectionAvailable()
           
 void selectionChanged(SelectionContainer sc)
          Notify observers that the slection has changed.
 void setMetaFocus()
          Override this null implementation to get focus to follow containers
protected  void updateItems()
           
 
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
 

Field Detail

menuItems

protected java.util.Collection<javax.swing.JMenuItem> menuItems
Constructor Detail

MidiSelection

public MidiSelection(ProjectContainer project)
Method Detail

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()