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.


Variable Index

 o data
array of 16 spectrum data points
 o parent
reference to parent applet

Constructor Index

 o SpectrumInput(Spectrum)
Constructs the spectrum input component.

Method Index

 o drawAxes(Graphics)
Draws x and y axes of the spectrum and labels them.
 o drawData(Graphics)
Draws spectrum as a polyline and marks the breakpoints.
 o insets()
Overrides the default insets() method.
 o minimumSize()
Overrides the default minimumSize() method.
 o mouseDrag(Event, int, int)
An internal method used to handle mouse drag events.
 o paint(Graphics)
Paints the spectrum in the current graphics context.
 o preferredSize()
Overrides the default preferredSize() method.

Variables

 o parent
 Spectrum parent
reference to parent applet

 o data
 static float data[]
array of 16 spectrum data points

Constructors

 o SpectrumInput
 public SpectrumInput(Spectrum parent)
Constructs the spectrum input component.

Parameters:
parent - reference to the parent applet.

Methods

 o drawAxes
 void drawAxes(Graphics g)
Draws x and y axes of the spectrum and labels them.

 o drawData
 void drawData(Graphics g)
Draws spectrum as a polyline and marks the breakpoints.

 o paint
 public void paint(Graphics g)
Paints the spectrum in the current graphics context.

Overrides:
paint in class Canvas
 o 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
 o minimumSize
 public Dimension minimumSize()
Overrides the default minimumSize() method.

Returns:
new Dimension
Overrides:
minimumSize in class Component
 o preferredSize
 public Dimension preferredSize()
Overrides the default preferredSize() method.

Returns:
new Dimension
Overrides:
preferredSize in class Component
 o insets
 public Insets insets()
Overrides the default insets() method.

Returns:
new Insets