com.sun.electric.tool.routing
Class RouteElementPort

java.lang.Object
  extended by com.sun.electric.tool.routing.RouteElement
      extended by com.sun.electric.tool.routing.RouteElementPort
All Implemented Interfaces:
java.io.Serializable

public class RouteElementPort
extends RouteElement

Class for defining RouteElements that are ports.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.electric.tool.routing.RouteElement
RouteElement.RouteElementAction
 
Method Summary
 void addConnectingNewArc(RouteElementArc re)
          Book-keeping: Adds a newArc RouteElement to a list to keep track of what newArc elements use this object as an end point.
 void addHighlightArea(Highlighter highlighter)
          Adds RouteElement to highlights
static RouteElementPort deleteNode(NodeInst nodeInstToDelete)
          Factory method for making a deleteNode RouteElement
 ElectricObject doAction()
          Perform the action specified by RouteElementAction action.
static RouteElementPort existingPortInst(PortInst existingPortInst, EPoint portInstSite)
          Factory method for making a dummy RouteElement for an existing PortInst.
static RouteElementPort existingPortInst(PortInst existingPortInst, Poly portInstSite)
          Factory method for making a dummy RouteElement for an existing PortInst.
 int getConnectingArcAngle(ArcProto ap)
          Get the angle of any arcs connected to this RouteElement.
 Poly getConnectingSite()
          Get a polygon that defines the port dimensions.
 java.awt.geom.Point2D getLocation()
          Returns location of newNode, existingPortInst, or deleteNode, or null otherwise
 java.util.Iterator<RouteElement> getNewArcs()
          Get an iterator over any newArc RouteElements connected to this newNode RouteElement.
 NodeInst getNodeInst()
          Get Connecting Node on RouteElement.
 NodeProto getNodeProto()
          Get the NodeProto for connecting to this RouteElementPort.
 Dimension2D.Double getNodeSize()
          Get the size of a newNode, or the NodeInst an existingPortInst is attached to.
 PortInst getPortInst()
          Get Connecting Port on RouteElement.
 PortProto getPortProto()
          Get the PortProto for connecting to this RouteElementPort.
 double getWidestConnectingArc(ArcProto ap)
          Get largest arc width of newArc RouteElements attached to this RouteElement.
 double getWidestConnectingArc(ArcProto ap, int arcAngle)
          Get largest arc width of newArc RouteElements attached to this RouteElement.
 boolean isBisectArcPin()
          see setBisectArcPin
static RouteElementPort newNode(Cell cell, NodeProto np, PortProto newNodePort, java.awt.geom.Point2D location, double width, double height)
          Factory method for making a newNode RouteElement
 void removeConnectingNewArc(RouteElementArc re)
          Reomve a newArc that connects to this newNode or existingPortInst.
 void setBisectArcPin(boolean state)
          Set true by Interactive router if pin used to bisect arc Router may want to remove this pin later if it places a connecting contact cut in the same position.
 void setNodeSize(Dimension2D size)
          Set the size of a newNode.
 java.lang.String toString()
          Return string decribing the RouteElement
 
Methods inherited from class com.sun.electric.tool.routing.RouteElement
getAction, getCell, isDone, isShowHighlight, setDone, setShowHighlight
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

newNode

public static RouteElementPort newNode(Cell cell,
                                       NodeProto np,
                                       PortProto newNodePort,
                                       java.awt.geom.Point2D location,
                                       double width,
                                       double height)
Factory method for making a newNode RouteElement

Parameters:
np - Type of NodeInst to make
location - the location of the new NodeInst
width - the width of the new NodeInst
height - the height of the new NodeInst

deleteNode

public static RouteElementPort deleteNode(NodeInst nodeInstToDelete)
Factory method for making a deleteNode RouteElement

Parameters:
nodeInstToDelete - the nodeInst to delete

existingPortInst

public static RouteElementPort existingPortInst(PortInst existingPortInst,
                                                EPoint portInstSite)
Factory method for making a dummy RouteElement for an existing PortInst. This is usually use to demark the start and/or ends of the route, which exist before we start building the route.

Parameters:
existingPortInst - the already existing portInst to connect to

existingPortInst

public static RouteElementPort existingPortInst(PortInst existingPortInst,
                                                Poly portInstSite)
Factory method for making a dummy RouteElement for an existing PortInst. This is usually use to demark the start and/or ends of the route, which exist before we start building the route.

Parameters:
existingPortInst - the already existing portInst to connect to

getNodeProto

public NodeProto getNodeProto()
Get the NodeProto for connecting to this RouteElementPort. This is not the same as getNodeInst.getProto(), because if the action has not yet been done the NodeInst will not have been created and will be null.

Returns:
the NodeProto

getPortProto

public PortProto getPortProto()
Get the PortProto for connecting to this RouteElementPort. This is not the same as getPortInst().getPortProto(), because if the action has not yet been done the PortInst returned by getPortInst() may have not yet been created. For a deleteNode, this will return null.

Returns:
a PortProto of port to connect to this RouteElement.

getPortInst

public PortInst getPortInst()
Get Connecting Port on RouteElement.

Returns:
the PortInst, or null on error

getNodeInst

public NodeInst getNodeInst()
Get Connecting Node on RouteElement.

Returns:
the NodeInst, or null on error

getLocation

public java.awt.geom.Point2D getLocation()
Returns location of newNode, existingPortInst, or deleteNode, or null otherwise


setBisectArcPin

public void setBisectArcPin(boolean state)
Set true by Interactive router if pin used to bisect arc Router may want to remove this pin later if it places a connecting contact cut in the same position.


isBisectArcPin

public boolean isBisectArcPin()
see setBisectArcPin


addConnectingNewArc

public void addConnectingNewArc(RouteElementArc re)
Book-keeping: Adds a newArc RouteElement to a list to keep track of what newArc elements use this object as an end point. This must be a RouteElement of type newNode or existingPortInst.

Parameters:
re - the RouteElement to add.

removeConnectingNewArc

public void removeConnectingNewArc(RouteElementArc re)
Reomve a newArc that connects to this newNode or existingPortInst.

Parameters:
re - the RouteElement to remove

getWidestConnectingArc

public double getWidestConnectingArc(ArcProto ap)
Get largest arc width of newArc RouteElements attached to this RouteElement. If none present returns -1.

Note that these width values should have been pre-adjusted for the arc width offset, so these values have had the offset subtracted away.


getWidestConnectingArc

public double getWidestConnectingArc(ArcProto ap,
                                     int arcAngle)
Get largest arc width of newArc RouteElements attached to this RouteElement. If none present returns -1.

Note that these width values should have been pre-adjusted for the arc width offset, so these values have had the offset subtracted away.


getConnectingArcAngle

public int getConnectingArcAngle(ArcProto ap)
Get the angle of any arcs connected to this RouteElement. If there are multiple arcs, it returns the angle of the widest connecting arc.

Parameters:
ap - the arc prototype
Returns:
the angle in centidegrees, 0 if no arcs of the specified type connected.

getNewArcs

public java.util.Iterator<RouteElement> getNewArcs()
Get an iterator over any newArc RouteElements connected to this newNode RouteElement. Returns an iterator over an empty list if no new arcs.


getNodeSize

public Dimension2D.Double getNodeSize()
Get the size of a newNode, or the NodeInst an existingPortInst is attached to.

Returns:
the width,height of the node, or (-1, -1) if not a node

setNodeSize

public void setNodeSize(Dimension2D size)
Set the size of a newNode. Does not make it smaller than the default size if this is a PrimitiveNode. Does nothing for other RouteElements.

Parameters:
size - the new size

getConnectingSite

public Poly getConnectingSite()
Get a polygon that defines the port dimensions. May return null.


doAction

public ElectricObject doAction()
Perform the action specified by RouteElementAction action. Note that this method performs database editing, and should only be called from within a Job.

Specified by:
doAction in class RouteElement
Returns:
the object created, or null if deleted or nothing done.

addHighlightArea

public void addHighlightArea(Highlighter highlighter)
Adds RouteElement to highlights

Specified by:
addHighlightArea in class RouteElement

toString

public java.lang.String toString()
Return string decribing the RouteElement

Specified by:
toString in class RouteElement