public class BasicTimeConfig extends java.lang.Object implements TimeConfig
| Modifier and Type | Field and Description |
|---|---|
protected MicroSecondTimeRange |
initialTime |
protected double |
scale |
protected DataSetSeismogram[] |
seismograms |
protected java.util.Map |
seismoTimes
seismoTimes contains all of the seismograms held by this config with their current TimeRange |
protected double |
shift |
protected MicroSecondTimeRange |
time |
| Constructor and Description |
|---|
BasicTimeConfig() |
BasicTimeConfig(DataSetSeismogram[] seismos)
Creates a new
BasicTimeConfig instance. |
| Modifier and Type | Method and Description |
|---|---|
void |
add(DataSetSeismogram[] seismos)
add adds a seismogram to the config |
void |
addListener(TimeListener listener)
add adds the listener to the group of objects that are
updated when this time config changes |
void |
clear()
clear removes all seismograms from this receptacle |
boolean |
contains(DataSetSeismogram seismo)
contains checks the receptacle for the presence of seismo |
TimeEvent |
fireTimeEvent()
fireTimeEvent causes the config to prepare a time event and fire it
to all of its TimeEvent objects |
protected TimeEvent |
fireTimeEvent(TimeEvent event) |
protected MicroSecondTimeRange |
getInitialTime(DataSetSeismogram seis) |
protected TimeInterval |
getInterval(DataSetSeismogram seismo) |
double |
getScale() |
DataSetSeismogram[] |
getSeismograms()
returns all of the seismograms held by this receptacle
|
double |
getShift() |
MicroSecondTimeRange |
getTime() |
MicroSecondTimeRange |
getTime(DataSetSeismogram seis) |
void |
remove(DataSetSeismogram[] seismos)
remove removes a seismogram from this object |
void |
removeListener(TimeListener listener)
remove removes listener from the update group |
void |
reset()
reset causes the interval of the config to be set to the total time interval of one of the seismograms
and the rest of the seismograms to be set as if they were just added based on that interval |
void |
reset(DataSetSeismogram[] seismos)
reset causes this seismogram to be set around the current shift and interval |
void |
shaleTime(double shift,
double scale)
shaleTime shifts then scales all the seismograms in the config. |
void |
shaleTime(double shift,
double scale,
DataSetSeismogram[] seismos)
shaleTime performs a shale on the seismograms in the array |
protected java.util.Map seismoTimes
seismoTimes contains all of the seismograms held by this config with their current TimeRangeprotected DataSetSeismogram[] seismograms
protected double shift
protected double scale
protected MicroSecondTimeRange time
protected MicroSecondTimeRange initialTime
public BasicTimeConfig()
public BasicTimeConfig(DataSetSeismogram[] seismos)
BasicTimeConfig instance. The display interval is initialized to be the same as the seismogram
being passedseismo - the initial seismogrampublic void add(DataSetSeismogram[] seismos)
add adds a seismogram to the configadd in interface DataSetSeismogramReceptacleseismo - the seismogram to be addedprotected MicroSecondTimeRange getInitialTime(DataSetSeismogram seis)
public void remove(DataSetSeismogram[] seismos)
remove removes a seismogram from this objectremove in interface DataSetSeismogramReceptacleseismo - the seismogram to be removedpublic void clear()
DataSetSeismogramReceptacleclear removes all seismograms from this receptacleclear in interface DataSetSeismogramReceptaclepublic boolean contains(DataSetSeismogram seismo)
contains checks the receptacle for the presence of seismocontains in interface DataSetSeismogramReceptacleseismo - the seismogram whose presence is to be testedpublic DataSetSeismogram[] getSeismograms()
DataSetSeismogramReceptaclegetSeismograms in interface DataSetSeismogramReceptaclepublic void reset()
reset causes the interval of the config to be set to the total time interval of one of the seismograms
and the rest of the seismograms to be set as if they were just added based on that intervalreset in interface DataSetSeismogramReceptaclepublic void reset(DataSetSeismogram[] seismos)
reset causes this seismogram to be set around the current shift and intervalreset in interface DataSetSeismogramReceptacleseismo - a DataSetSeismogram to be resetpublic void shaleTime(double shift,
double scale)
TimeConfigshaleTime shifts then scales all the seismograms in the config.
First, the shift value is used to move the begin time by shift*timeWidth.
Then the scale value is used to adjust the end time so that the new timeWidth is
scale*timeWidth.
So, if shift = 1 and scale = 2, the shift is applied and the new begin time is equal to the
old end time. Then the time width is modified to be two times its original size. The new
time starts at the old begin time and lasts twice as long.
An adjustment of shift = 0, scale = 1 will leave the seismograms unchanged. A scale value must
be greater than 0, or it will reduce the time width to nothing.shaleTime in interface TimeConfigshift - the percentage of current time width by which the seismograms
will be shiftedscale - the percentage of the current time width that will exist after
the end time is movedpublic void shaleTime(double shift,
double scale,
DataSetSeismogram[] seismos)
TimeConfigshaleTime performs a shale on the seismograms in the arrayshaleTime in interface TimeConfigpublic double getShift()
getShift in interface TimeConfigpublic double getScale()
getScale in interface TimeConfigpublic TimeEvent fireTimeEvent()
TimeConfigfireTimeEvent causes the config to prepare a time event and fire it
to all of its TimeEvent objectsfireTimeEvent in interface TimeConfigpublic MicroSecondTimeRange getTime()
getTime in interface TimeConfigpublic MicroSecondTimeRange getTime(DataSetSeismogram seis)
getTime in interface TimeConfigseis - a DataSetSeismogram a time is desired forpublic void addListener(TimeListener listener)
TimeConfigadd adds the listener to the group of objects that are
updated when this time config changesaddListener in interface TimeConfiglistener - a TimeEventListener that will be updated
as this config changespublic void removeListener(TimeListener listener)
TimeConfigremove removes listener from the update groupremoveListener in interface TimeConfiglistener - a TimeEventListener that will no longer
receive updates from this configprotected TimeInterval getInterval(DataSetSeismogram seismo)