All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jschem.connectionList

java.lang.Object
   |
   +----jschem.connectionList

public class connectionList
extends Object
This is one of the important informations for a schematic - the connectivity list.

It sets up the datastructures for keeping segment-wise the wires of the schematic including the graphical information.
The segments are always drawn in the horizontal direction first, then in vertical direction. On the both ends knots are added.

Examples:

"x1/y1 o----+ x2/y2 o x2/y2 o"
" | | x1/y1 o----o x2/y2 |"
" x2/y2 o +----o x1/y1 x1/y1 o"


Constructor Index

 o connectionList(int, int, int)
Build new connectivity list for a schematic.

Method Index

 o add(int, int, int, int)
Adds a new segment.
 o checkJoinNet(int, int, int, int)
Checks if given path joins to the existing wires.
 o deleteSelection()
Delete a selection
 o fromString(String)
Setup connectivity list from GRAPHICS line.
 o getNetAt(int, int)
Checks if given coordinate hits an existing wire.
 o paint(Graphics)
Can be called to allow the connections to draw them themselves.
 o selectFullNetAt(int, int)
Select a whole net at a given coordinate
 o selectNetAt(int, int)
Select a net segment at a given coordinate
 o toString()
Creates GRAPHICS line.

Constructors

 o connectionList
 public connectionList(int gr,
                       int size,
                       int subsize)
Build new connectivity list for a schematic.

Parameters:
gr - gridsize in pixel
size - amount of nets
subsize - allowed amount of segments per net

Methods

 o add
 public String add(int x1,
                   int y1,
                   int x2,
                   int y2)
Adds a new segment. It is joined to an existing net if: It may happen that two or more existing nets are connected together, the first one which is found is reference for every other found.

Parameters:
x1,y1 - the given start coordinates (pixel)
x2,y2 - the given end coordinates (pixel)
Returns:
name of the net created or joined
 o checkJoinNet
 public int[] checkJoinNet(int x1,
                           int y1,
                           int x2,
                           int y2)
Checks if given path joins to the existing wires. It checks if: We suppose not to have more than 20 matches....

Parameters:
x1,y1 - the given start coordinate (pixel)
x2,y2 - the given end coordinate (pixel)
Returns:
indices of the nets to join (idx=0 is # of hits)
 o getNetAt
 public String getNetAt(int x,
                        int y)
Checks if given coordinate hits an existing wire.

Parameters:
x,y - the given coordinate (pixel)
Returns:
net name (or null if not hit)
 o selectNetAt
 public String selectNetAt(int x,
                           int y)
Select a net segment at a given coordinate

Parameters:
x,y - the given coordinate (pixel)
Returns:
net name (or null if not hit)
 o selectFullNetAt
 public String selectFullNetAt(int x,
                               int y)
Select a whole net at a given coordinate

Parameters:
x,y - the given coordinate (pixel)
Returns:
net name (or null if not hit)
 o deleteSelection
 public void deleteSelection()
Delete a selection

Parameters:
x,y - the given coordinate (pixel)
Returns:
net name (or null if not hit)
 o toString
 public String toString()
Creates GRAPHICS line.

Overrides:
toString in class Object
 o fromString
 public boolean fromString(String s)
Setup connectivity list from GRAPHICS line.

 o paint
 public void paint(Graphics g)
Can be called to allow the connections to draw them themselves. It draws the lines in blue, with knots at every segment end.

Parameters:
g - Graphics context to draw to

All Packages  Class Hierarchy  This Package  Previous  Next  Index