com.sun.electric.tool.routing
Class RouteElementArc

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

public class RouteElementArc
extends RouteElement

Class for defining RouteElements that are arcs.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class com.sun.electric.tool.routing.RouteElement
RouteElement.RouteElementAction
 
Method Summary
 void addHighlightArea(Highlighter highlighter)
          Adds RouteElement to highlights
static RouteElementArc deleteArc(ArcInst arcInstToDelete)
          Factory method for making a deleteArc RouteElement
 ElectricObject doAction()
          Perform the action specified by RouteElementAction action.
 int getArcAngle()
           
 double getArcBaseWidth()
          Return arc width.
 ArcProto getArcProto()
          Get the arc proto to be created/deleted.
 RouteElementPort getHead()
           
 java.awt.geom.Point2D getHeadConnPoint()
           
 boolean getHeadExtension()
           
 RouteElementPort getTail()
           
 java.awt.geom.Point2D getTailConnPoint()
           
 boolean getTailExtension()
           
 boolean isArcHorizontal()
          Return true if the new arc is a horizontal arc, false otherwise
 boolean isArcVertical()
          Return true if the new arc is a vertical arc, false otherwise
static RouteElementArc newArc(Cell cell, ArcProto ap, double arcBaseWidth, RouteElementPort headRE, RouteElementPort tailRE, java.awt.geom.Point2D headConnPoint, java.awt.geom.Point2D tailConnPoint, java.lang.String name, TextDescriptor nameTextDescriptor, ArcInst inheritFrom, boolean extendArcHead, boolean extendArcTail, PolyMerge stayInside)
          Factory method for making a newArc RouteElement
 boolean replaceArcEnd(RouteElementPort oldEnd, RouteElementPort newEnd)
          Used to update end points of new arc if they change Only valid if called on newArcs, does nothing otherwise.
 void setArcAngle(int angle)
          Set a newArc's angle.
 void setArcBaseWidth(double width)
          Set the arc width if this is a newArc RouteElement, otherwise does nothing.
 void setHeadExtension(boolean e)
           
 void setTailExtension(boolean e)
           
 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

newArc

public static RouteElementArc newArc(Cell cell,
                                     ArcProto ap,
                                     double arcBaseWidth,
                                     RouteElementPort headRE,
                                     RouteElementPort tailRE,
                                     java.awt.geom.Point2D headConnPoint,
                                     java.awt.geom.Point2D tailConnPoint,
                                     java.lang.String name,
                                     TextDescriptor nameTextDescriptor,
                                     ArcInst inheritFrom,
                                     boolean extendArcHead,
                                     boolean extendArcTail,
                                     PolyMerge stayInside)
Factory method for making a newArc RouteElement

Parameters:
ap - Type of ArcInst to make
headRE - RouteElement (must be newNode or existingPortInst) at head of arc
tailRE - RouteElement (must be newNode or existingPortInst) at tail or arc
nameTextDescriptor -
inheritFrom -
extendArcHead - only applied if inheritFrom is null
extendArcTail - only applied if inheritFrom is null
stayInside - a polygonal area in which the new arc must reside (if not null). The arc is narrowed and has its ends extended in an attempt to stay inside this area.

deleteArc

public static RouteElementArc deleteArc(ArcInst arcInstToDelete)
Factory method for making a deleteArc RouteElement

Parameters:
arcInstToDelete - the arcInst to delete

getArcProto

public ArcProto getArcProto()
Get the arc proto to be created/deleted.

Returns:
the arc proto.

getHead

public RouteElementPort getHead()

getTail

public RouteElementPort getTail()

getHeadConnPoint

public java.awt.geom.Point2D getHeadConnPoint()

getTailConnPoint

public java.awt.geom.Point2D getTailConnPoint()

getHeadExtension

public boolean getHeadExtension()

getTailExtension

public boolean getTailExtension()

getArcBaseWidth

public double getArcBaseWidth()
Return arc width. This returns the arc width taking into account any offset


setArcBaseWidth

public void setArcBaseWidth(double width)
Set the arc width if this is a newArc RouteElement, otherwise does nothing. This is offset arc width (i.e. what the user sees).


setArcAngle

public void setArcAngle(int angle)
Set a newArc's angle. This only does something if both the head and tail of the arc are coincident points. This does nothing if the RouteElement is not a newArc

Parameters:
angle - the angle, in tenth degrees

getArcAngle

public int getArcAngle()

setHeadExtension

public void setHeadExtension(boolean e)

setTailExtension

public void setTailExtension(boolean e)

isArcVertical

public boolean isArcVertical()
Return true if the new arc is a vertical arc, false otherwise


isArcHorizontal

public boolean isArcHorizontal()
Return true if the new arc is a horizontal arc, false otherwise


replaceArcEnd

public boolean replaceArcEnd(RouteElementPort oldEnd,
                             RouteElementPort newEnd)
Used to update end points of new arc if they change Only valid if called on newArcs, does nothing otherwise.

Returns:
true if either (a) this arc does not use oldEnd, or (b) this arc replaced oldEnd with newEnd, and no longer uses oldEnd at all.

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