?? technology.java
字號:
/** * Constructs an <CODE>ArcLayer</CODE> with the specified description. * @param layer the Layer of this ArcLayer. * @param xmlExtend Xml expression for extend of this ArcLayer depending on tech parameters * @param style the Poly.Style of this ArcLayer. */ public ArcLayer(Layer layer, Poly.Type style, Distance xmlExtend) { this(layer, style, 0, xmlExtend); } private ArcLayer(Layer layer, Poly.Type style, long gridExtend, Distance xmlExtend) { if (gridExtend < 0 || gridExtend >= Integer.MAX_VALUE/8) throw new IllegalArgumentException("gridExtend=" + gridExtend); this.layer = layer; this.gridExtend = (int)gridExtend; this.style = style; this.xmlExtend = xmlExtend; } /** * Returns the Layer from the Technology to be used for this ArcLayer. * @return the Layer from the Technology to be used for this ArcLayer. */ Layer getLayer() { return layer; } /** * Returns the distance from the center of the standard ArcInst to the outsize of this ArcLayer in grid units. * The distance from the center of arbitrary ArcInst ai to the outsize of its ArcLayer is * ai.getD().getExtendOverMin() + arcLayer.getGridExtend() * @return the distance from the outside of the ArcInst to this ArcLayer in grid units. */ int getGridExtend() { return gridExtend; } /** * Returns ArcLayer which differs from this ArcLayer by extebd. * Extend is specified in grid units. * The distance from the center of arbitrary ArcInst ai to the outsize of its ArcLayer is * ai.getD().getExtendOverMin() + arcLayer.getGridExtend() * @param gridExtend new extend to this ArcLayer in grid units. */ ArcLayer withGridExtend(long gridExtend) { if (this.gridExtend == gridExtend) return this; return new ArcLayer(layer, style, gridExtend, xmlExtend); } /** * Returns the Poly.Style of this ArcLayer. * @return the Poly.Style of this ArcLayer. */ Poly.Type getStyle() { return style; } void dump(PrintWriter out) { out.println("\t\tarcLayer layer=" + layer.getName() + " style=" + style.name() + " extend=" + DBMath.gridToLambda(gridExtend)); } Xml.ArcLayer makeXml() { Xml.ArcLayer al = new Xml.ArcLayer(); al.layer = layer.getName(); al.style = style; al.extend.addLambda(DBMath.gridToLambda(gridExtend));// al.extend.assign(xmlExtend); return al; } XmlParam.ArcLayer makeXmlParam() { XmlParam.ArcLayer al = new XmlParam.ArcLayer(); al.layer = layer.getName(); al.style = style; al.extend.assign(xmlExtend); return al; } void resize(DistanceContext context, ArcProto ap) { double lambdaExtend = xmlExtend.getLambda(context); if (Double.isNaN(lambdaExtend) && !ap.isNotUsed()) { System.out.println("Can't resize arc layer " + layer + " of " + ap.getFullName());// lambdaExtend = ap.getLambdaBaseExtend(); } long gridExtend = DBMath.lambdaToGrid(lambdaExtend); if (gridExtend < 0 || gridExtend >= Integer.MAX_VALUE/8) throw new IllegalArgumentException("gridExtend=" + gridExtend); this.gridExtend = (int)gridExtend; } } /** * Defines a point in space that is relative to a NodeInst's bounds. * The TechPoint has two coordinates: X and Y. * Each of these coordinates is represented by an Edge class (EdgeH for X * and EdgeV for Y). * The Edge classes have two numbers: a multiplier and an adder. * The desired coordinate takes the NodeInst's center, adds in the * product of the Edge multiplier and the NodeInst's size, and then adds * in the Edge adder. * <P> * Arrays of TechPoint objects can be used to describe the bounds of * a particular layer in a NodeInst. Typically, four TechPoint objects * can describe a rectangle. Circles only need two (center and edge). * The <CODE>Poly.Style</CODE> class defines the possible types of * geometry. * @see EdgeH * @see EdgeV */ public static class TechPoint implements Serializable { private EdgeH x; private EdgeV y; /** * Constructs a <CODE>TechPoint</CODE> with the specified description. * @param x the EdgeH that converts a NodeInst into an X coordinate on that NodeInst. * @param y the EdgeV that converts a NodeInst into a Y coordinate on that NodeInst. */ public TechPoint(EdgeH x, EdgeV y) { this.x = x; this.y = y; } /** * Method to make a copy of this TechPoint, with all newly allocated parts. * @return a new TechPoint with the values in this one. */ public TechPoint duplicate() { TechPoint newTP = new TechPoint(new EdgeH(x.getMultiplier(), x.getAdder()), new EdgeV(y.getMultiplier(), y.getAdder())); return newTP; } /** * Method to make a 2-long TechPoint array that describes a point at the center of the node. * @return a new TechPoint array that describes a point at the center of the node. */ public static TechPoint [] makeCenterBox() { return new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.fromCenter(0), EdgeV.fromCenter(0)), new Technology.TechPoint(EdgeH.fromCenter(0), EdgeV.fromCenter(0))}; } /** * Method to make a 2-long TechPoint array that describes a box that fills the node. * @return a new TechPoint array that describes a box that fills the node. */ public static TechPoint [] makeFullBox() { return makeIndented(0); } /** * Method to make a 2-long TechPoint array that describes indentation by a specified amount. * @param amount the amount to indent the box. * @return a new TechPoint array that describes this indented box. */ public static TechPoint [] makeIndented(double amount) { return new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.fromLeft(amount), EdgeV.fromBottom(amount)), new Technology.TechPoint(EdgeH.fromRight(amount), EdgeV.fromTop(amount))}; } /** * Method similat to makeIndented(double amount) where the X and Y specified amounts are different * @param amountX the amount to indent the box along X. * @param amountY the amount to indent the box along Y. * @return a new TechPoint array that describes this indented box. */ public static TechPoint [] makeIndented(double amountX, double amountY) { return new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.fromLeft(amountX), EdgeV.fromBottom(amountY)), new Technology.TechPoint(EdgeH.fromRight(amountX), EdgeV.fromTop(amountY))}; } /** * Method to make a 2-long TechPoint array that describes indentation from the center by a specified amount. * @param amountX the amount to indent from the center the box along X. * @param amountY the amount to indent from the center the box along Y. * @return a new TechPoint array that describes this indented box. */ public static TechPoint [] makeIndentedFromCenter(double amountX, double amountY) { return new Technology.TechPoint [] { new Technology.TechPoint(EdgeH.fromCenter(-amountX), EdgeV.fromCenter(-amountY)), new Technology.TechPoint(EdgeH.fromCenter(amountX), EdgeV.fromCenter(amountY))}; } /** * Returns the EdgeH that converts a NodeInst into an X coordinate on that NodeInst. * @return the EdgeH that converts a NodeInst into an X coordinate on that NodeInst. */ public EdgeH getX() { return x; } /** * Returns the EdgeV that converts a NodeInst into a Y coordinate on that NodeInst. * @return the EdgeV that converts a NodeInst into a Y coordinate on that NodeInst. */ public EdgeV getY() { return y; } TechPoint makeCorrection(EPoint correction) { EdgeH h = new EdgeH(x.getMultiplier(), x.getAdder() + correction.getLambdaX()*x.getMultiplier()*2); EdgeV v = new EdgeV(y.getMultiplier(), y.getAdder() + correction.getLambdaY()*y.getMultiplier()*2); return new TechPoint(h, v); } } /** * Defines a single layer of a PrimitiveNode. * A PrimitiveNode has a list of these NodeLayer objects, one for * each layer in a typical NodeInst. * Each PrimitiveNode is composed of a number of NodeLayer descriptors. * A descriptor converts a specific NodeInst into a polygon that describe this particular layer. */ public static class NodeLayer { private Layer layer; private int portNum; private Poly.Type style; private int representation; private TechPoint [] points; private String message; private TextDescriptor descriptor; private double lWidth, rWidth, extentT, extendB; private long cutGridSizeX, cutGridSizeY, cutGridSep1D, cutGridSep2D; String sizeRule, cutSep1DRule, cutSep2DRule; // the meaning of "representation" /** * Indicates that the "points" list defines scalable points. * Each point here becomes a point on the Poly. */ public static final int POINTS = 0; /** * Indicates that the "points" list defines a rectangle. * It contains two diagonally opposite points. */ public static final int BOX = 1;// /**// * Indicates that the "points" list defines a minimum sized rectangle.// * It contains two diagonally opposite points, like BOX,// * and also contains a minimum box size beyond which the polygon will not shrink// * (again, two diagonally opposite points).// */// public static final int MINBOX = 2; /** * Indicates that the "points" list defines a rectangle, * where centers of multi-cut are located * It contains two diagonally opposite points. */ public static final int MULTICUTBOX = 3; /** * Constructs a <CODE>NodeLayer</CODE> with the specified description. * @param layer the <CODE>Layer</CODE> this is on. * @param portNum a 0-based index of the port (from the actual NodeInst) on this layer. * A negative value indicates that this layer is not connected to an electrical layer. * @param style the Poly.Type this NodeLayer will generate (polygon, circle, text, etc.). * @param representation tells how to interpret "points". It can be POINTS, BOX, or MULTICUTBOX. * @param points the list of coordinates (stored as TechPoints) associated with this NodeLayer. */ public NodeLayer(Layer layer, int portNum, Poly.Type style, int representation, TechPoint [] points) { this.layer = layer; this.portNum = portNum; this.style = style; this.representation = representation; this.points = points;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -