edu.sc.seis.fissuresUtil.display.registrar
Class BasicAmpConfig

java.lang.Object
  extended by edu.sc.seis.fissuresUtil.display.registrar.BasicAmpConfig
All Implemented Interfaces:
AmpConfig, DataSetSeismogramReceptacle, TimeListener, java.util.EventListener
Direct Known Subclasses:
RMeanAmpConfig

public class BasicAmpConfig
extends java.lang.Object
implements AmpConfig

BasicAmpConfig.java Created: Fri Aug 30 10:35:20 2002


Constructor Summary
BasicAmpConfig()
           
BasicAmpConfig(DataSetSeismogram[] seismos)
           
 
Method Summary
 void add(DataSetSeismogram[] seismos)
          add is the method used to add a seismogram to this object
 void addListener(AmpListener listener)
          addListener causes listener to receive updates when this AmpConfig changes
 AmpEvent calculate()
           
 void clear()
          clear removes all seismograms from this receptacle
 boolean contains(DataSetSeismogram seismo)
          contains checks the receptacle for the presence of seismo
 void fireAmpEvent()
          fireAmpEvent makes the AmpConfig create a new AmpEvent reflecting its current internal state and send it to all AmpListeners
 edu.iris.Fissures.model.UnitRangeImpl getAmp()
           
 edu.iris.Fissures.model.UnitRangeImpl getAmp(DataSetSeismogram seis)
           
 AmpConfigData[] getAmpData()
           
 AmpConfigData getAmpData(DataSetSeismogram seis)
           
 AmpListener[] getAmpListeners()
           
 DataSetSeismogram[] getSeismograms()
          returns all of the seismograms held by this receptacle
 DataSetSeismogram[] getSeismograms(AmpConfigData[] ampData)
           
 AmpEvent recalculate()
           
 void remove(DataSetSeismogram[] seismos)
          remove removes seismograms from this object
 void removeListener(AmpListener listener)
          removeListener causes listener to no longer receive updates from this AmpConfig
 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
protected  boolean setAmpRange(AmpConfigData data)
           
 void shaleAmp(double shift, double scale)
          shaleAmp shifts then scales all the seismograms in the config.
 void shaleAmp(double shift, double scale, DataSetSeismogram[] seismos)
          shaleAmp performs a shaleAmp on the seismograms in the array
 java.lang.String toString()
           
 void updateTime(TimeEvent timeEvent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

BasicAmpConfig

public BasicAmpConfig()

BasicAmpConfig

public BasicAmpConfig(DataSetSeismogram[] seismos)
Method Detail

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

add

public void add(DataSetSeismogram[] seismos)
add is the method used to add a seismogram to this object

Specified by:
add in interface DataSetSeismogramReceptacle
Parameters:
seismo - the seismogram to be added

remove

public void remove(DataSetSeismogram[] seismos)
remove removes seismograms from this object

Specified by:
remove in interface DataSetSeismogramReceptacle
Parameters:
seismo - the seismograms to be removed

clear

public void clear()
Description copied from interface: DataSetSeismogramReceptacle
clear removes all seismograms from this receptacle

Specified by:
clear in interface DataSetSeismogramReceptacle

getSeismograms

public DataSetSeismogram[] getSeismograms()
Description copied from interface: DataSetSeismogramReceptacle
returns all of the seismograms held by this receptacle

Specified by:
getSeismograms in interface DataSetSeismogramReceptacle
Returns:
an array containing all of this receptacles seismograms

getSeismograms

public DataSetSeismogram[] getSeismograms(AmpConfigData[] ampData)

getAmp

public edu.iris.Fissures.model.UnitRangeImpl getAmp()
Specified by:
getAmp in interface AmpConfig

getAmp

public edu.iris.Fissures.model.UnitRangeImpl getAmp(DataSetSeismogram seis)
Specified by:
getAmp in interface AmpConfig

getAmpData

public AmpConfigData[] getAmpData()
Specified by:
getAmpData in interface AmpConfig

getAmpData

public AmpConfigData getAmpData(DataSetSeismogram seis)
Specified by:
getAmpData in interface AmpConfig

contains

public boolean contains(DataSetSeismogram seismo)
contains checks the receptacle for the presence of seismo

Specified by:
contains in interface DataSetSeismogramReceptacle
Parameters:
seismo - the seismogram whose presence is to be tested
Returns:
true if the receptacle contains seismo, false otherwise

reset

public void reset()
Description copied from interface: DataSetSeismogramReceptacle
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

Specified by:
reset in interface DataSetSeismogramReceptacle

reset

public void reset(DataSetSeismogram[] seismos)
Description copied from interface: DataSetSeismogramReceptacle
reset takes all of the seismograms in the array and sets their state as if they had just been initially added to the receptacle

Specified by:
reset in interface DataSetSeismogramReceptacle
Parameters:
seismos - a DataSetSeismogram[] value containing seismograms to be reset

shaleAmp

public void shaleAmp(double shift,
                     double scale)
Description copied from interface: AmpConfig
shaleAmp shifts then scales all the seismograms in the config. First, the shift value is used to move the amp range by shift*amp range. Then the scale value is used to adjust the high amp value so that the new amp range is scale*amp range. So, if shift = 1 and scale = 2, the shift is applied and the new low end on the amp range is equal to the old high value. Then the range itself is modified to be two times its original size. The new range starts at the old low end and is twice as wide 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 range to nothing.

Specified by:
shaleAmp in interface AmpConfig
Parameters:
shift - the percentage of current amp range by which the seismograms will be shifted
scale - the percentage of the current amp range that will exist after the high end is adjusted

shaleAmp

public void shaleAmp(double shift,
                     double scale,
                     DataSetSeismogram[] seismos)
Description copied from interface: AmpConfig
shaleAmp performs a shaleAmp on the seismograms in the array

Specified by:
shaleAmp in interface AmpConfig

fireAmpEvent

public void fireAmpEvent()
Description copied from interface: AmpConfig
fireAmpEvent makes the AmpConfig create a new AmpEvent reflecting its current internal state and send it to all AmpListeners

Specified by:
fireAmpEvent in interface AmpConfig

addListener

public void addListener(AmpListener listener)
Description copied from interface: AmpConfig
addListener causes listener to receive updates when this AmpConfig changes

Specified by:
addListener in interface AmpConfig

removeListener

public void removeListener(AmpListener listener)
Description copied from interface: AmpConfig
removeListener causes listener to no longer receive updates from this AmpConfig

Specified by:
removeListener in interface AmpConfig

getAmpListeners

public AmpListener[] getAmpListeners()

updateTime

public void updateTime(TimeEvent timeEvent)
Specified by:
updateTime in interface TimeListener

calculate

public AmpEvent calculate()
Specified by:
calculate in interface AmpConfig

recalculate

public AmpEvent recalculate()

setAmpRange

protected boolean setAmpRange(AmpConfigData data)