All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.data2.Waveform

java.lang.Object
   |
   +----crw.data2.Waveform

public class Waveform
extends Object
Class to represent a Waveform as given by a Time Base and one or more Amplitudes. The Amplitude may be displaced along the y-axis by certain amount (offset.)

Version:
1.0
Author:
C.Wie

Constructor Index

 o Waveform(int, int, int)
Constructor.
 o Waveform(XTimeBase, int)
Constructor used when an already existing XTimeBase is to be used.

Method Index

 o draw(Graphics)
Draws each waveform.
 o getTimeBase()
Returns the Time Base object.
 o getWave(int)
Returns one of the Amplitude objects (ith)
 o getWaves()
Returns the Amplitude objects.
 o push(int, int)
One waveform only.
 o push(int, int[])
Checks if the second argument's dimension agrees with the number of waves.
 o put(int)
Puts y-data in the next slot.
 o put(int[])
Puts y-data in the next array index.
 o setXOffset(int)
Sets the y-offset of the waveform plot.
 o setYOffset(int)
Sets the y-offset of the waveform plot.

Constructors

 o Waveform
 public Waveform(XTimeBase t,
                 int noWaves)
Constructor used when an already existing XTimeBase is to be used.

Parameters:
t - the existing time base.
noWaves - number of waves to plot.
 o Waveform
 public Waveform(int length,
                 int offset,
                 int noWaves)
Constructor.

Parameters:
length - the array length in XTimeBase.
offset - coordinate of x-origin.
noWaves - number of waves in this Waveform. They share the time base.

Methods

 o push
 public boolean push(int dtime,
                     int dy[])
Checks if the second argument's dimension agrees with the number of waves. If true, advances the waves by one time step, and returns true. If not agrees, then returns false.

 o push
 public void push(int dtime,
                  int dy)
One waveform only. If more than one, then only the first waveform progresses.

 o put
 public boolean put(int dy[])
Puts y-data in the next array index. This is necessary when multiple Waveform objects share the same XTimeBase object.

 o put
 public void put(int dy)
Puts y-data in the next slot. This method is to be used only if the Amplitudes (Waves) in this object is ONE and only one.

 o draw
 public void draw(Graphics g)
Draws each waveform.

 o getTimeBase
 public XTimeBase getTimeBase()
Returns the Time Base object.

 o getWaves
 public YAmplitude[] getWaves()
Returns the Amplitude objects.

 o getWave
 public YAmplitude getWave(int i)
Returns one of the Amplitude objects (ith)

Parameters:
i - the ith amplitude.
 o setXOffset
 public void setXOffset(int x0)
Sets the y-offset of the waveform plot. Default is the x-axis location.

Parameters:
y0 - the new y-offset.
 o setYOffset
 public void setYOffset(int y0)
Sets the y-offset of the waveform plot. Default is the x-axis location.

Parameters:
y0 - the new y-offset.

All Packages  Class Hierarchy  This Package  Previous  Next  Index