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
-
CktElement()
- Constructor.
-
deleteNameAt()
- Sets the name location field to null.
-
draw(Graphics)
- Draws the element.
-
drawName(Graphics)
- Draws the name of this circuit element at suitable location.
-
getConnected()
- Returns info whether the ports are connected with wires.
-
getName()
- Returns the name of this element.
-
getPorts()
- Returns the array of point objects for all ports on this element.
-
initConnected()
- initializes the boolean info on connection for every port.
-
setConnected(int, boolean)
- Specifies the port if connected or not by a wire.
-
setName(String)
- Sets the name.
-
setNameAt(FontMetrics)
- Sets the default name location.
-
setNameAt(Point)
- It sets the name location to a new one.
-
setPorts(Point[])
- Called by constructor or other public methods.
CktElement
protected CktElement()
- Constructor. Can be called by subclass constructors only.
draw
public abstract void draw(Graphics g)
- Draws the element.
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.
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.
getConnected
public boolean[] getConnected()
- Returns info whether the ports are connected with wires.
initConnected
public void initConnected()
- initializes the boolean info on connection for every port.
It inits the info to false.
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.
drawName
public void drawName(Graphics g)
- Draws the name of this circuit element at suitable location.
getName
public String getName()
- Returns the name of this element.
setName
public void setName(String nm)
- Sets the name.
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
deleteNameAt
protected void deleteNameAt()
- Sets the name location field to null. This is sometimes necessary
in some of the methods.
setNameAt
protected abstract void setNameAt(FontMetrics fm)
- Sets the default name location.
All Packages Class Hierarchy This Package Previous Next Index