public class SizeOffset
extends java.lang.Object
implements java.io.Serializable
In Electric, extra space may surround a NodeInst, in order to leave room for expansion of the definition. For example, in the MOCMOS technology, a metal-1/metal-2 contact is 5x5 (in memory) but when displayed, it is only 4x4. The extra space does not scale, meaning that if you stretch the node so that it appears to be 10x10, then it will be 11x11 in memory.
The distance from each edge is stored in a SizeOffset object. For the Via described above, all four offsets would be 0.5 to indicate a half-unit surround between the stored and displayed/selected bounds.
Modifier and Type | Field and Description |
---|---|
static SizeOffset |
ZERO_OFFSET
Offset with all zero distances.
|
Constructor and Description |
---|
SizeOffset(double lx,
double hx,
double ly,
double hy)
Constructor to create a SizeOffset from the specified parameters.
|
Modifier and Type | Method and Description |
---|---|
long |
getHighXGridOffset()
Method to return the high-X offset of this SizeOffset in grid units.
|
double |
getHighXOffset()
Method to return the high-X offset of this SizeOffset.
|
long |
getHighYGridOffset()
Method to return the high-Y offset of this SizeOffset in grid units.
|
double |
getHighYOffset()
Method to return the high-Y offset of this SizeOffset.
|
long |
getLowXGridOffset()
Method to return the low-X offset of this SizeOffset in grid units.
|
double |
getLowXOffset()
Method to return the low-X offset of this SizeOffset.
|
long |
getLowYGridOffset()
Method to return the low-Y offset of this SizeOffset in grid units.
|
double |
getLowYOffset()
Method to return the low-Y offset of this SizeOffset.
|
java.awt.geom.Rectangle2D |
modifyBounds(java.awt.geom.Rectangle2D bounds)
Returns a Rectangle2D representing bounds modified by
this size offset.
|
java.lang.String |
toString()
Returns a printable version of this SizeOffset.
|
public static final SizeOffset ZERO_OFFSET
public SizeOffset(double lx, double hx, double ly, double hy)
lx
- the low-X offset (distance from left side to actual bounds).hx
- the high-X offset (distance from left side to actual bounds).ly
- the low-Y offset (distance from bottom side to actual bounds).hy
- the high-Y offset (distance from top side to actual bounds).public double getLowXOffset()
public double getHighXOffset()
public double getLowYOffset()
public double getHighYOffset()
public long getLowXGridOffset()
public long getHighXGridOffset()
public long getLowYGridOffset()
public long getHighYGridOffset()
public java.lang.String toString()
toString
in class java.lang.Object
public java.awt.geom.Rectangle2D modifyBounds(java.awt.geom.Rectangle2D bounds)
bounds
- the bounds to be modified