com.dlsc.flexgantt.model.eventline
Class DefaultEventlineSelectionModel

java.lang.Object
  extended by com.dlsc.flexgantt.model.eventline.DefaultEventlineSelectionModel
All Implemented Interfaces:
IEventlineSelectionModel

public class DefaultEventlineSelectionModel
extends java.lang.Object
implements IEventlineSelectionModel

A selection model used by the Eventline. Eventline objects can be added to and removed from the selection causing selection events to be sent to the model listeners.

Since:
1.0
Author:
Dirk Lemmermann

Nested Class Summary
 
Nested classes/interfaces inherited from interface com.dlsc.flexgantt.model.eventline.IEventlineSelectionModel
IEventlineSelectionModel.Mode
 
Constructor Summary
DefaultEventlineSelectionModel()
           
 
Method Summary
 void addEventlineSelectionListener(IEventlineSelectionListener l)
          Adds a selection listener to the model.
 void addSelection(java.lang.Object eventlineObject)
          Adds an object to the selection.
 void clearSelection()
          Clear the current selection.
protected  void fireSelectionModelEvent(EventlineSelectionModelEvent evt)
          Sends the given selection model event to the attached listeners.
 java.lang.Object[] getSelection()
          Returns all currently selected eventline objects.
 IEventlineSelectionModel.Mode getSelectionMode()
          Returns the selection mode.
 boolean isSelected(java.lang.Object eventlineObject)
          Checks whether the given eventline object is currently selected.
 void removeEventlineSelectionListener(IEventlineSelectionListener l)
          Removes a selection listener from the model.
 void removeSelection(java.lang.Object eventlineObject)
          Removes an object from the selection.
 void setSelectionMode(IEventlineSelectionModel.Mode mode)
          Sets the selection mode.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultEventlineSelectionModel

public DefaultEventlineSelectionModel()
Method Detail

addSelection

public void addSelection(java.lang.Object eventlineObject)
Description copied from interface: IEventlineSelectionModel
Adds an object to the selection.

Specified by:
addSelection in interface IEventlineSelectionModel
Parameters:
eventlineObject - the eventline object that gets added to the current selection

removeSelection

public void removeSelection(java.lang.Object eventlineObject)
Description copied from interface: IEventlineSelectionModel
Removes an object from the selection.

Specified by:
removeSelection in interface IEventlineSelectionModel
Parameters:
eventlineObject - the eventline object that gets removed from the current selection

getSelection

public java.lang.Object[] getSelection()
Description copied from interface: IEventlineSelectionModel
Returns all currently selected eventline objects.

Specified by:
getSelection in interface IEventlineSelectionModel
Returns:
all selected eventline objects

clearSelection

public void clearSelection()
Description copied from interface: IEventlineSelectionModel
Clear the current selection.

Specified by:
clearSelection in interface IEventlineSelectionModel

isSelected

public boolean isSelected(java.lang.Object eventlineObject)
Description copied from interface: IEventlineSelectionModel
Checks whether the given eventline object is currently selected.

Specified by:
isSelected in interface IEventlineSelectionModel
Parameters:
eventlineObject - the eventline object to check
Returns:
TRUE if the given eventline object is currently selected

setSelectionMode

public void setSelectionMode(IEventlineSelectionModel.Mode mode)
Description copied from interface: IEventlineSelectionModel
Sets the selection mode.

Specified by:
setSelectionMode in interface IEventlineSelectionModel
Parameters:
mode - the selection mode

getSelectionMode

public IEventlineSelectionModel.Mode getSelectionMode()
Description copied from interface: IEventlineSelectionModel
Returns the selection mode.

Specified by:
getSelectionMode in interface IEventlineSelectionModel
Returns:
the selection mode

addEventlineSelectionListener

public void addEventlineSelectionListener(IEventlineSelectionListener l)
Description copied from interface: IEventlineSelectionModel
Adds a selection listener to the model.

Specified by:
addEventlineSelectionListener in interface IEventlineSelectionModel
Parameters:
l - the listener to add
See Also:
IEventlineSelectionModel.removeEventlineSelectionListener(IEventlineSelectionListener)

removeEventlineSelectionListener

public void removeEventlineSelectionListener(IEventlineSelectionListener l)
Description copied from interface: IEventlineSelectionModel
Removes a selection listener from the model.

Specified by:
removeEventlineSelectionListener in interface IEventlineSelectionModel
Parameters:
l - the listener to remove
See Also:
IEventlineSelectionModel.addEventlineSelectionListener(IEventlineSelectionListener)

fireSelectionModelEvent

protected void fireSelectionModelEvent(EventlineSelectionModelEvent evt)
Sends the given selection model event to the attached listeners.

Parameters:
evt - the selection event
Since:
1.0
See Also:
addEventlineSelectionListener(IEventlineSelectionListener)