more refactoring

This commit is contained in:
Brian Carrier 2019-07-02 08:48:37 -04:00
parent 4eec6450b8
commit edf755ac58
2 changed files with 8 additions and 8 deletions

View File

@ -191,25 +191,25 @@ final class EventClusterNode extends MultiEventNodeBase<EventCluster, EventStrip
Task<List<EventStripe>> loggedTask; Task<List<EventStripe>> loggedTask;
loggedTask = new LoggedTask<List<EventStripe>>(Bundle.EventClusterNode_loggedTask_name(), false) { loggedTask = new LoggedTask<List<EventStripe>>(Bundle.EventClusterNode_loggedTask_name(), false) {
private volatile TimelineEvent.DescriptionLevel loadedDescription = withRelativeDetail(getDescriptionLevel(), relativeDetail); private volatile TimelineEvent.DescriptionLevel loadedDescriptionLevel = withRelativeDetail(getDescriptionLevel(), relativeDetail);
@Override @Override
protected List<EventStripe> call() throws Exception { protected List<EventStripe> call() throws Exception {
//newly loaded substripes //newly loaded substripes
List<EventStripe> stripes; List<EventStripe> stripes;
//next LoD in diraction of given relativeDetail //next LoD in diraction of given relativeDetail
TimelineEvent.DescriptionLevel next = loadedDescription; TimelineEvent.DescriptionLevel next = loadedDescriptionLevel;
do { do {
loadedDescription = next; loadedDescriptionLevel = next;
if (loadedDescription == getEvent().getDescriptionLevel()) { if (loadedDescriptionLevel == getEvent().getDescriptionLevel()) {
//if we are back at the level of detail of the original cluster, return empty list to inidicate. //if we are back at the level of detail of the original cluster, return empty list to inidicate.
return Collections.emptyList(); return Collections.emptyList();
} }
//query for stripes at the desired level of detail //query for stripes at the desired level of detail
stripes = chartLane.getParentChart().getDetailsViewModel().getEventStripes(descriptionFilter, zoom.withDescrLOD(loadedDescription)); stripes = chartLane.getParentChart().getDetailsViewModel().getEventStripes(descriptionFilter, zoom.withDescrLOD(loadedDescriptionLevel));
//setup next for subsequent go through the "do" loop //setup next for subsequent go through the "do" loop
next = withRelativeDetail(loadedDescription, relativeDetail); next = withRelativeDetail(loadedDescriptionLevel, relativeDetail);
} while (stripes.size() == 1 && nonNull(next)); //keep going while there was only on stripe and we havne't reached the end of the LoD continuum. } while (stripes.size() == 1 && nonNull(next)); //keep going while there was only on stripe and we havne't reached the end of the LoD continuum.
// return list of EventStripes with parents set to this cluster // return list of EventStripes with parents set to this cluster
@ -227,7 +227,7 @@ final class EventClusterNode extends MultiEventNodeBase<EventCluster, EventStrip
subNodes.clear(); subNodes.clear();
try { try {
setDescriptionLOD(loadedDescription); setDescriptionLOD(loadedDescriptionLevel);
List<EventStripe> newSubStripes = get(); List<EventStripe> newSubStripes = get();
if (newSubStripes.isEmpty()) { if (newSubStripes.isEmpty()) {
//restore original display //restore original display

View File

@ -153,7 +153,7 @@ final public class DetailsViewModel {
* @throws org.sleuthkit.datamodel.TskCoreException If there is an error * @throws org.sleuthkit.datamodel.TskCoreException If there is an error
* querying the db. * querying the db.
*/ */
List<TimelineEvent> getEvents(ZoomState zoom, DateTimeZone timeZone) throws TskCoreException { private List<TimelineEvent> getEvents(ZoomState zoom, DateTimeZone timeZone) throws TskCoreException {
//unpack params //unpack params
Interval timeRange = zoom.getTimeRange(); Interval timeRange = zoom.getTimeRange();
TimelineFilter.RootFilter activeFilter = zoom.getFilterState().getActiveFilter(); TimelineFilter.RootFilter activeFilter = zoom.getFilterState().getActiveFilter();