All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class crw.circuit.symbol.CktElement

java.lang.Object
   |
   +----crw.circuit.symbol.CktElement

public abstract class CktElement
extends Object
The universal superclass of all circuit symbol classes including dummy wire class. Its basic service include providing ports to connect wires to, whether a given port is connected or not, and setting/drawing the element name at an appropriate location.

Version:
1.0 8/11/99
Author:
C.R.Wie

Constructor Index

 o CktElement()
Constructor.

Method Index

 o deleteNameAt()
Sets the name location field to null.
 o draw(Graphics)
Draws the element.
 o drawName(Graphics)
Draws the name of this circuit element at suitable location.
 o getConnected()
Returns info whether the ports are connected with wires.
 o getName()
Returns the name of this element.
 o getPorts()
Returns the array of point objects for all ports on this element.
 o initConnected()
initializes the boolean info on connection for every port.
 o setConnected(int, boolean)
Specifies the port if connected or not by a wire.
 o setName(String)
Sets the name.
 o setNameAt(FontMetrics)
Sets the default name location.
 o setNameAt(Point)
It sets the name location to a new one.
 o setPorts(Point[])
Called by constructor or other public methods.

Constructors

 o CktElement
 protected CktElement()
Constructor. Can be called by subclass constructors only.

Methods

 o draw
 public abstract void draw(Graphics g)
Draws the element.

 o setPorts
 protected void setPorts(Point p[])
Called by constructor or other public methods. Sets the ports to this element. Only necessary to be used in concrete subclasses.

 o getPorts
 public Point[] getPorts()
Returns the array of point objects for all ports on this element. The port is defined as the position where the wires are attached.

 o getConnected
 public boolean[] getConnected()
Returns info whether the ports are connected with wires.

 o initConnected
 public void initConnected()
initializes the boolean info on connection for every port. It inits the info to false.

 o setConnected
 public void setConnected(int i,
                          boolean con)
Specifies the port if connected or not by a wire.

Parameters:
i - port number
con - whether connected or not.
 o drawName
 public void drawName(Graphics g)
Draws the name of this circuit element at suitable location.

 o getName
 public String getName()
Returns the name of this element.

 o setName
 public void setName(String nm)
Sets the name.

 o setNameAt
 public void setNameAt(Point p)
It sets the name location to a new one. The default location is set by the setNameAt(fm) method.

See Also:
setNameAt
 o deleteNameAt
 protected void deleteNameAt()
Sets the name location field to null. This is sometimes necessary in some of the methods.

 o setNameAt
 protected abstract void setNameAt(FontMetrics fm)
Sets the default name location.


All Packages  Class Hierarchy  This Package  Previous  Next  Index