com.frinika.sequencer.model
Class Lane

java.lang.Object
  extended by com.frinika.sequencer.model.Lane
All Implemented Interfaces:
EditHistoryRecordable, EditHistoryRecorder<Part>, Selectable, java.io.Serializable
Direct Known Subclasses:
AudioLane, MidiLane, ProjectLane, SynthLane, TextLane

public abstract class Lane
extends java.lang.Object
implements Selectable, EditHistoryRecordable, EditHistoryRecorder<Part>, java.io.Serializable

See Also:
Serialized Form

Field Summary
protected  java.util.List<Lane> children
           
protected  int height
           
protected  java.util.List<Part> parts
           
 
Constructor Summary
protected Lane()
           
protected Lane(java.lang.String name, ProjectContainer project)
           
 
Method Summary
 void add(Part part)
           
 void addChildLane(int indexInList, Lane lane)
           
 void addChildLane(Lane lane)
           
 void addToModel()
          Add the lane from the project.
 java.lang.Object clone()
          If restoration from a clone is needed - this method should return a clone otherwise throw the CloneNotSupportedException
abstract  Part createPart()
           
 void displayStructure(java.lang.String prefix, java.io.PrintStream out)
           
 java.util.List<Lane> getChildren()
           
 int getDisplayH()
           
 int getDisplayID()
          For the partview GUI.
 int getDisplayY()
          Used by the partview for mapping onto the screen.
 java.util.List<Lane> getFamilyLanes()
          Return a flat view of the decendent lanes.
 int getHeight()
           
abstract  javax.swing.Icon getIcon()
           
 java.lang.String getName()
           
 java.util.List<Part> getParts()
           
 ProjectContainer getProject()
           
 boolean isHidden()
          If a lane is hidden it will not be displayed in the lane panel.
 boolean isOpen()
          If a lane is open it's children might be displayed in the lane panel.
 boolean isSelected()
           
 long leftTickForMove()
          return the left tick mark for move operations without quantize a move to destTick should move item by destTick - leftTickForMove();
 void onLoad()
          Actions to be done when this lane is loaded
 void remove(Part part)
          remove a part.
 void removeAll()
          Remove all parts
 void removeChildLane(Lane lane)
          Lane to add
 void removeFromModel()
          Remove the lane from the project.
 long rightTickForMove()
           
 void setHeight(int i)
           
 void setHidden(boolean b)
          Hide the lane in the part view.
 void setName(java.lang.String name)
           
 void setOpen(boolean b)
          Open the lane in the part view.
 void setSelected(boolean b)
          set selected flag (for GUI use only)
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.frinika.sequencer.model.Selectable
deepCopy, deepMove
 
Methods inherited from interface com.frinika.sequencer.model.EditHistoryRecordable
restoreFromClone
 

Field Detail

parts

protected java.util.List<Part> parts

children

protected java.util.List<Lane> children

height

protected int height
Constructor Detail

Lane

protected Lane()

Lane

protected Lane(java.lang.String name,
               ProjectContainer project)
Method Detail

getParts

public java.util.List<Part> getParts()

removeAll

public void removeAll()
Remove all parts


remove

public void remove(Part part)
remove a part. You must use this if you want the GUI to be maintained Call project.getEditHistoryContainer().notfiyObserers().

Specified by:
remove in interface EditHistoryRecorder<Part>

add

public void add(Part part)
Specified by:
add in interface EditHistoryRecorder<Part>

isSelected

public boolean isSelected()

getHeight

public int getHeight()

getProject

public ProjectContainer getProject()

setSelected

public void setSelected(boolean b)
Description copied from interface: Selectable
set selected flag (for GUI use only)

Specified by:
setSelected in interface Selectable

getName

public java.lang.String getName()

clone

public java.lang.Object clone()
                       throws java.lang.CloneNotSupportedException
Description copied from interface: EditHistoryRecordable
If restoration from a clone is needed - this method should return a clone otherwise throw the CloneNotSupportedException

Specified by:
clone in interface EditHistoryRecordable
Overrides:
clone in class java.lang.Object
Returns:
Throws:
java.lang.CloneNotSupportedException

addChildLane

public void addChildLane(Lane lane)
Parameters:
lane - to add to children.

addChildLane

public void addChildLane(int indexInList,
                         Lane lane)

removeChildLane

public void removeChildLane(Lane lane)
Lane to add

Parameters:
lane - to remove

getFamilyLanes

public java.util.List<Lane> getFamilyLanes()
Return a flat view of the decendent lanes.

Returns:
a List of all the lanes including this and all decendents

isHidden

public boolean isHidden()
If a lane is hidden it will not be displayed in the lane panel. Note that it's children might still be displayed (see isOpen())

Returns:

isOpen

public boolean isOpen()
If a lane is open it's children might be displayed in the lane panel. if it is not open then none of it's decendents will be in the lane panel.

Returns:

getChildren

public java.util.List<Lane> getChildren()
Returns:
list of the Lanes children (contents of this folder)

getDisplayY

public int getDisplayY()
Used by the partview for mapping onto the screen.

Returns:
distance from the top of the display.

getDisplayH

public int getDisplayH()

getDisplayID

public int getDisplayID()
For the partview GUI.

Returns:
lane position in the visible lane list

setHidden

public void setHidden(boolean b)
Hide the lane in the part view. You will need to get the partview to rebuild for this to take effect.


setOpen

public void setOpen(boolean b)
Open the lane in the part view. You will need to get the partview to rebuild for this to take effect.


setName

public void setName(java.lang.String name)

onLoad

public void onLoad()
Actions to be done when this lane is loaded


removeFromModel

public void removeFromModel()
Remove the lane from the project. Override to do any subclass specific stuff. (used by undo)

Specified by:
removeFromModel in interface Selectable

addToModel

public void addToModel()
Add the lane from the project. Override to do any subclass specific stuff. (used by redo)

Specified by:
addToModel in interface Selectable

leftTickForMove

public long leftTickForMove()
Description copied from interface: Selectable
return the left tick mark for move operations without quantize a move to destTick should move item by destTick - leftTickForMove();

Specified by:
leftTickForMove in interface Selectable
Returns:

rightTickForMove

public long rightTickForMove()
Specified by:
rightTickForMove in interface Selectable

setHeight

public void setHeight(int i)

displayStructure

public void displayStructure(java.lang.String prefix,
                             java.io.PrintStream out)

createPart

public abstract Part createPart()

getIcon

public abstract javax.swing.Icon getIcon()
Returns:
icon for the gui (e.g. lane header)