org.jscience.physics.electricity.circuitry
Class CircuitElement

java.lang.Object
  extended by org.jscience.physics.electricity.circuitry.CircuitElement
Direct Known Subclasses:
AnalogSwitchElement, CapacitorElement, ChipElement, CurrentElement, DiodeElement, GateElement, GroundElement, InductorElement, InverterElement, LogicOutputElement, MosfetElement, OpAmpElement, OutputElement, ProbeElement, ResistorElement, SwitchElement, TextElement, TransformerElement, TransistorElement, VoltageElement, WireElement

public abstract class CircuitElement
extends java.lang.Object

DOCUMENT ME!


Field Summary
 java.awt.Rectangle boundingBox
          DOCUMENT ME!
 CircuitFrame circuitFrame
           
 double curcount
          DOCUMENT ME!
 double current
          DOCUMENT ME!
 int flags
          DOCUMENT ME!
 int[] nodes
          DOCUMENT ME!
 boolean noDiagonal
          DOCUMENT ME!
 double[] volts
          DOCUMENT ME!
 int voltSource
          DOCUMENT ME!
 int x
          DOCUMENT ME!
 int x2
          DOCUMENT ME!
 int y
          DOCUMENT ME!
 int y2
          DOCUMENT ME!
 
Constructor Summary
CircuitElement(int xx, int yy)
          Creates a new CircuitElement object.
CircuitElement(int xa, int ya, int xb, int yb, int f)
          Creates a new CircuitElement object.
 
Method Summary
 void adjustBbox(int x1, int y1, int x2, int y2)
          DOCUMENT ME!
 void allocNodes()
          DOCUMENT ME!
 void calculateCurrent()
          DOCUMENT ME!
 boolean canViewInScope()
          DOCUMENT ME!
 void doAdjust()
          DOCUMENT ME!
 void doDots(java.awt.Graphics g)
          DOCUMENT ME!
 void doStep()
          DOCUMENT ME!
 void drag(int xx, int yy)
          DOCUMENT ME!
abstract  void draw(java.awt.Graphics g)
          DOCUMENT ME!
 void drawPost(java.awt.Graphics g, int x0, int y0)
          DOCUMENT ME!
 void drawPost(java.awt.Graphics g, int x0, int y0, int n)
          DOCUMENT ME!
 void drawPosts(java.awt.Graphics g)
          DOCUMENT ME!
 void drawValues(java.awt.Graphics g, java.lang.String s, int xc, int yc, int dpx, int dpy)
          DOCUMENT ME!
 java.lang.String dump()
          DOCUMENT ME!
 void getBasicInfo(java.lang.String[] arr)
          DOCUMENT ME!
 CircuitFrame getCircuitFrame()
           
 boolean getConnection(int n1, int n2)
          DOCUMENT ME!
 double getCurrent()
          DOCUMENT ME!
 java.lang.Class getDumpClass()
          DOCUMENT ME!
 int getDumpType()
          DOCUMENT ME!
 EditInfo getEditInfo(int n)
          DOCUMENT ME!
 void getInfo(java.lang.String[] arr)
          DOCUMENT ME!
 int getInternalNodeCount()
          DOCUMENT ME!
 int getNode(int n)
          DOCUMENT ME!
 java.awt.Point getPost(int n)
          DOCUMENT ME!
 int getPostCount()
          DOCUMENT ME!
 double getPower()
          DOCUMENT ME!
 java.lang.String getScopeUnits(int x)
          DOCUMENT ME!
 double getScopeValue(int x)
          DOCUMENT ME!
 double getVoltageDiff()
          DOCUMENT ME!
 int getVoltageSource()
          DOCUMENT ME!
 int getVoltageSourceCount()
          DOCUMENT ME!
 boolean hasGroundConnection(int n1)
          DOCUMENT ME!
 boolean isWire()
          DOCUMENT ME!
 void move(int dx, int dy)
          DOCUMENT ME!
 void movePoint(int n, int dx, int dy)
          DOCUMENT ME!
 boolean nonLinear()
          DOCUMENT ME!
 void reset()
          DOCUMENT ME!
 void setBbox(int x1, int y1, int x2, int y2)
          DOCUMENT ME!
 void setCircuitFrame(CircuitFrame circuitFrame)
           
 void setCurrent(int x, double c)
          DOCUMENT ME!
 void setEditValue(int n, EditInfo ei)
          DOCUMENT ME!
 void setNode(int p, int n)
          DOCUMENT ME!
 void setNodeVoltage(int n, double c)
          DOCUMENT ME!
 void setPoints()
          DOCUMENT ME!
 void setPowerColor(java.awt.Graphics g, boolean yellow)
          DOCUMENT ME!
 void setPowerColor(java.awt.Graphics g, double w0)
          DOCUMENT ME!
 void setupAdjust()
          DOCUMENT ME!
 void setVoltageColor(java.awt.Graphics g, double volts)
          DOCUMENT ME!
 void setVoltageSource(int n, int v)
          DOCUMENT ME!
 void stamp()
          DOCUMENT ME!
 void startIteration()
          DOCUMENT ME!
 void updateDotCount()
          DOCUMENT ME!
 double updateDotCount(double cur, double cc)
          DOCUMENT ME!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

x

public int x
DOCUMENT ME!


y

public int y
DOCUMENT ME!


x2

public int x2
DOCUMENT ME!


y2

public int y2
DOCUMENT ME!


flags

public int flags
DOCUMENT ME!


nodes

public int[] nodes
DOCUMENT ME!


voltSource

public int voltSource
DOCUMENT ME!


volts

public double[] volts
DOCUMENT ME!


current

public double current
DOCUMENT ME!


curcount

public double curcount
DOCUMENT ME!


boundingBox

public java.awt.Rectangle boundingBox
DOCUMENT ME!


noDiagonal

public boolean noDiagonal
DOCUMENT ME!


circuitFrame

public CircuitFrame circuitFrame
Constructor Detail

CircuitElement

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

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

CircuitElement

public CircuitElement(int xa,
                      int ya,
                      int xb,
                      int yb,
                      int f)
Creates a new CircuitElement object.

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

getDumpType

public int getDumpType()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getCircuitFrame

public CircuitFrame getCircuitFrame()

setCircuitFrame

public void setCircuitFrame(CircuitFrame circuitFrame)

getDumpClass

public java.lang.Class getDumpClass()
DOCUMENT ME!

Returns:
DOCUMENT ME!

allocNodes

public void allocNodes()
DOCUMENT ME!


dump

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

Returns:
DOCUMENT ME!

reset

public void reset()
DOCUMENT ME!


draw

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

Parameters:
g - DOCUMENT ME!

setCurrent

public void setCurrent(int x,
                       double c)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
c - DOCUMENT ME!

getCurrent

public double getCurrent()
DOCUMENT ME!

Returns:
DOCUMENT ME!

doStep

public void doStep()
DOCUMENT ME!


startIteration

public void startIteration()
DOCUMENT ME!


setNodeVoltage

public void setNodeVoltage(int n,
                           double c)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
c - DOCUMENT ME!

calculateCurrent

public void calculateCurrent()
DOCUMENT ME!


setPoints

public void setPoints()
DOCUMENT ME!


drag

public void drag(int xx,
                 int yy)
DOCUMENT ME!

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

move

public void move(int dx,
                 int dy)
DOCUMENT ME!

Parameters:
dx - DOCUMENT ME!
dy - DOCUMENT ME!

movePoint

public void movePoint(int n,
                      int dx,
                      int dy)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
dx - DOCUMENT ME!
dy - DOCUMENT ME!

drawPosts

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

Parameters:
g - DOCUMENT ME!

stamp

public void stamp()
DOCUMENT ME!


getVoltageSourceCount

public int getVoltageSourceCount()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getInternalNodeCount

public int getInternalNodeCount()
DOCUMENT ME!

Returns:
DOCUMENT ME!

setNode

public void setNode(int p,
                    int n)
DOCUMENT ME!

Parameters:
p - DOCUMENT ME!
n - DOCUMENT ME!

setVoltageSource

public void setVoltageSource(int n,
                             int v)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
v - DOCUMENT ME!

getVoltageSource

public int getVoltageSource()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getVoltageDiff

public double getVoltageDiff()
DOCUMENT ME!

Returns:
DOCUMENT ME!

nonLinear

public boolean nonLinear()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getPostCount

public int getPostCount()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getNode

public int getNode(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

getPost

public java.awt.Point getPost(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

drawPost

public void drawPost(java.awt.Graphics g,
                     int x0,
                     int y0,
                     int n)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x0 - DOCUMENT ME!
y0 - DOCUMENT ME!
n - DOCUMENT ME!

drawPost

public void drawPost(java.awt.Graphics g,
                     int x0,
                     int y0)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
x0 - DOCUMENT ME!
y0 - DOCUMENT ME!

setBbox

public void setBbox(int x1,
                    int y1,
                    int x2,
                    int y2)
DOCUMENT ME!

Parameters:
x1 - DOCUMENT ME!
y1 - DOCUMENT ME!
x2 - DOCUMENT ME!
y2 - DOCUMENT ME!

adjustBbox

public void adjustBbox(int x1,
                       int y1,
                       int x2,
                       int y2)
DOCUMENT ME!

Parameters:
x1 - DOCUMENT ME!
y1 - DOCUMENT ME!
x2 - DOCUMENT ME!
y2 - DOCUMENT ME!

drawValues

public void drawValues(java.awt.Graphics g,
                       java.lang.String s,
                       int xc,
                       int yc,
                       int dpx,
                       int dpy)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
s - DOCUMENT ME!
xc - DOCUMENT ME!
yc - DOCUMENT ME!
dpx - DOCUMENT ME!
dpy - DOCUMENT ME!

updateDotCount

public void updateDotCount()
DOCUMENT ME!


updateDotCount

public double updateDotCount(double cur,
                             double cc)
DOCUMENT ME!

Parameters:
cur - DOCUMENT ME!
cc - DOCUMENT ME!
Returns:
DOCUMENT ME!

doDots

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

Parameters:
g - DOCUMENT ME!

doAdjust

public void doAdjust()
DOCUMENT ME!


setupAdjust

public void setupAdjust()
DOCUMENT ME!


getInfo

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

Parameters:
arr - DOCUMENT ME!

getBasicInfo

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

Parameters:
arr - DOCUMENT ME!

setVoltageColor

public void setVoltageColor(java.awt.Graphics g,
                            double volts)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
volts - DOCUMENT ME!

setPowerColor

public void setPowerColor(java.awt.Graphics g,
                          boolean yellow)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
yellow - DOCUMENT ME!

setPowerColor

public void setPowerColor(java.awt.Graphics g,
                          double w0)
DOCUMENT ME!

Parameters:
g - DOCUMENT ME!
w0 - DOCUMENT ME!

getPower

public double getPower()
DOCUMENT ME!

Returns:
DOCUMENT ME!

getScopeValue

public double getScopeValue(int x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

getScopeUnits

public java.lang.String getScopeUnits(int x)
DOCUMENT ME!

Parameters:
x - DOCUMENT ME!
Returns:
DOCUMENT ME!

getEditInfo

public EditInfo getEditInfo(int n)
DOCUMENT ME!

Parameters:
n - DOCUMENT ME!
Returns:
DOCUMENT ME!

setEditValue

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

Parameters:
n - DOCUMENT ME!
ei - DOCUMENT ME!

getConnection

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

Parameters:
n1 - DOCUMENT ME!
n2 - DOCUMENT ME!
Returns:
DOCUMENT ME!

hasGroundConnection

public boolean hasGroundConnection(int n1)
DOCUMENT ME!

Parameters:
n1 - DOCUMENT ME!
Returns:
DOCUMENT ME!

isWire

public boolean isWire()
DOCUMENT ME!

Returns:
DOCUMENT ME!

canViewInScope

public boolean canViewInScope()
DOCUMENT ME!

Returns:
DOCUMENT ME!