org.jscience.physics.electricity.circuitry.elements
Class SwitchElement

java.lang.Object
  extended by org.jscience.physics.electricity.circuitry.CircuitElement
      extended by org.jscience.physics.electricity.circuitry.elements.SwitchElement
Direct Known Subclasses:
LogicInputElement, PushSwitchElement, Switch2Element

public class SwitchElement
extends CircuitElement

DOCUMENT ME!


Field Summary
 boolean momentary
          DOCUMENT ME!
 boolean open
          DOCUMENT ME!
 int switchx1
          DOCUMENT ME!
 int switchx2
          DOCUMENT ME!
 int switchy1
          DOCUMENT ME!
 int switchy2
          DOCUMENT ME!
 
Fields inherited from class org.jscience.physics.electricity.circuitry.CircuitElement
boundingBox, circuitFrame, curcount, current, flags, nodes, noDiagonal, volts, voltSource, x, x2, y, y2
 
Constructor Summary
SwitchElement(int xx, int yy)
          Creates a new SwitchElement object.
SwitchElement(int xx, int yy, boolean mm)
          Creates a new SwitchElement object.
SwitchElement(int xa, int ya, int xb, int yb, int f, java.util.StringTokenizer st)
          Creates a new SwitchElement object.
 
Method Summary
 void calculateCurrent()
          DOCUMENT ME!
 void draw(java.awt.Graphics g)
          DOCUMENT ME!
 void drawSwitch(java.awt.Graphics g, int x1, int y1, int x2, int y2, double v1, double v2, boolean open)
          DOCUMENT ME!
 java.lang.String dump()
          DOCUMENT ME!
 boolean getConnection(int n1, int n2)
          DOCUMENT ME!
 int getDumpType()
          DOCUMENT ME!
 EditInfo getEditInfo(int n)
          DOCUMENT ME!
 void getInfo(java.lang.String[] arr)
          DOCUMENT ME!
 int getVoltageSourceCount()
          DOCUMENT ME!
 boolean isWire()
          DOCUMENT ME!
 void mouseUp()
          DOCUMENT ME!
 void setEditValue(int n, EditInfo ei)
          DOCUMENT ME!
 void stamp()
          DOCUMENT ME!
 void toggle()
          DOCUMENT ME!
 
Methods inherited from class org.jscience.physics.electricity.circuitry.CircuitElement
adjustBbox, allocNodes, canViewInScope, doAdjust, doDots, doStep, drag, drawPost, drawPost, drawPosts, drawValues, getBasicInfo, getCircuitFrame, getCurrent, getDumpClass, getInternalNodeCount, getNode, getPost, getPostCount, getPower, getScopeUnits, getScopeValue, getVoltageDiff, getVoltageSource, hasGroundConnection, move, movePoint, nonLinear, reset, setBbox, setCircuitFrame, setCurrent, setNode, setNodeVoltage, setPoints, setPowerColor, setPowerColor, setupAdjust, setVoltageColor, setVoltageSource, startIteration, updateDotCount, updateDotCount
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

open

public boolean open
DOCUMENT ME!


momentary

public boolean momentary
DOCUMENT ME!


switchx1

public int switchx1
DOCUMENT ME!


switchx2

public int switchx2
DOCUMENT ME!


switchy1

public int switchy1
DOCUMENT ME!


switchy2

public int switchy2
DOCUMENT ME!

Constructor Detail

SwitchElement

public SwitchElement(int xx,
                     int yy)
Creates a new SwitchElement object.

Parameters:
xx - DOCUMENT ME!
yy - DOCUMENT ME!

SwitchElement

public SwitchElement(int xx,
                     int yy,
                     boolean mm)
Creates a new SwitchElement object.

Parameters:
xx - DOCUMENT ME!
yy - DOCUMENT ME!
mm - DOCUMENT ME!

SwitchElement

public SwitchElement(int xa,
                     int ya,
                     int xb,
                     int yb,
                     int f,
                     java.util.StringTokenizer st)
Creates a new SwitchElement object.

Parameters:
xa - DOCUMENT ME!
ya - DOCUMENT ME!
xb - DOCUMENT ME!
yb - DOCUMENT ME!
f - DOCUMENT ME!
st - DOCUMENT ME!
Method Detail

getDumpType

public int getDumpType()
DOCUMENT ME!

Overrides:
getDumpType in class CircuitElement
Returns:
DOCUMENT ME!

dump

public java.lang.String dump()
DOCUMENT ME!

Overrides:
dump in class CircuitElement
Returns:
DOCUMENT ME!

draw

public void draw(java.awt.Graphics g)
DOCUMENT ME!

Specified by:
draw in class CircuitElement
Parameters:
g - DOCUMENT ME!

calculateCurrent

public void calculateCurrent()
DOCUMENT ME!

Overrides:
calculateCurrent in class CircuitElement

stamp

public void stamp()
DOCUMENT ME!

Overrides:
stamp in class CircuitElement

getVoltageSourceCount

public int getVoltageSourceCount()
DOCUMENT ME!

Overrides:
getVoltageSourceCount in class CircuitElement
Returns:
DOCUMENT ME!

drawSwitch

public void drawSwitch(java.awt.Graphics g,
                       int x1,
                       int y1,
                       int x2,
                       int y2,
                       double v1,
                       double v2,
                       boolean open)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x1 - DOCUMENT ME!
y1 - DOCUMENT ME!
x2 - DOCUMENT ME!
y2 - DOCUMENT ME!
v1 - DOCUMENT ME!
v2 - DOCUMENT ME!
open - DOCUMENT ME!

mouseUp

public void mouseUp()
DOCUMENT ME!


toggle

public void toggle()
DOCUMENT ME!


getInfo

public void getInfo(java.lang.String[] arr)
DOCUMENT ME!

Overrides:
getInfo in class CircuitElement
Parameters:
arr - DOCUMENT ME!

getConnection

public boolean getConnection(int n1,
                             int n2)
DOCUMENT ME!

Overrides:
getConnection in class CircuitElement
Parameters:
n1 - DOCUMENT ME!
n2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

isWire

public boolean isWire()
DOCUMENT ME!

Overrides:
isWire in class CircuitElement
Returns:
DOCUMENT ME!

getEditInfo

public EditInfo getEditInfo(int n)
DOCUMENT ME!

Overrides:
getEditInfo in class CircuitElement
Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

setEditValue

public void setEditValue(int n,
                         EditInfo ei)
DOCUMENT ME!

Overrides:
setEditValue in class CircuitElement
Parameters:
n - DOCUMENT ME!
ei - DOCUMENT ME!