filters
Class Multiplexer

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Panel
                    |
                    +--java.applet.Applet
                          |
                          +--edu.davidson.tools.SApplet
                                |
                                +--filters.Multiplexer
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, edu.davidson.tools.SDataSource, java.io.Serializable

public class Multiplexer
extends SApplet
implements edu.davidson.tools.SDataSource

The Multiplexer Physlet accepts data from multiple data sources and passes this data to other Physlets. A separate data listener is created for each index.

See Also:
Serialized Form

Fields inherited from class edu.davidson.tools.SApplet
clock, dataConnections, dataListeners, dataSources, lock
 
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
Multiplexer()
           
 
Method Summary
 int addDataListener(int index)
          Create a data listener with a given index.
 java.lang.String getAppletInfo()
           
 SApplet getOwner()
          Data source method.
 java.lang.String getParameter(java.lang.String key, java.lang.String def)
           
 java.lang.String[][] getParameterInfo()
           
 double[][] getVariables()
          Data source method.
 java.lang.String[] getVarStrings()
          Data source method.
 void init()
           
 boolean setActiveListener(int index, boolean active)
          Set a data listener to be active.
 void setDefault()
          Sets the default conditions.
 boolean setFunctions(java.lang.String xFunction, java.lang.String yFunction)
          Set the functions of the data listener x and y values.
 void setOwner(SApplet owner)
          Data source method.
 
Methods inherited from class edu.davidson.tools.SApplet
addDataListener, addDataSource, cleanupDataConnections, clearAllData, clearData, deleteDataConnection, deleteDataConnections, destroy, forward, getClockID, getClockTime, getDataConnectionFromDL, getDataConnectionFromDS, getDataFromDS, getDataListener, getDataListener, getDataSource, getDataSource, getID, getRunningID, getSourceData, getSourceVariables, isAutoRefresh, isClockRunning, makeDataConnection, pause, removeDataListener, removeDataSource, reset, reverse, setAutoRefresh, setClockContinous, setClockCycle, setClockOneShot, setClockTime, setConnectionBlock, setConnectionListener, setConnectionSmoothing, setConnectionSource, setConnectionStride, setDt, setExternalClock, setFPS, setRunningID, setRunningID, setTimeContinuous, setTimeCycle, setTimeOneShot, startClock, stepClock, stepTime, stepTimeBack, stepTimeForward, stopClock, updateDataConnection, updateDataConnections
 
Methods inherited from class java.applet.Applet
getAccessibleContext, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus, start, stop
 
Methods inherited from class java.awt.Panel
addNotify
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, remove, remove, removeAll, removeContainerListener, removeNotify, setFont, setLayout, update, validate
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, disable, dispatchEvent, enable, enable, enableInputMethods, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getLocation, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.davidson.tools.SDataSource
getID
 

Constructor Detail

Multiplexer

public Multiplexer()
Method Detail

addDataListener

public int addDataListener(int index)
Create a data listener with a given index. The index is used to identify the variables from each data listener. For example, if the index is 2 then the variables produced by this listener will be x2 and y2.
Parameters:
index - the index
Returns:
the id of the data listener

getAppletInfo

public java.lang.String getAppletInfo()
Overrides:
getAppletInfo in class java.applet.Applet

getOwner

public SApplet getOwner()
Data source method. DO NOT SCRIPT.
Specified by:
getOwner in interface edu.davidson.tools.SDataSource

getParameter

public java.lang.String getParameter(java.lang.String key,
                                     java.lang.String def)

getParameterInfo

public java.lang.String[][] getParameterInfo()
Overrides:
getParameterInfo in class java.applet.Applet

getVariables

public double[][] getVariables()
Data source method. DO NOT SCRIPT.
Specified by:
getVariables in interface edu.davidson.tools.SDataSource

getVarStrings

public java.lang.String[] getVarStrings()
Data source method. DO NOT SCRIPT.
Specified by:
getVarStrings in interface edu.davidson.tools.SDataSource

init

public void init()
Overrides:
init in class java.applet.Applet

setActiveListener

public boolean setActiveListener(int index,
                                 boolean active)
Set a data listener to be active. An active data listener will update all data connections whenever it receives new data.
Parameters:
index -  
active - true will set the listener to be active
Returns:
true if the listener exists, false otherwise

setDefault

public void setDefault()
Sets the default conditions. Destroy all data listeners. Set the clock to zero. Delete data connections.
Overrides:
setDefault in class SApplet

setFunctions

public boolean setFunctions(java.lang.String xFunction,
                            java.lang.String yFunction)
Set the functions of the data listener x and y values.
Parameters:
xFunction - the output function for x
yFunction - the output function for y
Returns:
true if the functions parse correctly

setOwner

public void setOwner(SApplet owner)
Data source method. DO NOT SCRIPT.
Specified by:
setOwner in interface edu.davidson.tools.SDataSource

Copyright Wolfgang Christian

Visit the Davidson CollegePhyslets Page