|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jaret.util.ui.timebars.strategy.DefaultOverlapStrategy
public class DefaultOverlapStrategy
Default implementation of an overlap strategy that does a complete check on overlaps between intervals including transitive overlaps. This can be time consuming when dealing with a lot of intervals. Thanks go to Mathias Kurt for supplying an optimized algorithm for computing the overlapping quite fast.
| Field Summary | |
|---|---|
protected boolean |
_assumeSortedIntervals
if set to false, intervals will be sorted before checking overlapping. |
protected TimeBarViewerDelegate |
_delegate
the delegate the strategy works for. |
protected java.util.Map<TimeBarRow,java.util.Map<de.jaret.util.date.Interval,OverlapInfo>> |
_oiRowCache
Cache for overlap infos. |
| Constructor Summary | |
|---|---|
DefaultOverlapStrategy(TimeBarViewerDelegate delegate)
Construct a default strategy for a specific delegate. |
|
| Method Summary | |
|---|---|
void |
clearCachedData()
Clear all cached data. |
void |
dispose()
Called when a strategy is no loner used. |
boolean |
getAssumeSortedIntervals()
Retrieve the status of assumeSortedIntervals. |
int |
getMaxOverlapCount(TimeBarRow row)
Retrieve tha maximal count of overlapping intervals in a row. |
OverlapInfo |
getOverlapInfo(TimeBarRow row,
de.jaret.util.date.Interval interval)
Retrieve the information about overlapping intervals and drawing position for a given interval. |
void |
setAssumeSortedIntervals(boolean assumeSortedIntervals)
If set to false intervals will be sorted often ... defaults to true. |
java.util.Map<de.jaret.util.date.Interval,OverlapInfo> |
updateOICache(TimeBarRow row)
Calculate the number of overlapping intervals and determine the positions to draw them on. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected TimeBarViewerDelegate _delegate
protected java.util.Map<TimeBarRow,java.util.Map<de.jaret.util.date.Interval,OverlapInfo>> _oiRowCache
protected boolean _assumeSortedIntervals
| Constructor Detail |
|---|
public DefaultOverlapStrategy(TimeBarViewerDelegate delegate)
delegate - the delegate the strategy works for| Method Detail |
|---|
public OverlapInfo getOverlapInfo(TimeBarRow row,
de.jaret.util.date.Interval interval)
getOverlapInfo in interface IOverlapStrategyrow - row of the intervalinterval - interval
public int getMaxOverlapCount(TimeBarRow row)
getMaxOverlapCount in interface IOverlapStrategyrow - row to check
public java.util.Map<de.jaret.util.date.Interval,OverlapInfo> updateOICache(TimeBarRow row)
assumeSortedIntervals is set to false.
updateOICache in interface IOverlapStrategyrow - row to update the cache for
public void clearCachedData()
clearCachedData in interface IOverlapStrategypublic void dispose()
dispose in interface IOverlapStrategypublic boolean getAssumeSortedIntervals()
public void setAssumeSortedIntervals(boolean assumeSortedIntervals)
assumeSortedIntervals - the new status
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||