|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.jaret.util.ui.timebars.model.TimeBarSelectionModelImpl
public class TimeBarSelectionModelImpl
Implementation of TimeBarSelectionModel: straight forward.
Field Summary | |
---|---|
protected boolean |
_intervalSelectAllow
flag indicatig that the selection of intervals is allowed. |
protected java.util.List<TimeBarSelectionListener> |
_listenerList
listener list. |
protected boolean |
_multiAllowed
flag indicating that the selection of multiple elements is allowed. |
protected boolean |
_relationSelectAllow
flag indicatig that the selection of relations is allowed. |
protected boolean |
_rowSelectAllowed
flag indicating that row selection is allowed. |
protected boolean |
_rowSelectionToggleMode
flag indicating activated toggle mode for row selections. |
protected java.util.List<de.jaret.util.date.Interval> |
_selectedIntervals
list of selecetd intervals. |
protected java.util.List<IIntervalRelation> |
_selectedRelations
list of selecetd relations. |
protected java.util.List<TimeBarRow> |
_selectedRows
list of selecetd rows. |
Constructor Summary | |
---|---|
TimeBarSelectionModelImpl()
|
Method Summary | |
---|---|
void |
addSelectedInterval(de.jaret.util.date.Interval interval)
Add an interval to the selection. |
void |
addSelectedRelation(IIntervalRelation relation)
Add an relation to the selection. |
void |
addSelectedRow(TimeBarRow row)
Add a row to the collection of selected rows. |
void |
addTimeBarSelectionListener(TimeBarSelectionListener tbsl)
Add a TimeBarSelectionListener to be informed if the selection is altered. |
void |
clearIntervalSelection()
Clears the selected intervals. |
void |
clearRelationSelection()
Clears the selected relations. |
void |
clearRowSelection()
Clears the selected rows. |
void |
clearSelection()
Clears all selections. |
protected void |
fireElementAdded(java.lang.Object element)
Inform listeners about the addition of a new element in the selection. |
protected void |
fireElementRemoved(java.lang.Object element)
Inform listeners about the removal of an element from the selection. |
protected void |
fireSelectionChanged()
Inform listeners about a general change of the selection. |
boolean |
getMultipleSelectionAllowed()
Retrieves the multiple selection allowance. |
boolean |
getRowSelectionToggleMode()
Retrieve the row selection toggle mode. |
java.util.List<de.jaret.util.date.Interval> |
getSelectedIntervals()
Retrieves the list of currently selected intervals. |
java.util.List<IIntervalRelation> |
getSelectedRelations()
Retrieves the list of currently selected relations. |
java.util.List<TimeBarRow> |
getSelectedRows()
Retrieves the list of currently selected rows. |
boolean |
hasIntervalSelection()
Check whether there are selected intervals. |
boolean |
hasRelationSelection()
Check whether there are selected relations. |
boolean |
hasRowSelection()
Check whether there are selected rows. |
boolean |
isEmpty()
Check whether the selection is completely empty. |
boolean |
isIntervalSelectionAllowed()
Check allowance of interval selections. |
boolean |
isRelationSelectionAllowed()
Check allowance of relation selections. |
boolean |
isRowSelectionAllowed()
Check allowance of row selections. |
boolean |
isSelected(IIntervalRelation relation)
Check whether an inetrval is in the selection. |
boolean |
isSelected(de.jaret.util.date.Interval interval)
Check whether an interval is in the selection. |
boolean |
isSelected(TimeBarRow row)
Check whether a given row is selected. |
void |
remSelectedInterval(de.jaret.util.date.Interval interval)
Remove an interval from the selection. |
void |
remSelectedIntervals(java.util.List<de.jaret.util.date.Interval> intervals)
Remove a list of intervals from the seletion. |
void |
remSelectedRelation(IIntervalRelation relation)
Remove an relation from the selection. |
void |
remSelectedRelations(java.util.List<IIntervalRelation> relations)
Remove a list of relations from the seletion. |
void |
remSelectedRow(TimeBarRow row)
Remove a row from the collection of selected rows. |
void |
remTimeBarSelectionListener(TimeBarSelectionListener tbsl)
Remove a registered Listener. |
void |
setIntervalSelectionAllowed(boolean allowed)
Enable/disable interval selection. |
void |
setMultipleSelectionAllowed(boolean allowed)
If multiple selction is not allowed only one row and one interval may be selected at one time. |
void |
setRelationSelectionAllowed(boolean allowed)
Enable/Disable relation selection. |
void |
setRowSelectionAllowed(boolean allowed)
Enable/Disable row selection. |
void |
setRowSelectionToggleMode(boolean activated)
Enable/dible row selection toggle mode (click toggles selection without modifier keys). |
void |
setSelectedInterval(de.jaret.util.date.Interval interval)
Set the interval as the oly selected interval. |
void |
setSelectedRelation(IIntervalRelation relation)
Set the relation as the oly selected relation. |
void |
setSelectedRow(TimeBarRow row)
Set the row selection to a given row. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.util.List<TimeBarSelectionListener> _listenerList
protected java.util.List<de.jaret.util.date.Interval> _selectedIntervals
protected java.util.List<TimeBarRow> _selectedRows
protected java.util.List<IIntervalRelation> _selectedRelations
protected boolean _rowSelectAllowed
protected boolean _intervalSelectAllow
protected boolean _relationSelectAllow
protected boolean _multiAllowed
protected boolean _rowSelectionToggleMode
Constructor Detail |
---|
public TimeBarSelectionModelImpl()
Method Detail |
---|
public boolean isEmpty()
isEmpty
in interface TimeBarSelectionModel
public boolean hasRowSelection()
hasRowSelection
in interface TimeBarSelectionModel
public boolean hasIntervalSelection()
hasIntervalSelection
in interface TimeBarSelectionModel
public boolean hasRelationSelection()
hasRelationSelection
in interface TimeBarSelectionModel
public java.util.List<TimeBarRow> getSelectedRows()
getSelectedRows
in interface TimeBarSelectionModel
TimeBarRows
public java.util.List<de.jaret.util.date.Interval> getSelectedIntervals()
getSelectedIntervals
in interface TimeBarSelectionModel
Intervals
public java.util.List<IIntervalRelation> getSelectedRelations()
getSelectedRelations
in interface TimeBarSelectionModel
IIntervalRelations
public void setRowSelectionAllowed(boolean allowed)
setRowSelectionAllowed
in interface TimeBarSelectionModel
allowed
- row selection allowed when set to truepublic boolean isRowSelectionAllowed()
isRowSelectionAllowed
in interface TimeBarSelectionModel
true
if row selections are allowedpublic void setIntervalSelectionAllowed(boolean allowed)
setIntervalSelectionAllowed
in interface TimeBarSelectionModel
allowed
- interval selection allowed when set to truepublic boolean isIntervalSelectionAllowed()
isIntervalSelectionAllowed
in interface TimeBarSelectionModel
true
if interval selections are allowedpublic void setRelationSelectionAllowed(boolean allowed)
setRelationSelectionAllowed
in interface TimeBarSelectionModel
allowed
- relation selection allowed when set to truepublic boolean isRelationSelectionAllowed()
isRelationSelectionAllowed
in interface TimeBarSelectionModel
true
if relation selections are allowedpublic void setMultipleSelectionAllowed(boolean allowed)
setMultipleSelectionAllowed
in interface TimeBarSelectionModel
allowed
- true to signal multiple selections are allowedpublic boolean getMultipleSelectionAllowed()
getMultipleSelectionAllowed
in interface TimeBarSelectionModel
public void clearSelection()
clearSelection
in interface TimeBarSelectionModel
public void clearIntervalSelection()
clearIntervalSelection
in interface TimeBarSelectionModel
public void clearRowSelection()
clearRowSelection
in interface TimeBarSelectionModel
public void clearRelationSelection()
clearRelationSelection
in interface TimeBarSelectionModel
public void setSelectedRow(TimeBarRow row)
setSelectedRow
in interface TimeBarSelectionModel
row
- row to be selectedpublic void addSelectedRow(TimeBarRow row)
addSelectedRow
in interface TimeBarSelectionModel
row
- row to be selectedpublic void remSelectedRow(TimeBarRow row)
remSelectedRow
in interface TimeBarSelectionModel
row
- row to be removed from the selectionpublic boolean isSelected(TimeBarRow row)
isSelected
in interface TimeBarSelectionModel
row
- row to check
public void setSelectedInterval(de.jaret.util.date.Interval interval)
setSelectedInterval
in interface TimeBarSelectionModel
interval
- interval that will be the only selected intervalpublic void addSelectedInterval(de.jaret.util.date.Interval interval)
addSelectedInterval
in interface TimeBarSelectionModel
interval
- interval to be added to the selectionpublic void remSelectedInterval(de.jaret.util.date.Interval interval)
remSelectedInterval
in interface TimeBarSelectionModel
interval
- interval to remove from the selectionpublic void remSelectedIntervals(java.util.List<de.jaret.util.date.Interval> intervals)
remSelectedIntervals
in interface TimeBarSelectionModel
intervals
- list of intervals to remove from the selectionpublic boolean isSelected(de.jaret.util.date.Interval interval)
isSelected
in interface TimeBarSelectionModel
interval
- interval to check
public void setSelectedRelation(IIntervalRelation relation)
setSelectedRelation
in interface TimeBarSelectionModel
relation
- relation that will be the only selected relationpublic void addSelectedRelation(IIntervalRelation relation)
addSelectedRelation
in interface TimeBarSelectionModel
relation
- relation to be added to the selectionpublic void remSelectedRelation(IIntervalRelation relation)
remSelectedRelation
in interface TimeBarSelectionModel
relation
- relation to remove from the selectionpublic void remSelectedRelations(java.util.List<IIntervalRelation> relations)
remSelectedRelations
in interface TimeBarSelectionModel
relations
- list of relations to remove from the selectionpublic boolean isSelected(IIntervalRelation relation)
isSelected
in interface TimeBarSelectionModel
relation
- relation to check
public void addTimeBarSelectionListener(TimeBarSelectionListener tbsl)
TimeBarSelectionListener
to be informed if the selection is altered.
addTimeBarSelectionListener
in interface TimeBarSelectionModel
tbsl
- the Listener to be addedpublic void remTimeBarSelectionListener(TimeBarSelectionListener tbsl)
remTimeBarSelectionListener
in interface TimeBarSelectionModel
tbsl
- the listener to be deregisteredprotected void fireSelectionChanged()
protected void fireElementAdded(java.lang.Object element)
element
- newly selected elementprotected void fireElementRemoved(java.lang.Object element)
element
- the removed elementpublic boolean getRowSelectionToggleMode()
getRowSelectionToggleMode
in interface TimeBarSelectionModel
true
for activated toggle modepublic void setRowSelectionToggleMode(boolean activated)
setRowSelectionToggleMode
in interface TimeBarSelectionModel
activated
- true for activated toggle mode
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |