Class Matrix

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----Matrix

public class Matrix
extends Container
implements ActionListener, MouseListener, MouseMotionListener, ToolTips
This is the main class for worksheet (matrix) and for simulation. It creates circuit's graph and makes calculations (iterations)


Method Index

 o actionPerformed(ActionEvent)
Processes action events occurring on this component.
 o addActionListener(ActionListener)
Adds the specified action listener to receive action events from this component.
 o buildGraph()
 o endSimulation()
 o getProbes()
 o getTip(int)
Returns tool tip for the matrix.
 o getTipLocation(Container)
Returns tool tip location for the matrix.
 o loadCircuit(String)
 o log()
 o makeIteration()
 o mouseClicked(MouseEvent)
Handles the mouseClicked event - invokes properties dialog for double clicked element.
 o mouseDragged(MouseEvent)
Handles the mouseDragged event - updates event recorder.
 o mouseEntered(MouseEvent)
Handles the mouseEntered event.
 o mouseExited(MouseEvent)
Handles the mouseExited event - updates tool tips information.
 o mouseMoved(MouseEvent)
Handles the mouseMoved event - highlights contacts on mouse over.
 o mousePressed(MouseEvent)
Handles the mousePressed event - turns on wire dragging mode.
 o mouseReleased(MouseEvent)
Handles the mouseReleased event - runs BFS to connect the wire if possible.
 o paint(Graphics)
This method is called to draw this component - update its appearance, if something being dragged over it.
 o processMouseEvent(MouseEvent)
 o removeActionListener(ActionListener)
Removes the specified action listener so that it no longer receives action events from this component.
 o removeWire(Cell)
 o reset()
Clear all elements
 o sendEvent(String, int)
Function sends event (== command and one argument) to the system.
 o startSimulation()

Methods

 o reset
 public void reset()
Clear all elements

 o actionPerformed
 public void actionPerformed(ActionEvent e)
Processes action events occurring on this component.

Parameters:
e - the action event.
See Also:
ActionListener
 o removeWire
 public void removeWire(Cell cell)
 o loadCircuit
 public void loadCircuit(String circuit)
 o mouseMoved
 public void mouseMoved(MouseEvent e)
Handles the mouseMoved event - highlights contacts on mouse over.

Parameters:
e - the mouse event
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Handles the mouseEntered event.

Parameters:
e - the mouse event
 o mouseExited
 public void mouseExited(MouseEvent e)
Handles the mouseExited event - updates tool tips information.

Parameters:
e - the mouse event
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Handles the mouseClicked event - invokes properties dialog for double clicked element.

Parameters:
e - the mouse event
 o mousePressed
 public void mousePressed(MouseEvent e)
Handles the mousePressed event - turns on wire dragging mode.

Parameters:
e - the mouse event
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Handles the mouseDragged event - updates event recorder.

Parameters:
e - the mouse event
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Handles the mouseReleased event - runs BFS to connect the wire if possible.

Parameters:
e - the mouse event
 o processMouseEvent
 public void processMouseEvent(MouseEvent e)
Overrides:
processMouseEvent in class Component
 o paint
 public void paint(Graphics g)
This method is called to draw this component - update its appearance, if something being dragged over it.

Parameters:
g - the graphics context.
Overrides:
paint in class Container
See Also:
Graphics
 o addActionListener
 public void addActionListener(ActionListener listener)
Adds the specified action listener to receive action events from this component.

Parameters:
l - the action listener.
See Also:
ActionListener
 o removeActionListener
 public void removeActionListener(ActionListener listener)
Removes the specified action listener so that it no longer receives action events from this component.

Parameters:
l - the action listener.
See Also:
ActionListener
 o sendEvent
 public void sendEvent(String command,
                       int modifiers)
Function sends event (== command and one argument) to the system.

Parameters:
command - command to send
modifiers - additional(optional) parameters.
 o buildGraph
 public boolean buildGraph()
 o makeIteration
 public void makeIteration()
 o startSimulation
 public void startSimulation()
 o endSimulation
 public void endSimulation()
 o getProbes
 public Vector getProbes()
 o log
 public String log()
 o getTip
 public String getTip(int type)
Returns tool tip for the matrix. Tip is from cell pointed by mouse.

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

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