All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jschem.schemBoard

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Canvas
                   |
                   +----jschem.schemBoard

public class schemBoard
extends Canvas
implements MouseListener, MouseMotionListener, KeyListener
This is the schematic board, containing electricElement classes and their connections.

It inherits the Canvas type - so it can be used as every other AWT element.


Constructor Index

 o schemBoard(int, int, int, String)
Setup a schematic board containing elements and connections.

Method Index

 o addElement(String)
This method notifies the schem board that the user wants a new element.
 o deleteSelected()
If there is an element selected, we delete it!
 o editSelected()
If there is an element selected, we edit it!
 o getGraData()
A method to get a GRAPHICS data out of the current schematic.
 o getMaximumSize()
Some containers need this to lay out this canvas.
 o getMinimumSize()
Some containers need this to lay out this canvas.
 o getNetlist()
A method to get a SPICE netlist out of the current schematic.
 o getPreferredSize()
Some containers need this to lay out this canvas.
 o getProbes()
A method to get SPICE print cards for the probes out of the current schematic.
 o keyPressed(KeyEvent)
Needed to satisfy the keyListener interface - not needed here.
 o keyReleased(KeyEvent)
Needed to satisfy the keyListener interface - not needed here.
 o keyTyped(KeyEvent)
The part of the key listener interface used to watch key typing.
 o load(String)
Load a schematic board file containing elements and connections.
 o mouseClicked(MouseEvent)
Used to select elements or nets.
 o mouseDragged(MouseEvent)
Used to draw a new net segment interactive.
 o mouseEntered(MouseEvent)
Needed to satisfy the MouseListener interface - not needed here.
 o mouseExited(MouseEvent)
Needed to satisfy the MouseListener interface - not needed here.
 o mouseMoved(MouseEvent)
Used to update an element on hold (before it is correctly placed by the user)
 o mousePressed(MouseEvent)
Used to draw a new net segment interactive.
 o mouseReleased(MouseEvent)
Used to draw a new net segment interactive.
 o moveSelected()
If there is an element selected, we move it!
 o paint(Graphics)
A 'standard' paint method (called by the canvas' update).
 o rotateSelected()
If there is an element selected, we rotate it!
 o update(Graphics)
We replace the update method to do double-buffering.

Constructors

 o schemBoard
 public schemBoard(int width,
                   int height,
                   int grid,
                   String preload)
Setup a schematic board containing elements and connections. A specific grid and a specific size must be given. Additionally a preload file containing graphical data may be given.

The current connectivity may contain 30 nets with 50 segments each.

Parameters:
width - width (grid counts)
height - height (grid counts)
grid - the grid in pixel everything relates on
preload - a URL where to find preload data (or null)

Methods

 o load
 public boolean load(String preload)
Load a schematic board file containing elements and connections.

Parameters:
preload - a URL where to find preload data (or null)
 o update
 public void update(Graphics g)
We replace the update method to do double-buffering. The new method creates a image, and calls update on this. Then the image is painted in one step without flashing.

Parameters:
g - the graphics context
Overrides:
update in class Component
 o paint
 public void paint(Graphics g)
A 'standard' paint method (called by the canvas' update).

Parameters:
g - the graphics context
Overrides:
paint in class Canvas
 o addElement
 public boolean addElement(String el)
This method notifies the schem board that the user wants a new element. The element is created and hold in a special variable. Additionally it is 'shadowed' so the user can see easily the difference to an already placed element.

Parameters:
el - a string that describes the element to add (conforms to menu item)
 o rotateSelected
 public void rotateSelected()
If there is an element selected, we rotate it!

 o moveSelected
 public void moveSelected()
If there is an element selected, we move it!

 o editSelected
 public void editSelected()
If there is an element selected, we edit it!

 o deleteSelected
 public void deleteSelected()
If there is an element selected, we delete it!

 o getNetlist
 public String getNetlist()
A method to get a SPICE netlist out of the current schematic. It greps through all elements which creates themselves the proper line for SPICE.

 o getGraData
 public String getGraData()
A method to get a GRAPHICS data out of the current schematic. It greps through all elements which creates themselves the proper line for the GRA structure.

 o getProbes
 public String getProbes()
A method to get SPICE print cards for the probes out of the current schematic. It greps through all elements which creates themselves the proper line for SPICE.

 o getMinimumSize
 public Dimension getMinimumSize()
Some containers need this to lay out this canvas.

Overrides:
getMinimumSize in class Component
 o getMaximumSize
 public Dimension getMaximumSize()
Some containers need this to lay out this canvas.

Overrides:
getMaximumSize in class Component
 o getPreferredSize
 public Dimension getPreferredSize()
Some containers need this to lay out this canvas.

Overrides:
getPreferredSize in class Component
 o mouseClicked
 public void mouseClicked(MouseEvent e)
Used to select elements or nets.

A single click selects a net. Double click selects an element or a net segment.

Parameters:
e - The mouse event data.
 o mousePressed
 public void mousePressed(MouseEvent e)
Used to draw a new net segment interactive.

Set up starting point for a new segment drawn online within the schematic board.

Parameters:
e - The mouse event data.
 o mouseReleased
 public void mouseReleased(MouseEvent e)
Used to draw a new net segment interactive.

Set up end point for a new segment drawn online within the schematic board. It adds the segment to the connectivity list and updates the element pins.

Parameters:
e - The mouse event data.
 o mouseEntered
 public void mouseEntered(MouseEvent e)
Needed to satisfy the MouseListener interface - not needed here.

Parameters:
e - The mouse event data.
 o mouseExited
 public void mouseExited(MouseEvent e)
Needed to satisfy the MouseListener interface - not needed here.

Parameters:
e - The mouse event data.
 o mouseDragged
 public void mouseDragged(MouseEvent e)
Used to draw a new net segment interactive.

Updates the endpoint for the online drawing within the schematic board. It checks the validity of the line (crossing elements is not allowed).

Parameters:
e - The mouse event data.
 o mouseMoved
 public void mouseMoved(MouseEvent e)
Used to update an element on hold (before it is correctly placed by the user)

Parameters:
e - The mouse event data.
 o keyTyped
 public void keyTyped(KeyEvent e)
The part of the key listener interface used to watch key typing.

Parameters:
e - The key event data.
 o keyPressed
 public void keyPressed(KeyEvent e)
Needed to satisfy the keyListener interface - not needed here.

Parameters:
e - The key event data.
 o keyReleased
 public void keyReleased(KeyEvent e)
Needed to satisfy the keyListener interface - not needed here.

Parameters:
e - The key event data.

All Packages  Class Hierarchy  This Package  Previous  Next  Index