nl.kun.Engine3D
Class TOscilloscope

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--nl.kun.Engine3D.TOscilloscope

public class TOscilloscope
extends java.awt.Canvas

Canvas object that implements an oscilloscope.

See Also:
Serialized Form

Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, componentListener, componentListenerK, componentOrientation, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Constructor Summary
TOscilloscope(int _Width, int _Height, double _maxX, double _minY, double _maxY, java.awt.Color _color)
          Constructor for the oscilloscope object.
 
Method Summary
 void addMeas(double _dx, double _y, double _z, int _DataStream)
          Adds a measurement to datastream _i. you can enter a y and z value belonging to a measurement a time dx farther in time.
 boolean bufferDraw()
          Called by the user to draw the simulation to an offline buffer if there are any buffers ready.
 java.lang.String BufferDrawn2String()
          Used for debugging.
 java.lang.String BufferReady2String()
          Used for debugging.
 void clearDataStream(int _i)
          Clears datastream _i.
 void initGraphics()
          Initialize all the graphics.
 int newDataStream(java.awt.Color _cl)
          Opens a new datastream.
 void paint(java.awt.Graphics g)
          This function paint the buffer to the screen if an offline buffer is ready.
 void redraw()
          This function calls the paint() with a graphics object it gets from the canvas.
 void setActive()
          Activates the simulation.
 void setBoundaries(double _maxX, double _minY, double _maxY)
          (Re)sets the limits of the oscilloscope in physical coordinates
 void setInactive()
          Deactivates the simulation.
 void update(java.awt.Graphics g)
          Called by JVM to redraw the canvas when necessary.
 
Methods inherited from class java.awt.Canvas
, addNotify, constructComponentName, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getIntrinsicCursor, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TOscilloscope

public TOscilloscope(int _Width,
                     int _Height,
                     double _maxX,
                     double _minY,
                     double _maxY,
                     java.awt.Color _color)
Constructor for the oscilloscope object.
Parameters:
_Width - desired width of the oscilloscope in screen coordinates
_Height - desired height of the oscilloscope in screen coordinates
_maxX - Maximum X value to display in the oscilloscope
_minY - Minimum Y value to display in the oscilloscope
_maxY - Maximum Y value to display in the oscilloscope
_color - Color of the object
Method Detail

setBoundaries

public void setBoundaries(double _maxX,
                          double _minY,
                          double _maxY)
(Re)sets the limits of the oscilloscope in physical coordinates
Parameters:
_maxX - Maximum X value to display in the oscilloscope
_minY - Minimum Y value to display in the oscilloscope
_maxY - Maximum Y value to display in the oscilloscope

initGraphics

public void initGraphics()
Initialize all the graphics. This can not be done in the constructor because some details of the canvas are not know at that time. Should be called in the start() subroutine of the applet, everytime the physical boundaries of the canvas are changed, or if you want to reset the buffers.

setActive

public void setActive()
Activates the simulation.

setInactive

public void setInactive()
Deactivates the simulation.

update

public void update(java.awt.Graphics g)
Called by JVM to redraw the canvas when necessary. Never called by user.
Overrides:
update in class java.awt.Component
Parameters:
g - A graphics object (device context)

redraw

public void redraw()
This function calls the paint() with a graphics object it gets from the canvas. It will only paint if there is a buffer ready to be drawn to screen.

bufferDraw

public boolean bufferDraw()
Called by the user to draw the simulation to an offline buffer if there are any buffers ready.

paint

public void paint(java.awt.Graphics g)
This function paint the buffer to the screen if an offline buffer is ready. It should never be called by the user. Instead call redraw().
Overrides:
paint in class java.awt.Canvas

clearDataStream

public void clearDataStream(int _i)
Clears datastream _i.
Parameters:
_i - Index number for the datastream.

addMeas

public void addMeas(double _dx,
                    double _y,
                    double _z,
                    int _DataStream)
Adds a measurement to datastream _i. you can enter a y and z value belonging to a measurement a time dx farther in time.

newDataStream

public int newDataStream(java.awt.Color _cl)
Opens a new datastream. It returns the datastream number to use for this datastream

BufferReady2String

public java.lang.String BufferReady2String()
Used for debugging.

BufferDrawn2String

public java.lang.String BufferDrawn2String()
Used for debugging.