com.frinika.sequencer.gui.selection
Class SelectionContainer<T extends Selectable>

java.lang.Object
  extended by com.frinika.sequencer.gui.selection.SelectionContainer<T>
All Implemented Interfaces:
SelectionFocusable
Direct Known Subclasses:
LaneSelection, MultiEventSelection, PartSelection

public abstract class SelectionContainer<T extends Selectable>
extends java.lang.Object
implements SelectionFocusable


Field Summary
protected  T focus
           
 
Constructor Summary
SelectionContainer(ProjectContainer project)
           
 
Method Summary
 void addSelected(java.util.Collection<? extends T> list)
          Add multiple items to the selection
 void addSelected(T item)
          Add one T to the selection
 void addSelectionListener(SelectionListener<T> listener)
          Add a LaneSelectionListener to this container
 void clearSelection()
          Clear the selection
 T getFocus()
          I need a focus so I will get it from here for now.
 java.util.Collection<Selectable> getObjects()
           
 java.util.Collection<T> getSelected()
          Returns the selected Lanes.
 int getSelectionLeftColumn()
           
 long getSelectionStartTick()
           
 void notifyListeners()
           
 void removeSelected(java.util.Collection<? extends T> list)
          Add multiple Lanes to the selection
 void removeSelected(T item)
          Remove one T to the selection
 void removeSelectionListener(SelectionListener<T> listener)
          Remove a LaneSelectionListener from this container
 void setDirty()
           
 void setFocus(T focus)
           
protected abstract  void setMetaFocus()
          Override this null implementation to get focus to follow containers
 void setSelected(java.util.Collection<? extends T> list)
          Clear then add multiple items to the selection
 void setSelected(T item)
           
 void setSelectedX(java.util.Collection<Selectable> list)
           
 void setSelectionLeftColumn(int selectionLeftColumn)
           
 void setSelectionStartTick(long selectionStartTick)
          The selectionStartTick is the timebase of the selection.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

focus

protected T extends Selectable focus
Constructor Detail

SelectionContainer

public SelectionContainer(ProjectContainer project)
Method Detail

addSelected

public void addSelected(T item)
Add one T to the selection

Parameters:
item -

addSelected

public void addSelected(java.util.Collection<? extends T> list)
Add multiple items to the selection

Parameters:
Lanes -

setSelected

public void setSelected(T item)

setSelected

public void setSelected(java.util.Collection<? extends T> list)
Clear then add multiple items to the selection

Parameters:
Lanes -

setSelectedX

public void setSelectedX(java.util.Collection<Selectable> list)

removeSelected

public void removeSelected(T item)
Remove one T to the selection

Parameters:
item -

removeSelected

public void removeSelected(java.util.Collection<? extends T> list)
Add multiple Lanes to the selection

Parameters:
Lanes -

clearSelection

public void clearSelection()
Clear the selection

Specified by:
clearSelection in interface SelectionFocusable

getSelectionStartTick

public long getSelectionStartTick()
Returns:
Returns the selectionStartTick.

setSelectionStartTick

public void setSelectionStartTick(long selectionStartTick)
The selectionStartTick is the timebase of the selection. It's neccesary when copying events in order to place them correctly in time when pasting them to another location. An editor should always set a selectionStartTick when starting on a new selection. It's a good idea to base the starttick on the current snap (or quantize) resolution.

Parameters:
selectionStartTick -

getSelected

public java.util.Collection<T> getSelected()
Returns the selected Lanes. Note that you should NOT add or remove events directly from this returned collection. Use the provided methods from this container.

Returns:

getObjects

public java.util.Collection<Selectable> getObjects()
Specified by:
getObjects in interface SelectionFocusable

addSelectionListener

public void addSelectionListener(SelectionListener<T> listener)
Add a LaneSelectionListener to this container

Parameters:
listener -

removeSelectionListener

public void removeSelectionListener(SelectionListener<T> listener)
Remove a LaneSelectionListener from this container

Parameters:
listener -

getFocus

public T getFocus()
I need a focus so I will get it from here for now. This might move (PJL).

Returns:

setMetaFocus

protected abstract void setMetaFocus()
Override this null implementation to get focus to follow containers


setFocus

public void setFocus(T focus)

notifyListeners

public void notifyListeners()

setSelectionLeftColumn

public void setSelectionLeftColumn(int selectionLeftColumn)

getSelectionLeftColumn

public int getSelectionLeftColumn()

setDirty

public void setDirty()