public class RTTimeRangeConfig extends java.lang.Object implements TimeConfig, TimeListener
Modifier and Type | Field and Description |
---|---|
static TimeInterval |
DEFAULT_REFRESH |
static TimeInterval |
serverTimeOffset |
protected javax.swing.Timer |
timer
Timers are used for realTime update of the Seismograms
|
protected TimeInterval |
width |
Constructor and Description |
---|
RTTimeRangeConfig(TimeConfig internalConfig) |
RTTimeRangeConfig(TimeConfig internalConfig,
TimeInterval update) |
RTTimeRangeConfig(TimeConfig internalConfig,
TimeInterval update,
float speed) |
Modifier and Type | Method and Description |
---|---|
void |
add(DataSetSeismogram[] seismos)
add adds all of the seismograms in the array to the
receptacle |
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 |
TimeConfig |
getInternalConfig() |
double |
getScale() |
DataSetSeismogram[] |
getSeismograms()
returns all of the seismograms held by this receptacle
|
double |
getShift() |
float |
getSpeed() |
MicroSecondTimeRange |
getTime() |
MicroSecondTimeRange |
getTime(DataSetSeismogram seis) |
void |
remove(DataSetSeismogram[] seismos)
remove removes all of the seismograms in this array |
void |
removeListener(TimeListener listener)
remove removes listener from the update group |
void |
reset()
reset takes all of the seismograms contained in this receptacle and sets
their state as if they had just been added to the receptacle and sets the
instance varaibles of the receptacle back to their initial states
|
void |
reset(DataSetSeismogram[] seismos)
reset takes all of the seismograms in the array and sets
their state as if they had just been initially added to the receptacle |
void |
setInternalConfig(TimeConfig config) |
void |
setSpeed(float speed) |
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 |
void |
startTimer() |
void |
stopTimer() |
void |
updateTime(TimeEvent event) |
public static final TimeInterval serverTimeOffset
protected javax.swing.Timer timer
protected TimeInterval width
public static TimeInterval DEFAULT_REFRESH
public RTTimeRangeConfig(TimeConfig internalConfig)
public RTTimeRangeConfig(TimeConfig internalConfig, TimeInterval update)
public RTTimeRangeConfig(TimeConfig internalConfig, TimeInterval update, float speed)
public void setInternalConfig(TimeConfig config)
public TimeConfig getInternalConfig()
public void add(DataSetSeismogram[] seismos)
DataSetSeismogramReceptacle
add
adds all of the seismograms in the array to the
receptacleadd
in interface DataSetSeismogramReceptacle
seismos
- a DataSetSeismogram[]
containing seismograms to
be added to this receptaclepublic void updateTime(TimeEvent event)
updateTime
in interface TimeListener
public void startTimer()
public void stopTimer()
public void reset()
DataSetSeismogramReceptacle
reset
in interface DataSetSeismogramReceptacle
public void setSpeed(float speed)
public float getSpeed()
public void addListener(TimeListener listener)
TimeConfig
add
adds the listener to the group of objects that are
updated when this time config changesaddListener
in interface TimeConfig
listener
- a TimeEventListener
that will be updated
as this config changespublic void removeListener(TimeListener listener)
TimeConfig
remove
removes listener from the update groupremoveListener
in interface TimeConfig
listener
- a TimeEventListener
that will no longer
receive updates from this configpublic void shaleTime(double shift, double scale, DataSetSeismogram[] seismos)
TimeConfig
shaleTime
performs a shale on the seismograms in the arrayshaleTime
in interface TimeConfig
public void shaleTime(double shift, double scale)
TimeConfig
shaleTime
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 TimeConfig
shift
- 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 remove(DataSetSeismogram[] seismos)
DataSetSeismogramReceptacle
remove
removes all of the seismograms in this arrayremove
in interface DataSetSeismogramReceptacle
seismos
- DataSetSeismogram[]
an array of seismograms to
be removedpublic double getShift()
getShift
in interface TimeConfig
public double getScale()
getScale
in interface TimeConfig
public void reset(DataSetSeismogram[] seismos)
DataSetSeismogramReceptacle
reset
takes all of the seismograms in the array and sets
their state as if they had just been initially added to the receptaclereset
in interface DataSetSeismogramReceptacle
seismos
- a DataSetSeismogram[]
value containing
seismograms to be resetpublic boolean contains(DataSetSeismogram seismo)
DataSetSeismogramReceptacle
contains
checks the receptacle for the presence of seismocontains
in interface DataSetSeismogramReceptacle
seismo
- the seismogram whose presence is to be testedpublic TimeEvent fireTimeEvent()
TimeConfig
fireTimeEvent
causes the config to prepare a time event and fire it
to all of its TimeEvent
objectsfireTimeEvent
in interface TimeConfig
public MicroSecondTimeRange getTime()
getTime
in interface TimeConfig
public MicroSecondTimeRange getTime(DataSetSeismogram seis)
getTime
in interface TimeConfig
seis
- a DataSetSeismogram a time is desired forpublic DataSetSeismogram[] getSeismograms()
DataSetSeismogramReceptacle
getSeismograms
in interface DataSetSeismogramReceptacle
public void clear()
DataSetSeismogramReceptacle
clear
removes all seismograms from this receptacleclear
in interface DataSetSeismogramReceptacle