Class SpectrumInput
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Canvas
|
+----CanvasDB
|
+----SpectrumInput
- class SpectrumInput
- extends CanvasDB
This class produces a non-flicker canvas that allows free-hand
drawing of a spectrum. The spectrum consists of 16 data points.
-
data
- array of 16 spectrum data points
-
parent
- reference to parent applet
-
SpectrumInput(Spectrum)
- Constructs the spectrum input component.
-
drawAxes(Graphics)
- Draws x and y axes of the spectrum and labels them.
-
drawData(Graphics)
- Draws spectrum as a polyline and marks the breakpoints.
-
insets()
- Overrides the default insets() method.
-
minimumSize()
- Overrides the default minimumSize() method.
-
mouseDrag(Event, int, int)
- An internal method used to handle mouse drag events.
-
paint(Graphics)
- Paints the spectrum in the current graphics context.
-
preferredSize()
- Overrides the default preferredSize() method.
parent
Spectrum parent
- reference to parent applet
data
static float data[]
- array of 16 spectrum data points
SpectrumInput
public SpectrumInput(Spectrum parent)
- Constructs the spectrum input component.
- Parameters:
- parent - reference to the parent applet.
drawAxes
void drawAxes(Graphics g)
- Draws x and y axes of the spectrum and labels them.
drawData
void drawData(Graphics g)
- Draws spectrum as a polyline and marks the breakpoints.
paint
public void paint(Graphics g)
- Paints the spectrum in the current graphics context.
- Overrides:
- paint in class Canvas
mouseDrag
public boolean mouseDrag(Event e,
int x,
int y)
- An internal method used to handle mouse drag events.
Spectrum is updated and repainted.
- Overrides:
- mouseDrag in class Component
minimumSize
public Dimension minimumSize()
- Overrides the default minimumSize() method.
- Returns:
- new Dimension
- Overrides:
- minimumSize in class Component
preferredSize
public Dimension preferredSize()
- Overrides the default preferredSize() method.
- Returns:
- new Dimension
- Overrides:
- preferredSize in class Component
insets
public Insets insets()
- Overrides the default insets() method.
- Returns:
- new Insets