Overview  Package   Class  Tree  Index 

be.lassi.cues
Class Cues

java.lang.Object
  extended by be.lassi.base.SaveableObject
      extended by be.lassi.cues.CueCollection
          extended by be.lassi.cues.Cues
All Implemented Interfaces:
java.lang.Iterable<Cue>

public class Cues
extends CueCollection


Constructor Summary
Cues(Dirty dirty, Submasters submasters, int numberOfChannels)
           
Cues(Submasters submasters)
           
 
Method Summary
 void add(Cue cue)
          Add a Cue at the end.
 Cues copy()
          Return a copy of this Cue collection.
 Cues copySelectedCues()
          Return a Cues collection with a copy of all Cues that are currently selected.
 boolean equals(java.lang.Object object)
          Return true if this Cue is equal to given Cue.
 Cue getCueWithNumber(java.lang.String cueNumber)
           
 Cue getCurrentCue()
           
 int getCurrentIndex()
          Return the index of the Cue that is the 'current cue'.
protected  java.lang.String getDefaultNewCueNumber(int cueIndex)
          Determine a default cue number for a new Cue to be added to the collection, based on the Cues already in the collection.
 LightCues getLightCues()
           
 int getSingleSelectedCueIndex()
          Gets the index of the single currently selected cue.
 boolean hasSelections()
          Return true if this collection contains any Cues that are currently selected.
 void insert(int index, Cue cue)
          Add a Cue at given index.
 void insert(int index, Cues insertedCues)
          Add Cue objects in given collection at given index.
protected  void insertCue(int index, Cue cue)
          Add a Cue at given index.
 int lightCueIndexOf(int cueIndex)
           
 void remove(int index)
          Remove Cue with given index from this colletion.
 void removeAll()
          Remove all Cues from this collection.
protected  void removeCue(int index)
          Remove Cue with given index from this collection.
 void removeSelectedCues()
          Remove all Cues that are currently selected.
 void renumber()
           
 void select(int selectedIndex)
          Select the Cue with given index.
 void selectExtra(int index)
          Select Cue with given index.
 void selectNone()
          De-select all Cues.
 void selectRange(int index)
          Perform range selection.
 void set(Cues other)
          Replace all Cue objects in this collection by the Cue objects in given collection.
 void setCurrent(int cueIndex)
          Make the Cue at given index, the 'current cue'.
 
Methods inherited from class be.lassi.cues.CueCollection
addListener, fireAdded, fireCueNumbersChanged, fireCurrentChanged, fireRemoved, fireSelectionChanged, get, getListeners, hasCurrent, indexOf, iterator, removeListener, setCueListener, size
 
Methods inherited from class be.lassi.base.SaveableObject
doNotMarkDirty, getDirty, isDirty, markDirty, setDirty
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Cues

public Cues(Dirty dirty,
            Submasters submasters,
            int numberOfChannels)

Cues

public Cues(Submasters submasters)
Method Detail

add

public void add(Cue cue)
Add a Cue at the end.

Parameters:
cue -

copy

public Cues copy()
Return a copy of this Cue collection.

The Cues in the resulting copy are a copy of the Cues in this collection.

Returns:
Cues

copySelectedCues

public Cues copySelectedCues()
Return a Cues collection with a copy of all Cues that are currently selected.

Note that originally there was a getSelectedCues() method, which returned a collection of the original Cue objects that were selected, but not making a copy made the "selected" attribute of those objects disappear, which is no wanted, and hence a copySelectedCues() method was created instead.

Returns:
Cues

equals

public boolean equals(java.lang.Object object)
Return true if this Cue is equal to given Cue.

To be equal, both Cue collections have to contain the same amount of Cues and the Cues at the corresponding indexes have to be equal to.

Overrides:
equals in class CueCollection

getCueWithNumber

public Cue getCueWithNumber(java.lang.String cueNumber)

getCurrentCue

public Cue getCurrentCue()

getCurrentIndex

public int getCurrentIndex()
Return the index of the Cue that is the 'current cue'.

In case there is more than one Cue that has the 'current' attribute set to true, the index of the first one is returned. There never should be more than one Cue that is 'current', as it is this classes responsibility to maintain the 'current cue' state.

Returns:
int

getDefaultNewCueNumber

protected java.lang.String getDefaultNewCueNumber(int cueIndex)
Determine a default cue number for a new Cue to be added to the collection, based on the Cues already in the collection.

Parameters:
cueIndex -
Returns:
String

getLightCues

public LightCues getLightCues()

getSingleSelectedCueIndex

public int getSingleSelectedCueIndex()
Gets the index of the single currently selected cue.

Returns:
the index of the currently single selected cue, -1 if no cue is currently selected, -1 if there is more than 1 cue currently selected

hasSelections

public boolean hasSelections()
Return true if this collection contains any Cues that are currently selected.

Returns:
boolean

insert

public void insert(int index,
                   Cue cue)
Add a Cue at given index.

Parameters:
index -
cue -

insert

public void insert(int index,
                   Cues insertedCues)
Add Cue objects in given collection at given index.

Parameters:
index -
insertedCues -

insertCue

protected void insertCue(int index,
                         Cue cue)
Add a Cue at given index.

Overrides:
insertCue in class CueCollection
Parameters:
index -
cue -

lightCueIndexOf

public int lightCueIndexOf(int cueIndex)

remove

public void remove(int index)
Remove Cue with given index from this colletion. Notify any listeners.

Parameters:
index -

removeAll

public void removeAll()
Remove all Cues from this collection. Notify any listeners.


removeCue

protected void removeCue(int index)
Remove Cue with given index from this collection. Notify any listeners.

Overrides:
removeCue in class CueCollection

removeSelectedCues

public void removeSelectedCues()
Remove all Cues that are currently selected.


renumber

public void renumber()

select

public void select(int selectedIndex)
Select the Cue with given index. De-select any other Cues.

Parameters:
selectedIndex -

selectExtra

public void selectExtra(int index)
Select Cue with given index. Do not touch the selection of any other Cues.

Parameters:
index -

selectNone

public void selectNone()
De-select all Cues.


selectRange

public void selectRange(int index)
Perform range selection.

Parameters:
index -

set

public void set(Cues other)
Replace all Cue objects in this collection by the Cue objects in given collection.

Parameters:
other -

setCurrent

public void setCurrent(int cueIndex)
Make the Cue at given index, the 'current cue'.

Any Cue that was the 'current cue' before, is no longer current. Any cue selections that were done before, are reset.

Parameters:
cueIndex -

Overview  Package   Class  Tree  Index 
Lighting Assistant 1.2