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
-
Waveform(int, int, int)
- Constructor.
-
Waveform(XTimeBase, int)
- Constructor used when an already existing XTimeBase
is to be used.
-
draw(Graphics)
- Draws each waveform.
-
getTimeBase()
- Returns the Time Base object.
-
getWave(int)
- Returns one of the Amplitude objects (ith)
-
getWaves()
- Returns the Amplitude objects.
-
push(int, int)
- One waveform only.
-
push(int, int[])
- Checks if the second argument's dimension agrees with the
number of waves.
-
put(int)
- Puts y-data in the next slot.
-
put(int[])
- Puts y-data in the next array index.
-
setXOffset(int)
- Sets the y-offset of the waveform plot.
-
setYOffset(int)
- Sets the y-offset of the waveform plot.
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.
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.
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.
push
public void push(int dtime,
int dy)
- One waveform only. If more than one, then only the first
waveform progresses.
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.
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.
draw
public void draw(Graphics g)
- Draws each waveform.
getTimeBase
public XTimeBase getTimeBase()
- Returns the Time Base object.
getWaves
public YAmplitude[] getWaves()
- Returns the Amplitude objects.
getWave
public YAmplitude getWave(int i)
- Returns one of the Amplitude objects (ith)
- Parameters:
- i - the ith amplitude.
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.
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