public class DefaultTimelineObjectSelectionModel extends Object implements ITimelineObjectSelectionModel
LayerContainer.getSelectionModel(ILayer)
Constructor and Description |
---|
DefaultTimelineObjectSelectionModel(ILayer layer)
Constructs a new selection model.
|
Modifier and Type | Method and Description |
---|---|
void |
addSelection(Collection<TimelineObjectPath> paths)
Adds several timeline objects to the selection at the same time.
|
void |
addSelection(TimelineObjectPath path)
Adds a selection / a selected timeline object to the model.
|
void |
addTimelineObjectSelectionModelListener(ITimelineObjectSelectionListener l)
Adds a listener to the model.
|
void |
clearSelection()
Clears the current selection.
|
void |
clearSelection(TreePath node)
Clears the current selection for the given path (clears the selection
within a specific row).
|
protected void |
fireValueChanged(TimelineObjectSelectionEvent.ID id,
Collection<TimelineObjectPath> paths)
Fires an event with the given ID to all listeners that are currently
attached to the model.
|
ILayer |
getLayer()
Returns the layer to which the selection model belongs.
|
Iterator<TimelineObjectPath> |
getSelection()
Returns all timeline objects that are currently selected.
|
Iterator<TimelineObjectPath> |
getSelection(TreePath node)
Returns all timeline objects for the given node that are currently
selected.
|
Iterator<TimelineObjectPath> |
getSelection(TreePath path,
ITimeSpan span)
Returns all timeline objects for the given node and time span that are
currently selected.
|
Iterator<TreePath> |
getSelectionPaths()
Returns all tree paths that reference hierarchy objects on which a
selection exists / on which timeline objects are selected.
|
boolean |
isEmpty()
Determines if the current selection is empty.
|
boolean |
isSelected(TimelineObjectPath path)
Determines if the timeline object referenced by the given timeline object
path is currently selected.
|
void |
removeSelection(Collection<TimelineObjectPath> paths)
Removes several timeline objects from the selection at the same time.
|
void |
removeSelection(TimelineObjectPath path)
Removes a selection / a selected timeline object from the model.
|
void |
removeTimelineObjectSelectionModelListener(ITimelineObjectSelectionListener l)
Removes a listener from the model.
|
public DefaultTimelineObjectSelectionModel(ILayer layer)
layer
- the model layer for which the selection model will track the
selected timeline objectspublic ILayer getLayer()
public void clearSelection()
ITimelineObjectSelectionModel
clearSelection
in interface ITimelineObjectSelectionModel
public void clearSelection(TreePath node)
ITimelineObjectSelectionModel
clearSelection
in interface ITimelineObjectSelectionModel
node
- the path to the hierarchy node for which the selection will be
clearedpublic void addSelection(TimelineObjectPath path)
ITimelineObjectSelectionModel
addSelection
in interface ITimelineObjectSelectionModel
path
- the path to the timeline objectpublic void addSelection(Collection<TimelineObjectPath> paths)
ITimelineObjectSelectionModel
addSelection
in interface ITimelineObjectSelectionModel
paths
- a collection of timeline object pathspublic void removeSelection(TimelineObjectPath path)
ITimelineObjectSelectionModel
removeSelection
in interface ITimelineObjectSelectionModel
path
- the path to the timeline objectpublic void removeSelection(Collection<TimelineObjectPath> paths)
ITimelineObjectSelectionModel
removeSelection
in interface ITimelineObjectSelectionModel
paths
- a collection of timeline object pathspublic Iterator<TimelineObjectPath> getSelection(TreePath path, ITimeSpan span)
ITimelineObjectSelectionModel
Iterator
in order to
hide the actual data structure used to store the objects.getSelection
in interface ITimelineObjectSelectionModel
path
- the path to the hierarchy node for which to return the
selected timeline objectsspan
- the time span for which to return the selected timeline
objectsITimelineObjectSelectionModel.getSelection()
,
ITimelineObjectSelectionModel.getSelection(TreePath)
public Iterator<TimelineObjectPath> getSelection(TreePath node)
ITimelineObjectSelectionModel
Iterator
in order to hide the
actual data structure used to store the objects.getSelection
in interface ITimelineObjectSelectionModel
node
- the path to the hierarchy node for which to return the
selected timeline objectsITimelineObjectSelectionModel.getSelection(TreePath, ITimeSpan)
,
ITimelineObjectSelectionModel.getSelection()
public Iterator<TimelineObjectPath> getSelection()
ITimelineObjectSelectionModel
Iterator
in order to hide the actual data structure
used to store the objects.getSelection
in interface ITimelineObjectSelectionModel
ITimelineObjectSelectionModel.getSelection(TreePath)
,
ITimelineObjectSelectionModel.getSelection(TreePath, ITimeSpan)
public boolean isSelected(TimelineObjectPath path)
ITimelineObjectSelectionModel
isSelected
in interface ITimelineObjectSelectionModel
path
- the path to the checked timeline objectpublic Iterator<TreePath> getSelectionPaths()
ITimelineObjectSelectionModel
getSelectionPaths
in interface ITimelineObjectSelectionModel
public void addTimelineObjectSelectionModelListener(ITimelineObjectSelectionListener l)
ITimelineObjectSelectionModel
addTimelineObjectSelectionModelListener
in interface ITimelineObjectSelectionModel
l
- the listener to addpublic void removeTimelineObjectSelectionModelListener(ITimelineObjectSelectionListener l)
ITimelineObjectSelectionModel
removeTimelineObjectSelectionModelListener
in interface ITimelineObjectSelectionModel
l
- the listener to removeprotected void fireValueChanged(TimelineObjectSelectionEvent.ID id, Collection<TimelineObjectPath> paths)
id
- the event IDpaths
- the timeline object paths that have been added to or removed
from the modelpublic boolean isEmpty()
ITimelineObjectSelectionModel
isEmpty
in interface ITimelineObjectSelectionModel
Copyright © 2006–2016 Dirk Lemmermann Software & Consulting. All rights reserved.