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