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