public class ArcProto extends java.lang.Object implements java.lang.Comparable<ArcProto>, java.io.Serializable
Every arc in the database appears as one prototypical object and many instantiative objects. Thus, for a ArcProto such as the CMOS Metal-1 there is one object (called a ArcProto) that describes the wire prototype and there are many objects (called ArcInsts), one for every instance of a Metal-1 wire that appears in a circuit. ArcProtos are statically created and placed in the Technology objects.
The basic ArcProto has a name, default width, function, Layers that describes it graphically and more.
Modifier and Type | Class and Description |
---|---|
static class |
ArcProto.Curvable |
static class |
ArcProto.Function
Function is a typesafe enum class that describes the function of an ArcProto.
|
Modifier | Constructor and Description |
---|---|
protected |
ArcProto(Technology tech,
java.lang.String protoName,
double lambdaElibWidthOffset,
ArcProto.Function function,
Technology.ArcLayer[] layers,
int primArcIndex)
The constructor is never called.
|
Modifier and Type | Method and Description |
---|---|
void |
clearEdgeSelect()
Method to set this ArcProto so that instances of it cannot be selected by their edge.
|
void |
clearWipable()
Method to set this ArcProto so that instances of it cannot wipe nodes.
|
int |
compareTo(ArcProto that)
Compares ArcProtos by their Technologies and definition order.
|
java.lang.String |
describe()
Method to describe this ArcProto as a string.
|
static ArcProto |
findArcProto(java.lang.String line)
Method to find the ArcProto with the given name.
|
static ArcProto |
findArcProto(java.lang.String line,
Technology tech)
Method to find the ArcProto with the given name.
|
PrimitiveNode |
findOverridablePinProto(EditingPreferences ep)
Method to find the PrimitiveNode pin corresponding to this ArcProto type.
|
PrimitiveNode |
findPinProto()
Method to find the PrimitiveNode pin corresponding to this ArcProto type.
|
int |
getAngleIncrement(EditingPreferences ep)
Method to get the angle increment on this ArcProto.
|
Technology.ArcLayer[] |
getArcLayers()
Method to return the list of ArcLayers that comprise this ArcProto..
|
ECoord |
getBaseExtend()
Method to return the base width extend of this ArcProto as ECoord object.
|
long |
getDefaultGridBaseWidth(EditingPreferences ep)
Method to return the default base width of this ArcProto in grid units.
|
ImmutableArcInst |
getDefaultInst(EditingPreferences ep)
Method to return the default immutable instance of this PrimitiveNode
in specified EditingPreferences.
|
double |
getDefaultLambdaBaseWidth()
Deprecated.
Use method with explicit EditingPreferences parameter.
|
double |
getDefaultLambdaBaseWidth(EditingPreferences ep)
Method to return the default base width of this ArcProto in lambda units.
|
int |
getFactoryAngleIncrement()
Method to get the default angle increment on this ArcProto.
|
double |
getFactoryAntennaRatio()
Method to tell the default antenna ratio of this ArcProto.
|
long |
getFactoryDefaultGridBaseWidth()
Method to return the factory default base width of this ArcProto in grid units.
|
ImmutableArcInst |
getFactoryDefaultInst()
Method to return the factory default immutable instance of this PrimitiveNode
|
double |
getFactoryDefaultLambdaBaseWidth()
Method to return the factory default base width of this ArcProto in lambda units.
|
java.lang.String |
getFullName()
Method to return the full name of this ArcProto.
|
ArcProto.Function |
getFunction()
Method to return the function of this ArcProto.
|
ArcProtoId |
getId()
Method to return the Id of this ArcProto.
|
double |
getLambdaElibWidthOffset()
Method to return the width offset of this ArcProto in lambda units.
|
Layer |
getLayer(int arcLayerIndex)
Method to return layer that comprises by its index in all layers
|
ECoord |
getLayerExtend(int arcLayerIndex)
Returns the extend of specified layer that comprise this ArcProto over base arc width as ECoord object.
|
ECoord |
getLayerExtend(Layer layer)
Returns the extend of specified layer that comprise this ArcProto over base arc width as ECoord object.
|
java.util.Iterator<Layer> |
getLayerIterator()
Method to return an iterator over the layers in this ArcProto.
|
Poly.Type |
getLayerStyle(int arcLayerIndex)
Returns the Poly.Style of specified layer that comprise this ArcLayer.
|
Poly.Type |
getLayerStyle(Layer layer)
Returns the Poly.Style of specified layer that comprise this ArcLayer.
|
int |
getMaskLayer()
Method to return the mask layer for this ArcProto.
|
ECoord |
getMaxLayerExtend()
Method to return the maximal layer extend of this ArcProto as ECoord object.
|
ECoord |
getMinLayerExtend()
Method to return the minimal layer extend of this ArcProto as ECoord object.
|
java.lang.String |
getName()
Method to return the name of this ArcProto.
|
int |
getNumArcLayers()
Method to return the number of layers that comprise this ArcProto.
|
protected void |
getShapeOfArc(AbstractShapeBuilder b,
ImmutableArcInst a)
Fill the polygons that describe arc "a".
|
protected void |
getShapeOfArc(AbstractShapeBuilder b,
ImmutableArcInst a,
EGraphics graphicsOverride)
Fill the polygons that describe arc "a".
|
Poly[] |
getShapeOfDummyArc(double lambdaLength)
Deprecated.
Use method with explicit EditingPreferences parameter.
|
Poly[] |
getShapeOfDummyArc(EditingPreferences ep,
double lambdaLength)
Returns the polygons that describe dummy arc of this ArcProto
with default width and specified length.
|
Technology |
getTechnology()
Method to return the Technology of this ArcProto.
|
boolean |
getZValues(double[] array)
Method to get MinZ and MaxZ of this ArcProto
|
int |
indexOf(Layer layer)
Method to find an index of Layer in a list of Layers that comprise this ArcProto.
|
boolean |
isCurvable()
Method to tell if instances of this ArcProto can curve.
|
boolean |
isEasyShape(ImmutableArcInst a,
boolean explain)
Tells if arc can be drawn by simplified algorithm
Overidden ins subclasses
|
boolean |
isEdgeSelect()
Method to tell if instances of this ArcProto can be selected by their edge.
|
boolean |
isNotUsed()
Method to tell if this ArcProto is used.
|
boolean |
isSkipSizeInPalette()
Method to tell if instaces of this ArcProto are special (don't appear in menu).
|
boolean |
isSpecialArc()
Method to tell if instaces of this ArcProto are special (don't appear in menu).
|
boolean |
isWipable()
Method to tell if instances of this ArcProto can wipe nodes.
|
void |
makeGridPoly(AbstractShapeBuilder b,
ImmutableArcInst a,
long gridWidth,
Poly.Type style,
Layer layer,
EGraphics graphicsOverride)
Method to fill in an AbstractShapeBuilder a polygon that describes this ImmutableArcInst in grid units.
|
void |
setEdgeSelect()
Method to set this ArcProto so that instances of it can be selected by their edge.
|
void |
setFactoryAngleIncrement(int angle)
Method to set the factory-default angle of this ArcProto.
|
void |
setFactoryAntennaRatio(double ratio)
Method to set the factory antenna ratio of this ArcProto.
|
void |
setFactoryDirectional(int defaultDir)
Method to set the "factory default" directional state of this ArcProto.
|
void |
setFactoryExtended(boolean extended)
Method to set the "factory default" end-extension state of this ArcProto.
|
void |
setFactoryFixedAngle(boolean fixed)
Method to set the "factory default" fixed-angle state of this ArcProto.
|
void |
setFactoryRigid(boolean rigid)
Method to set the "factory default" rigid state of this ArcProto.
|
void |
setFactorySlidable(boolean slidable)
Method to set the "factory default" slidability state of this ArcProto.
|
void |
setNotUsed(boolean set)
Method to set this ArcProto so that it is not used.
|
void |
setSkipSizeInPalette()
Method to allow instances of this ArcProto not to be considered in
tech palette for the calculation of the largest icon.
|
void |
setSpecialArc()
Method to allow instances of this ArcProto to be special in menu.
|
void |
setWipable()
Method to set this ArcProto so that instances of it can wipe nodes.
|
java.lang.String |
toString()
Returns a printable version of this ArcProto.
|
protected java.lang.Object |
writeReplace() |
protected ArcProto(Technology tech, java.lang.String protoName, double lambdaElibWidthOffset, ArcProto.Function function, Technology.ArcLayer[] layers, int primArcIndex)
protected java.lang.Object writeReplace()
public ArcProtoId getId()
public java.lang.String getName()
public java.lang.String getFullName()
public Technology getTechnology()
public double getDefaultLambdaBaseWidth()
public double getDefaultLambdaBaseWidth(EditingPreferences ep)
ep
- EditingPreferencespublic double getFactoryDefaultLambdaBaseWidth()
public long getDefaultGridBaseWidth(EditingPreferences ep)
ep
- EditingPreferencespublic long getFactoryDefaultGridBaseWidth()
public ImmutableArcInst getDefaultInst(EditingPreferences ep)
ep
- specified EditingPreferencespublic ImmutableArcInst getFactoryDefaultInst()
public ECoord getBaseExtend()
public double getLambdaElibWidthOffset()
public ECoord getMinLayerExtend()
public ECoord getMaxLayerExtend()
public void setFactoryAntennaRatio(double ratio)
ratio
- the antenna ratio of this ArcProto.public double getFactoryAntennaRatio()
public void setFactoryRigid(boolean rigid)
rigid
- true if this ArcProto should be rigid by factory-default.public void setFactoryFixedAngle(boolean fixed)
fixed
- true if this ArcProto should be fixed-angle by factory-default.public void setFactorySlidable(boolean slidable)
slidable
- true if this ArcProto should be slidability by factory-default.public void setFactoryExtended(boolean extended)
extended
- true if this ArcProto should be end-extended by factory-default.public void setFactoryDirectional(int defaultDir)
defaultDir
- has bit 0 set to put arrow on head, bit 1 set to put arrow on tail,
bit 2 set to put arrow on body.public void setNotUsed(boolean set)
set
- public boolean isNotUsed()
public void setSkipSizeInPalette()
public boolean isSkipSizeInPalette()
public void setWipable()
public void clearWipable()
public boolean isWipable()
public boolean isCurvable()
public void setEdgeSelect()
public void clearEdgeSelect()
public boolean isEdgeSelect()
public void setSpecialArc()
public boolean isSpecialArc()
public ArcProto.Function getFunction()
public void setFactoryAngleIncrement(int angle)
angle
- the factory-default angle of this ArcProto.public int getAngleIncrement(EditingPreferences ep)
ep
- editing preferences with default incrementpublic int getFactoryAngleIncrement()
public PrimitiveNode findOverridablePinProto(EditingPreferences ep)
ep
- editing preferences with user overridespublic PrimitiveNode findPinProto()
public int getMaskLayer()
public static ArcProto findArcProto(java.lang.String line)
line
- the name of the ArcProto.public static ArcProto findArcProto(java.lang.String line, Technology tech)
line
- the name of the ArcProto.tech
- technology to querypublic int getNumArcLayers()
public Technology.ArcLayer[] getArcLayers()
public Layer getLayer(int arcLayerIndex)
arcLayerIndex
- layer indexpublic ECoord getLayerExtend(int arcLayerIndex)
arcLayerIndex
- layer indexpublic Poly.Type getLayerStyle(int arcLayerIndex)
arcLayerIndex
- layer indexpublic ECoord getLayerExtend(Layer layer)
layer
- specified Layerjava.lang.IndexOutOfBoundsException
- when specified layer diesn't comprise this ArcProtopublic Poly.Type getLayerStyle(Layer layer)
layer
- specified Layerjava.lang.IndexOutOfBoundsException
- when specified layer diesn't comprise this ArcProtopublic java.util.Iterator<Layer> getLayerIterator()
public int indexOf(Layer layer)
layer
- the Layer to find.public boolean getZValues(double[] array)
array
- array[0] is minZ and array[1] is maxpublic boolean isEasyShape(ImmutableArcInst a, boolean explain)
a
- arc to testexplain
- if true then print explanation why arc is not easyprotected void getShapeOfArc(AbstractShapeBuilder b, ImmutableArcInst a)
b
- AbstractShapeBuilder to fill polygons.a
- the ImmutableArcInst that is being described.protected void getShapeOfArc(AbstractShapeBuilder b, ImmutableArcInst a, EGraphics graphicsOverride)
b
- AbstractShapeBuilder to fill polygons.a
- the ImmutableArcInst that is being described.graphicsOverride
- the graphics to use for all generated polygons (if not null).public void makeGridPoly(AbstractShapeBuilder b, ImmutableArcInst a, long gridWidth, Poly.Type style, Layer layer, EGraphics graphicsOverride)
a
- the arc information.gridWidth
- the gridWidth of the Poly.style
- the style of the Poly.layer
- layer of the PolygraphicsOverride
- graphics override of the Polypublic Poly[] getShapeOfDummyArc(double lambdaLength)
lambdaLength
- length of dummy arc in lambda units.public Poly[] getShapeOfDummyArc(EditingPreferences ep, double lambdaLength)
ep
- EditingPreferences with default widthlambdaLength
- length of dummy arc in lambda units.public java.lang.String describe()
public int compareTo(ArcProto that)
compareTo
in interface java.lang.Comparable<ArcProto>
that
- the other ArcProto.public java.lang.String toString()
toString
in class java.lang.Object