public class DefaultTimeLineModel extends Object implements TimeLineModel
This code was developed by NASA, Goddard Space Flight Center, Code 588 for the Scientist's Expert Assistant (SEA) project.
Modifier and Type | Field and Description |
---|---|
protected List |
fChangeListeners |
protected PropertyChangeListener |
fMyChildListener |
protected List |
fNodes |
protected Comparator |
sComparator |
ALL_NODES_REMOVED, NODE_ADDED, NODE_REMOVED
Constructor and Description |
---|
DefaultTimeLineModel(int interval)
constructor
|
DefaultTimeLineModel(int start,
int end,
int intervals)
constructor
|
DefaultTimeLineModel(Time start,
Time end,
int intervals)
constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener)
add a property change listener to the time line.
|
void |
addTimeLineNode(TimeLineNodeModel node)
add a time line node to the time line without checking its legality
|
boolean |
contains(TimeLineNodeModel model)
returns whether or not the model contains the specified node
|
protected void |
firePropertyChange(PropertyChangeEvent evt)
fires a change event to all listeners of the timeline
|
Date |
getDateForTime(Time time)
takes a time and converts it into a date where the new date is
equal to the start date + the time
|
Time |
getEndTime()
get the ending value of the timeline
|
int |
getIntervalCount()
get the number of intervals in the time line
|
Date |
getStartDate()
get the start date
|
Time |
getStartTime()
get the starting value in the timeline
|
Time |
getTimeForDate(Date date)
takes a date and convert it to a time where the new time is
equal to the date - start date
|
List |
getTimeLineNodes()
get the time line node models in a uneditable list
|
Iterator |
getTimeLineNodesIterator()
get an iterator for the time line node models
|
void |
removeAllTimeLineNodes()
remove all time line nodes from time line
|
void |
removePropertyChangeListener(PropertyChangeListener listener)
remove a property change listener from the time line
|
void |
removeTimeLineNode(TimeLineNodeModel node)
remove a time line node from the time line
|
void |
setStartDate(Date date)
set the date from which the timeline should start
Note: if the date is not null then all time values are considered offsets from it
|
protected void |
updateExternal() |
protected Comparator sComparator
protected List fNodes
protected List fChangeListeners
protected PropertyChangeListener fMyChildListener
public DefaultTimeLineModel(int interval)
interval
- the number of intervals in a 50 minute time linepublic DefaultTimeLineModel(int start, int end, int intervals)
start
- the starting minute of the timelineend
- the ending minute of the timelineintervals
- the number of intervals on the timelinepublic void addTimeLineNode(TimeLineNodeModel node)
addTimeLineNode
in interface TimeLineModel
public void removeTimeLineNode(TimeLineNodeModel node)
removeTimeLineNode
in interface TimeLineModel
public void removeAllTimeLineNodes()
removeAllTimeLineNodes
in interface TimeLineModel
public int getIntervalCount()
getIntervalCount
in interface TimeLineModel
public Iterator getTimeLineNodesIterator()
getTimeLineNodesIterator
in interface TimeLineModel
public List getTimeLineNodes()
getTimeLineNodes
in interface TimeLineModel
public void addPropertyChangeListener(PropertyChangeListener listener)
addPropertyChangeListener
in interface TimeLineModel
public void removePropertyChangeListener(PropertyChangeListener listener)
removePropertyChangeListener
in interface TimeLineModel
public Date getDateForTime(Time time)
getDateForTime
in interface TimeLineModel
public Time getTimeForDate(Date date)
getTimeForDate
in interface TimeLineModel
public void setStartDate(Date date)
setStartDate
in interface TimeLineModel
public Date getStartDate()
getStartDate
in interface TimeLineModel
public Time getStartTime()
getStartTime
in interface TimeLineModel
public Time getEndTime()
getEndTime
in interface TimeLineModel
protected void firePropertyChange(PropertyChangeEvent evt)
public boolean contains(TimeLineNodeModel model)
contains
in interface TimeLineModel
protected void updateExternal()
Copyright © 2023 Central Laboratory of the Research Councils. All Rights Reserved.