⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xml805.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
                case portAngle:                    curPort.portAngle = Integer.parseInt(a("primary"));                    curPort.portRange = Integer.parseInt(a("range"));                    break;                case polygonal:                    curNode.specialType = com.sun.electric.technology.PrimitiveNode.POLYGONAL;                    break;                case serpTrans:                    curNode.specialType = com.sun.electric.technology.PrimitiveNode.SERPTRANS;                    curNode.specialValues = new double[6];                    curSpecialValueIndex = 0;                    break;                case minSizeRule:                    curNode.nodeSizeRule = new NodeSizeRule();                    curNode.nodeSizeRule.width = Double.parseDouble(a("width"));                    curNode.nodeSizeRule.height = Double.parseDouble(a("height"));                    curNode.nodeSizeRule.rule = a("rule");                    break;                case spiceHeader:                    curSpiceHeader = new SpiceHeader();                    curSpiceHeader.level = Integer.parseInt(a("level"));                    tech.spiceHeaders.add(curSpiceHeader);                    break;                case spiceLine:                    curSpiceHeader.spiceLines.add(a("line"));                    break;                case menuPalette:                    tech.menuPalette = new MenuPalette();                    tech.menuPalette.numColumns = Integer.parseInt(a("numColumns"));                    break;                case menuBox:                    curMenuBox = new ArrayList<Object>();                    tech.menuPalette.menuBoxes.add(curMenuBox);                    break;                case menuNodeInst:                    curMenuNodeInst = new MenuNodeInst();                    curMenuNodeInst.protoName = a("protoName");                    curMenuNodeInst.function =  com.sun.electric.technology.PrimitiveNode.Function.valueOf(a("function"));                    break;                case menuNodeText:                    curMenuNodeInst.text = a("text");                    curMenuNodeInst.fontSize = Double.parseDouble(a("size"));                    break;                case Foundry:                    curFoundry = new Foundry();                    curFoundry.name = a("name");                    tech.foundries.add(curFoundry);                    break;                case layerGds:                    curFoundry.layerGds.put(a("layer"), a("gds"));                    break;                case LayerRule:                case LayersRule:                case NodeLayersRule:                case NodeRule:                    DRCTemplate.parseXmlElement(curFoundry.rules, key.name(), attributes);                    break;                default:                    assert key.hasText;                    beginCharacters();//                    System.out.print(">");                    return;            }            assert !key.hasText;//            System.out.println(">");            if (dump) {                System.out.println("startElement uri=" + uri + " localName=" + localName + " qName=" + qName);                for (int i = 0; i < attributes.getLength(); i++) {                    System.out.println("\tattribute " + i + " uri=" + attributes.getURI(i) +                            " localName=" + attributes.getLocalName(i) + " QName=" + attributes.getQName(i) +                            " type=" + attributes.getType(i) + " value=<" + attributes.getValue(i) + ">");                }            }        }        private double da_(String attrName, double defaultValue) {            String s = a_(attrName);            return s != null ? Double.parseDouble(s) : defaultValue;        }        private String a(String attrName) {            String v = attributes.getValue(attrName);//            System.out.print(" " + attrName + "=\"" + v + "\"");            return v;        }        private String a_(String attrName) {            String v = attributes.getValue(attrName);            if (v == null) return null;//            System.out.print(" " + attrName + "=\"" + v + "\"");            return v;        }        /**         * Receive notification of the end of an element.         *         * <p>By default, do nothing.  Application writers may override this         * method in a subclass to take specific actions at the end of         * each element (such as finalising a tree node or writing         * output to a file).</p>         *         * @param uri The Namespace URI, or the empty string if the         *        element has no Namespace URI or if Namespace         *        processing is not being performed.         * @param localName The local name (without prefix), or the         *        empty string if Namespace processing is not being         *        performed.         * @param qName The qualified name (with prefix), or the         *        empty string if qualified names are not available.         * @exception org.xml.sax.SAXException Any SAX exception, possibly         *            wrapping another exception.         * @see org.xml.sax.ContentHandler#endElement         */        public void endElement(String uri, String localName, String qName)        throws SAXException {            XmlKeyword key = xmlKeywords.get(localName);            if (key.hasText) {                String text = endCharacters();//                System.out.println(text + "</" + localName + ">");                switch (key) {                    case shortName:                        tech.shortTechName = text;                        break;                    case description:                        tech.description = text;                        break;                    case r:                        curR = Integer.parseInt(text);                        break;                    case g:                        curG = Integer.parseInt(text);                        break;                    case b:                        curB = Integer.parseInt(text);                        break;                    case patternedOnDisplay:                        patternedOnDisplay = Boolean.parseBoolean(text);                        break;                    case patternedOnPrinter:                        patternedOnPrinter = Boolean.parseBoolean(text);                        break;                    case pattern:                        int p = 0;                        assert text.length() == 16;                        for (int j = 0; j < text.length(); j++) {                            if (text.charAt(text.length() - j - 1) != ' ')                                p |= (1 << j);                        }                        pattern[curPatternIndex++] = p;                        break;                    case outlined:                        outline = EGraphics.Outline.valueOf(text);                        break;                    case opacity:                        opacity = Double.parseDouble(text);                        break;                    case foreground:                        foreground = Boolean.parseBoolean(text);                        break;                    case oldName:                        if (curLayer != null)                            curLayer.pureLayerNode.oldName = text;                        if (curArc != null)                            curArc.oldName = text;                        if (curNode != null)                            curNode.oldName = text;                        break;                    case extended:                        curArc.extended = Boolean.parseBoolean(text);                        break;                    case fixedAngle:                        curArc.fixedAngle = Boolean.parseBoolean(text);                        break;                    case wipable:                        curArc.wipable = Boolean.parseBoolean(text);                        break;                    case angleIncrement:                        curArc.angleIncrement = Integer.parseInt(text);                        break;                    case antennaRatio:                        curArc.antennaRatio = Double.parseDouble(text);                        break;                    case portTopology:                        curPort.portTopology = Integer.parseInt(text);                        break;                    case portArc:                        if (curLayer != null && curLayer.pureLayerNode != null)                            curLayer.pureLayerNode.portArcs.add(text);                        if (curPort != null)                            curPort.portArcs.add(text);                        break;                    case specialValue:                        curNode.specialValues[curSpecialValueIndex++] = Double.parseDouble(text);                        break;                    case menuArc:                        curMenuBox.add(tech.findArc(text));                        break;                    case menuNode:                        curMenuBox.add(tech.findNode(text));                        break;                    case menuText:                        curMenuBox.add(text);                        break;                    case lambda:                        curDistance.value += Double.parseDouble(text);                        break;                    default:                        assert false;                }                return;            }//            System.out.println("</" + localName + ">");            switch (key) {                case technology:                    break;                case transparentLayer:                    while (curTransparent > tech.transparentLayers.size())                        tech.transparentLayers.add(null);                    Color oldColor = tech.transparentLayers.set(curTransparent - 1, new Color(curR, curG, curB));                    assert oldColor == null;                    break;                case layer:                    assert curPatternIndex == pattern.length;                    curLayer.desc = new EGraphics(patternedOnDisplay, patternedOnPrinter, outline, curTransparent,                            curR, curG, curB, opacity, foreground, pattern.clone());                    assert tech.findLayer(curLayer.name) == null;                    tech.layers.add(curLayer);                    curLayer = null;                    break;                case arcProto:                    tech.arcs.add(curArc);                    curArc = null;                    break;                case primitiveNode:                    tech.nodes.add(curNode);                    curNode = null;                    break;                case nodeLayer:                    curNode.nodeLayers.add(curNodeLayer);                    curNodeLayer = null;                    break;                case primitivePort:                    curNode.ports.add(curPort);                    curPort = null;                    break;                case menuNodeInst:                    curMenuBox.add(curMenuNodeInst);                    curMenuNodeInst = null;                    break;                case version:                case spiceHeader:                case numMetals:                case scale:                case defaultFoundry:                case minResistance:                case minCapacitance:                case transparentColor:                case opaqueColor:                case display3D:                case cifLayer:                case skillLayer:                case parasitics:                case pureLayerNode:                case wipable:                case curvable:                case special:                case notUsed:                case skipSizeInPalette:                case diskOffset:                case defaultWidth:                case arcLayer:                case shrinkArcs:                case square:                case canBeZeroSize:                case wipes:                case lockable:                case edgeSelect:                case lowVt:                case highVt:                case nativeBit:                case od18:                case od25:                case od33:                case defaultHeight:                case sizeOffset:                case box:                case points:                case multicutbox:                case serpbox:                case lambdaBox:                case techPoint:                case portAngle:                case polygonal:                case serpTrans:                case minSizeRule:                case spiceLine:                case menuPalette:                case menuBox:                case menuNodeText:                case Foundry:                case layerGds:                case LayerRule:                case LayersRule:                case NodeLayersRule:                case NodeRule:                    break;                default:                    assert false;            }        }        /**         * Receive notification of character data inside an element.         *

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -