Class Cell

java.lang.Object
   |
   +----java.awt.Component
           |
           +----Cell

public class Cell
extends Component
implements ToolTips
This class implements one cell of matrix (worksheet) It can contain the electrical component and it deals with all it's graphics


Method Index

 o clearImage(boolean)
 o commandEnabled(String)
 o getContact(Point)
 o getCoords()
 o getElementInfo()
 o getImage()
 o getMinimumSize()
Gets the mininimum size of this component.
 o getPreferredSize()
Gets the preferred size of this component.
 o getTip(int)
Returns tool tip for the cell.
 o getTipLocation(Container)
Returns tool tip location for the cell.
 o haveContact(int)
 o highlightContact(int)
 o initBFS()
 o isAble(int)
 o isEmpty()
 o isSelected()
 o paint(Graphics)
This method is called to draw this component.
 o parseString(String)
This method is called to load new values to element from string.
 o prepareForGraphBuilder()
 o resetAbility(int)
 o Rotate()
 o Rotate(int)
 o setAbility(int)
 o setCoords(Point)
 o setElement(Applet, Element)
 o setElement(Applet, String)
 o setSelected(boolean)
 o setWire(int, int)
 o toString()
Returns a string representation of the object.
 o translateContact(int)
 o update(Graphics)
Updates this component.

Methods

 o clearImage
 public void clearImage(boolean doRepaint)
 o setSelected
 public void setSelected(boolean s)
 o update
 public void update(Graphics g)
Updates this component.

Parameters:
g - the specified context to use for updating.
Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
This method is called to draw this component.

Parameters:
g - the graphics context.
Overrides:
paint in class Component
See Also:
Graphics
 o setElement
 public void setElement(Applet theApplet,
                        String element)
 o setElement
 public void setElement(Applet theApplet,
                        Element toolbarElement)
 o setWire
 public void setWire(int dir1,
                     int dir2)
 o Rotate
 public void Rotate()
 o Rotate
 public void Rotate(int newAngle)
 o commandEnabled
 public boolean commandEnabled(String command)
 o toString
 public String toString()
Returns a string representation of the object.

Returns:
a string representation of the object.
Overrides:
toString in class Component
 o haveContact
 public boolean haveContact(int direction)
 o translateContact
 public int translateContact(int direction)
 o getContact
 public int getContact(Point p)
 o highlightContact
 public void highlightContact(int contact)
 o getMinimumSize
 public Dimension getMinimumSize()
Gets the mininimum size of this component.

Returns:
A dimension object indicating this component's minimum size.
Overrides:
getMinimumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Gets the preferred size of this component.

Returns:
A dimension object indicating this component's preferred size.
Overrides:
getPreferredSize in class Component
 o getCoords
 public Point getCoords()
 o setAbility
 public void setAbility(int ability)
 o setCoords
 public void setCoords(Point coords)
 o resetAbility
 public void resetAbility(int ability)
 o isEmpty
 public boolean isEmpty()
 o isSelected
 public boolean isSelected()
 o isAble
 public boolean isAble(int feature)
 o initBFS
 public void initBFS()
 o prepareForGraphBuilder
 public void prepareForGraphBuilder()
 o parseString
 public void parseString(String line) throws ParseException
This method is called to load new values to element from string. String should be like "[x=0,y=0,angle=0];Element[elementParams]".

Parameters:
values - new values for element in string in format given above.
Throws: ParseException
if string format is incorrect.
 o getImage
 public Image getImage()
 o getElementInfo
 public String[] getElementInfo()
 o getTip
 public String getTip(int type)
Returns tool tip for the cell. Tip is from cell's element.

Returns:
tool tip.
 o getTipLocation
 public Point getTipLocation(Container painter)
Returns tool tip location for the cell.

Parameters:
painter - container which paints the tip.
Returns:
desired location for tool tip.