jimmc.treepar
Class Connector

java.lang.Object
  |
  +--jimmc.treepar.Connector

public class Connector
extends java.lang.Object

Connector represents on connector on the edge of a Box.

See Also:
Box

Field Summary
protected  Box box
          Our Box.
protected  java.lang.String name
          The name of this connector.
protected  Net net
          The net to which this connector is attached.
protected  java.lang.String netName
          The name of the net this connector attaches to.
protected  java.awt.Point position
          The location of this connector relative to the box origin.
protected  int side
          The edge of the box on which this connector lies.
 
Constructor Summary
Connector(Box box, java.lang.String name)
          Create a new Connector on a Box.
 
Method Summary
static void dump(java.io.PrintWriter f, Connector[] connectors, java.lang.String prefix, boolean details)
          Dump an array of connectors.
 void dump(java.io.PrintWriter f, java.lang.String prefix, boolean details)
          Dump a connector for debugging.
protected  java.awt.Point getAbsoluteLocation()
          Get the absolute X and Y coordinates.
protected  int getAbsoluteR()
          Get the absolute R coordinate.
protected  int getAbsoluteX()
          Get the absolute X coordinate.
protected  int getAbsoluteY()
          Get the absolute Y coordinate.
protected  int getR()
          Get the R coordinate of the connector relative to its box.
 int getSide()
          Get the side this connector is on.
protected static Connector[] getSideConnectors(Connector[] connectors, int side)
          Get all of the connectors on the specified side of their box, sort them by position, and return an array.
protected  void linkNet()
          Link our net.
 void movePosition(int dx, int dy)
          Adjust the relative location of this connector.
 void setNetName(java.lang.String name)
          Set the netName of this connector.
 void setPosition(int x, int y)
          Set the location of this connector relative to the box origin.
protected  void setRowFromBox(int rowNum)
          Propagate the row number from a Box through this connector to our Net.
protected  void setRowFromNet(int rowNum)
          Propagate the row number from a Net through this connector to our Box.
 void setSide(int side)
          Set the side this connector is on.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

box

protected Box box
Our Box.

name

protected java.lang.String name
The name of this connector.

position

protected java.awt.Point position
The location of this connector relative to the box origin.

side

protected int side
The edge of the box on which this connector lies.

netName

protected java.lang.String netName
The name of the net this connector attaches to.

net

protected Net net
The net to which this connector is attached.
Constructor Detail

Connector

public Connector(Box box,
                 java.lang.String name)
Create a new Connector on a Box.
Method Detail

setNetName

public void setNetName(java.lang.String name)
Set the netName of this connector.

setPosition

public void setPosition(int x,
                        int y)
Set the location of this connector relative to the box origin.

movePosition

public void movePosition(int dx,
                         int dy)
Adjust the relative location of this connector.

setSide

public void setSide(int side)
Set the side this connector is on.

getSide

public int getSide()
Get the side this connector is on.

setRowFromBox

protected void setRowFromBox(int rowNum)
Propagate the row number from a Box through this connector to our Net.
Parameters:
rowNum - the row number of the box.

setRowFromNet

protected void setRowFromNet(int rowNum)
Propagate the row number from a Net through this connector to our Box.
Parameters:
rowNum - the row number of the net.

linkNet

protected void linkNet()
Link our net.

getR

protected int getR()
Get the R coordinate of the connector relative to its box.

getAbsoluteR

protected int getAbsoluteR()
Get the absolute R coordinate.

getAbsoluteX

protected int getAbsoluteX()
Get the absolute X coordinate.

getAbsoluteY

protected int getAbsoluteY()
Get the absolute Y coordinate.

getAbsoluteLocation

protected java.awt.Point getAbsoluteLocation()
Get the absolute X and Y coordinates.

getSideConnectors

protected static Connector[] getSideConnectors(Connector[] connectors,
                                               int side)
Get all of the connectors on the specified side of their box, sort them by position, and return an array.
Parameters:
connectors - the list of connectors through which to search.
side - the side for which connectors are desired.
Returns:
array of connectors sorted by position, or null if not connectors were on that side of the box.

dump

public void dump(java.io.PrintWriter f,
                 java.lang.String prefix,
                 boolean details)
Dump a connector for debugging.

dump

public static void dump(java.io.PrintWriter f,
                        Connector[] connectors,
                        java.lang.String prefix,
                        boolean details)
Dump an array of connectors.