package gov.nasa.arc.mct.scenario.component;

import gov.nasa.arc.mct.components.AbstractComponent;

import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TreeSet;

public class TimelineComponent extends CostFunctionComponent {
	
	public String getDisplay(){
		return this.getDisplayName();
	}

	private Set<AbstractComponent> modifiedObjects = new HashSet<AbstractComponent>();
	public void addToModifiedObjects(AbstractComponent ac) {
		modifiedObjects.add(ac);
	}
	@Override
	public Set<AbstractComponent> getAllModifiedObjects() {
		return modifiedObjects;
	}
	
	@Override
	public void notifiedSaveAllSuccessful() {
		modifiedObjects.clear();
	}
}
@@ -358,18 +358,48 @@
 mponent 
+implements DurationCapability 
 %7B%0A
-
 %09%0A%09publi
@@ -541,16 +541,228 @@
 ent%3E();%0A
+%09%0A%09@Override%0A%09protected %3CT%3E T handleGetCapability(Class%3CT%3E capability) %7B%0A%09%09if (capability.isAssignableFrom(getClass())) %7B%0A%09%09%09return capability.cast(this);%0A%09%09%7D%0A%09%09return super.handleGetCapability(capability);%0A%09%7D%0A%09%0A
 %09public 
@@ -990,24 +990,24 @@
 cessful() %7B%0A
-
 %09%09modifiedOb
@@ -1024,9 +1024,610 @@
 r();%0A%09%7D%0A
+%09%0A%09@Override%0A%09public long getStart() %7B%09%09%0A%09%09return 0;%0A%09%7D%0A%09@Override%0A%09public long getEnd() %7B%0A%09%09// The end of a Timeline is the end of its last activity%0A%09%09long end = 0;%0A%09%09for (AbstractComponent child : getComponents()) %7B%0A%09%09%09DurationCapability dc = child.getCapability(DurationCapability.class);%0A%09%09%09if (dc != null) %7B%0A%09%09%09%09long childEnd = dc.getEnd();%0A%09%09%09%09if (childEnd %3E end) %7B%0A%09%09%09%09%09end = childEnd;%0A%09%09%09%09%7D%0A%09%09%09%7D%0A%09%09%7D%0A%09%09return end;%0A%09%7D%0A%09@Override%0A%09public void setStart(long start) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%7D%0A%09@Override%0A%09public void setEnd(long end) %7B%0A%09%09// TODO Auto-generated method stub%0A%09%09%0A%09%7D%0A
 %7D

Support DurationCapability in Timeline view