com.softsynth.jsyn.view102
Class WaveDisplay

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by com.softsynth.jsyn.view102.WaveDisplay
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
WaveDisplay

public class WaveDisplay
extends java.awt.Canvas

This class draws an associated short array as a waveform. Waveforms are added in the form of a WaveTrace object. The left and right indices can be set to provide zoom and pan.

Author:
(C) 1997 Phil Burk, SoftSynth.com, All Rights Reserved
See Also:
WaveTrace, Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.BaselineResizeBehavior
 
Field Summary
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
WaveDisplay()
          Create WaveDisplay.
 
Method Summary
 void addTrace(WaveTrace trace)
          Add another trace to be displayed when this component is drawn.
 int getLeftIndex()
           
 int getRightIndex()
           
 void paint(java.awt.Graphics g)
          Draw WaveTraces in their specified colors and using the specified scaleFactors.
 void panLeft()
          Pan the display to the left by half the currently displayed amount.
 void panLeft(int delta)
          Pan the display to the left by delta.
 void panRight()
          Pan the display to the right by half the currently displayed amount.
 void panRight(int delta)
          Pan the display to the right by delta.
 void removeTrace(WaveTrace trace)
           
 void setLeftIndex(int left)
          Set index of leftmost displayed point in traces.
 void setRightIndex(int right)
          Set index of rightmost displayed point in traces.
 void zoomIn()
           
 void zoomOut()
           
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, dispatchEvent, doLayout, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

WaveDisplay

public WaveDisplay()
Create WaveDisplay.

Method Detail

setLeftIndex

public void setLeftIndex(int left)
Set index of leftmost displayed point in traces.


getLeftIndex

public int getLeftIndex()

setRightIndex

public void setRightIndex(int right)
Set index of rightmost displayed point in traces.


getRightIndex

public int getRightIndex()

panLeft

public void panLeft(int delta)
Pan the display to the left by delta.


panLeft

public void panLeft()
Pan the display to the left by half the currently displayed amount.


panRight

public void panRight(int delta)
Pan the display to the right by delta.


panRight

public void panRight()
Pan the display to the right by half the currently displayed amount.


zoomIn

public void zoomIn()

zoomOut

public void zoomOut()

addTrace

public void addTrace(WaveTrace trace)
Add another trace to be displayed when this component is drawn. Multiple traces can be displayed simultaneously. You can set the traces' colors to distinguish them.


removeTrace

public void removeTrace(WaveTrace trace)

paint

public void paint(java.awt.Graphics g)
Draw WaveTraces in their specified colors and using the specified scaleFactors. This function is normally only called by the Java graphics system. If you want to redraw the display because a trace has changed, then call repaint().

Overrides:
paint in class java.awt.Canvas