📄 info.java
字号:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: Info.java * Technology Editor, information superclass * Written by Steven M. Rubin, Sun Microsystems. * * Copyright (c) 2005 Sun Microsystems and Static Free Software * * Electric(tm) is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * Electric(tm) is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with Electric(tm); see the file COPYING. If not, write to * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, * Boston, Mass 02111-1307, USA. */package com.sun.electric.tool.user.tecEdit;import com.sun.electric.database.geometry.EGraphics;import com.sun.electric.database.hierarchy.Cell;import com.sun.electric.database.hierarchy.Library;import com.sun.electric.technology.ArcProto;import com.sun.electric.database.prototype.NodeProto;import com.sun.electric.database.topology.NodeInst;import com.sun.electric.database.variable.Variable;import com.sun.electric.technology.Layer;import com.sun.electric.technology.PrimitiveNode;import com.sun.electric.technology.technologies.Artwork;import com.sun.electric.technology.technologies.Generic;import java.awt.Color;import java.awt.geom.Point2D;import java.util.ArrayList;import java.util.Iterator;import java.util.List;/** * This class is the superclass for all information extraction classes in the Technology Editor. */public class Info{ /* * the meaning of OPTION_KEY on nodes * Note that these values are stored in the technology libraries and therefore cannot be changed. * Gaps in the table are where older values became obsolete. * Do not reuse lower numbers when creating a new attribute: add at the end * (as Ivan Sutherland likes to say, numbers are cheap). */ /** transparency layer (layer cell) */ static final int LAYERTRANSPARENCY = 1; /** style (layer cell) */ static final int LAYERSTYLE = 2; /** CIF name (layer cell) */ static final int LAYERCIF = 3; /** function (layer cell) */ static final int LAYERFUNCTION = 4; /** letters (layer cell) */ static final int LAYERLETTERS = 5; /** pattern (layer cell) */ static final int LAYERPATTERN = 6; /** pattern control (layer cell) */ static final int LAYERPATCONT = 7; /** patch of layer (node/arc cell) */ static final int LAYERPATCH = 8; /** function (arc cell) */ static final int ARCFUNCTION = 9; /** function (node cell) */ static final int NODEFUNCTION = 10; /** fixed-angle (arc cell) */ static final int ARCFIXANG = 11; /** wipes pins (arc cell) */ static final int ARCWIPESPINS = 12; /** end extension (arc cell) */ static final int ARCNOEXTEND = 13; /** scale (info cell) */ static final int TECHSCALE = 14; /** description (info cell) */ static final int TECHDESCRIPT = 15; /** serpentine MOS trans (node cell) */ static final int NODESERPENTINE = 16; /** DRC minimum width (layer cell, OBSOLETE) */ static final int LAYERDRCMINWID = 17; /** port object (node cell) */ static final int PORTOBJ = 18; /** highlight object (node/arc cell) */ public static final int HIGHLIGHTOBJ = 19; /** Calma GDS-II layer (layer cell) */ static final int LAYERGDS = 20; /** square node (node cell) */ static final int NODESQUARE = 21; /** pin node can disappear (node cell) */ static final int NODEWIPES = 22; /** increment for arc angles (arc cell) */ static final int ARCINC = 23; /** separation of multiple contact cuts (node cell) */ static final int NODEMULTICUT = 24; /** lockable primitive (node cell) */ static final int NODELOCKABLE = 25; /** grab point object (node cell) */ static final int CENTEROBJ = 26; /** SPICE resistance (layer cell) */ static final int LAYERSPIRES = 27; /** SPICE capacitance (layer cell) */ static final int LAYERSPICAP = 28; /** SPICE edge capacitance (layer cell) */ static final int LAYERSPIECAP = 29; /** DXF layer (layer cell) */ static final int LAYERDXF = 30; /** 3D height (layer cell) */ static final int LAYER3DHEIGHT = 31; /** 3D thickness (layer cell) */ static final int LAYER3DTHICK = 32; /** color (layer cell) */ static final int LAYERCOLOR = 33; /** clear the pattern (layer cell) */ static final int LAYERPATCLEAR = 34; /** invert the pattern (layer cell) */ static final int LAYERPATINVERT = 35; /** copy the pattern (layer cell) */ static final int LAYERPATCOPY = 36; /** copy the pattern (layer cell) */ static final int LAYERPATPASTE = 37; /** Minimum resistance of SPICE elements (info cell) */ static final int TECHSPICEMINRES = 38; /** Minimum capacitance of SPICE elements (info cell) */ static final int TECHSPICEMINCAP = 39; /** Maximum antenna ratio (arc cell) */ static final int ARCANTENNARATIO = 40; /** Desired coverage percentage (layer cell) */ static final int LAYERCOVERAGE = 41; /** gate shrinkage, in um (info cell) */ static final int TECHGATESHRINK = 42; /** true if gate is included in resistance (info cell) */ static final int TECHGATEINCLUDED = 43; /** true to include the ground network (info cell) */ static final int TECHGROUNDINCLUDED= 44; /** the transparent colors (info cell) */ static final int TECHTRANSPCOLORS = 45; /** short name (info cell) */ static final int TECHSHORTNAME = 46; /** default foundry name (info cell) */ static final int TECHFOUNDRY = 47; /** default number of metals (info cell) */ static final int TECHDEFMETALS = 48; /** maximum series resistance (info cell) */ static final int TECHMAXSERIESRES = 49; /** spice level 1 header (info cell) */ static final int TECHSPICELEVEL1 = 50; /** spice level 2 header (info cell) */ static final int TECHSPICELEVEL2 = 51; /** spice level 3 header (info cell) */ static final int TECHSPICELEVEL3 = 52; /** is technology scale relevant (info cell) */ static final int TECHSCALERELEVANT = 53; /** array of distances (connected case) (info cell) */ static final int TECHCONDIST = 54; /** array of distances (unconnected case) (info cell) */ static final int TECHUNCONDIST = 55; /** description of menu palette (info cell) */ static final int TECHPALETTE = 56; /** curvable (arc cell) */ static final int ARCCURVABLE = 57; /** shrinks arcs (node cell) */ static final int NODESHRINKSARCS = 58; /** 3D transparency mode (layer cell) */ static final int LAYER3DMODE = 59; /** 3D transparency factor (layer cell) */ static final int LAYER3DFACTOR = 60; /** Spice template (node cell) */ static final int NODESPICETEMPLATE = 61; /** Elib width offset (arc cell) */ static final int ARCWIDTHOFFSET = 62; /** key of Variable holding layer information. */ public static final Variable.Key LAYER_KEY = Variable.newKey("EDTEC_layer"); /** key of Variable holding option information. */ public static final Variable.Key OPTION_KEY = Variable.newKey("EDTEC_option"); /** key of Variable holding component menu info. */ public static final Variable.Key COMPMENU_KEY = Variable.newKey("EDTEC_componentmenu"); /** key of Variable holding arc ordering. */ static final Variable.Key ARCSEQUENCE_KEY = Variable.newKey("EDTEC_arcsequence"); /** key of Variable holding node ordering. */ static final Variable.Key NODESEQUENCE_KEY = Variable.newKey("EDTEC_nodesequence"); /** key of Variable holding layer ordering. */ static final Variable.Key LAYERSEQUENCE_KEY = Variable.newKey("EDTEC_layersequence"); /** key of Variable marking geometry as min-size. */static final Variable.Key MINSIZEBOX_KEY = Variable.newKey("EDTEC_minbox"); /** key of Variable holding port name. */ static final Variable.Key PORTNAME_KEY = Variable.newKey("EDTEC_portname"); /** key of Variable holding port angle. */ static final Variable.Key PORTANGLE_KEY = Variable.newKey("EDTEC_portangle"); /** key of Variable holding port range. */ static final Variable.Key PORTRANGE_KEY = Variable.newKey("EDTEC_portrange"); /** key of Variable holding arc connection list. */ static final Variable.Key CONNECTION_KEY = Variable.newKey("EDTEC_connects"); /** key of Variable with color map table. */ static final Variable.Key COLORMAP_KEY = Variable.newKey("EDTEC_colormap"); /** key of Variable with color map table. */ static final Variable.Key DEPENDENTLIB_KEY = Variable.newKey("EDTEC_dependent_libraries"); /** key of Variable with transparent color list. */ static final Variable.Key TRANSLAYER_KEY = Variable.newKey("EDTEC_transparent_layers"); /** key of Variable holding port meaning. */ static final Variable.Key PORTMEANING_KEY = Variable.newKey("EDTEC_portmeaning"); /** * Class for describing special text in a cell */ protected static class SpecialTextDescr { NodeInst ni; Object value; int extra; double x, y; int funct; protected SpecialTextDescr(double x, double y, int funct) { ni = null; value = null; this.x = x; this.y = y; this.funct = funct; } }; /** * Method to create special text geometry described by "table" in cell "np". */ protected static void createSpecialText(Cell np, SpecialTextDescr [] table) { // don't create any nodes already there for(int i=0; i < table.length; i++) table[i].ni = null; for(Iterator<NodeInst> it = np.getNodes(); it.hasNext(); ) { NodeInst ni = it.next(); Variable var = ni.getVar(OPTION_KEY); if (var == null) continue; foundNodeForFunction(ni, ((Integer)var.getObject()).intValue(), table); } for(int i=0; i < table.length; i++) { if (table[i].ni != null) continue; table[i].ni = NodeInst.makeInstance(Generic.tech().invisiblePinNode, new Point2D.Double(table[i].x, table[i].y), 0, 0, np); if (table[i].ni == null) return; String str = null; switch (table[i].funct) { case TECHSHORTNAME: str = "ShortName: " + (String)table[i].value; break; case TECHSCALE: str = "Scale: " + ((Double)table[i].value).doubleValue(); break; case TECHFOUNDRY: str = "DefaultFoundry: " + (String)table[i].value; break; case TECHDEFMETALS: str = "Default Number Of Metals: " + ((Integer)table[i].value).intValue(); break; case TECHDESCRIPT: str = "Description: " + (String)table[i].value; break; case TECHSPICEMINRES: str = "Minimum Resistance: " + ((Double)table[i].value).doubleValue(); break; case TECHSPICEMINCAP: str = "Minimum Capacitance: " + ((Double)table[i].value).doubleValue(); break; case TECHMAXSERIESRES: str = "Max Series Resistance: " + ((Double)table[i].value).doubleValue(); break; case TECHGATESHRINK: str = "Gate Shrinkage: " + ((Double)table[i].value).doubleValue(); break; case TECHGATEINCLUDED: str = "Gates Included in Resistance: " + (((Boolean)table[i].value).booleanValue() ? "Yes" : "No"); break; case TECHGROUNDINCLUDED: str = "Parasitics Includes Ground: " + (((Boolean)table[i].value).booleanValue() ? "Yes" : "No"); break; case TECHTRANSPCOLORS: table[i].ni.newVar(TRANSLAYER_KEY, GeneralInfo.makeTransparentColorsLine((Color [])table[i].value)); str = "Transparent Colors"; break; case LAYERFUNCTION: str = "Function: " + LayerInfo.makeLayerFunctionName((Layer.Function)table[i].value, table[i].extra); break; case LAYERCOLOR: EGraphics desc = (EGraphics)table[i].value; str = "Color: " + desc.getColor().getRed() + "," + desc.getColor().getGreen() + "," + desc.getColor().getBlue() + ", " + desc.getOpacity() + "," + (desc.getForeground() ? "on" : "off"); break; case LAYERTRANSPARENCY: desc = (EGraphics)table[i].value; str = "Transparency: " + (desc.getTransparentLayer() == 0 ? "none" : "layer-" + desc.getTransparentLayer()); break; case LAYERSTYLE: desc = (EGraphics)table[i].value; str = "Style: "; if (desc.isPatternedOnDisplay()) { EGraphics.Outline o = desc.getOutlined(); str += "Patterned/Outline=" + o.getName();
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -