📄 xml.java
字号:
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 spiceTemplate: 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. * * <p>By default, do nothing. Application writers may override this * method to take specific actions for each chunk of character data * (such as adding the data to a node or buffer, or printing it to * a file).</p> * * @param ch The characters. * @param start The start position in the character array. * @param length The number of characters to use from the * character array. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#characters */ public void characters(char ch[], int start, int length) throws SAXException { if (acceptCharacters) { charBuffer.append(ch, start, length); } else { boolean nonBlank = false; for (int i = 0; i < length; i++) { char c = ch[start + i]; nonBlank = nonBlank || c != ' ' && c != '\n'; } if (nonBlank) { System.out.print("characters size=" + ch.length + " start=" + start + " length=" + length + " {"); for (int i = 0; i < length; i++) System.out.print(ch[start + i]); System.out.println("}"); } } } /** * Receive notification of ignorable whitespace in element content. * * <p>By default, do nothing. Application writers may override this * method to take specific actions for each chunk of ignorable * whitespace (such as adding data to a node or buffer, or printing * it to a file).</p> * * @param ch The whitespace characters. * @param start The start position in the character array. * @param length The number of characters to use from the * character array. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#ignorableWhitespace */ public void ignorableWhitespace(char ch[], int start, int length) throws SAXException {// int x = 0; } /** * Receive notification of a processing instruction. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.</p> * * @param target The processing instruction target. * @param data The processing instruction data, or null if * none is supplied. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#processingInstruction */ public void processingInstruction(String target, String data) throws SAXException {// int x = 0; } /** * Receive notification of a skipped entity. * * <p>By default, do nothing. Application writers may override this * method in a subclass to take specific actions for each * processing instruction, such as setting status variables or * invoking other methods.</p> * * @param name The name of the skipped entity. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ContentHandler#processingInstruction */ public void skippedEntity(String name) throws SAXException {// int x = 0; } //////////////////////////////////////////////////////////////////// // Default implementation of the ErrorHandler interface. //////////////////////////////////////////////////////////////////// /** * Receive notification of a parser warning. * * <p>The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each warning, such as inserting the message in a log file or * printing it to the console.</p> * * @param e The warning information encoded as an exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ErrorHandler#warning * @see org.xml.sax.SAXParseException */ public void warning(SAXParseException e) throws SAXException { System.out.println("warning publicId=" + e.getPublicId() + " systemId=" + e.getSystemId() + " line=" + e.getLineNumber() + " column=" + e.getColumnNumber() + " message=" + e.getMessage() + " exception=" + e.getException()); } /** * Receive notification of a recoverable parser error. * * <p>The default implementation does nothing. Application writers * may override this method in a subclass to take specific actions * for each error, such as inserting the message in a log file or * printing it to the console.</p> * * @param e The error information encoded as an exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ErrorHandler#warning * @see org.xml.sax.SAXParseException */ public void error(SAXParseException e) throws SAXException {// System.out.println("error publicId=" + e.getPublicId() + " systemId=" + e.getSystemId() +// " line=" + e.getLineNumber() + " column=" + e.getColumnNumber() + " message=" + e.getMessage() + " exception=" + e.getException()); throw e; } /** * Report a fatal XML parsing error. * * <p>The default implementation throws a SAXParseException. * Application writers may override this method in a subclass if * they need to take specific actions for each fatal error (such as * collecting all of the errors into a single report): in any case, * the application must stop all regular processing when this * method is invoked, since the document is no longer reliable, and * the parser may no longer report parsing events.</p> * * @param e The error information encoded as an exception. * @exception org.xml.sax.SAXException Any SAX exception, possibly * wrapping another exception. * @see org.xml.sax.ErrorHandler#fatalError * @see org.xml.sax.SAXParseException */ public void fatalError(SAXParseException e) throws SAXException {// System.out.println("fatal error publicId=" + e.getPublicId() + " systemId=" + e.getSystemId() +// " line=" + e.getLineNumber() + " column=" + e.getColumnNumber() + " message=" + e.getMessage() + " exception=" + e.getException()); throw e; } } private static class Writer { private static final int INDENT_WIDTH = 4; protected final PrintWriter out; private int indent; protected boolean indentEmitted; private Writer(PrintWriter out) { this.out = out; } private void writeTechnology(Xml.Technology t) { Calendar cal = Calendar.getInstance(); cal.setTime(new Date()); header(); pl(""); out.println("<!--"); pl(" *"); pl(" * Electric(tm) VLSI Design System"); pl(" *"); pl(" * File: " + t.techName + ".xml"); pl(" * " + t.techName + " technology description"); pl(" * Generated automatically from a library"); pl(" *"); pl(" * Copyright (c) " + cal.get(Calendar.YEAR) + " Sun Microsystems and Static Free Software"); pl(" *"); pl(" * Electric(tm) is free software; you can redistribute it and/or modify"); pl(" * it under the terms of the GNU General Public License as published by"); pl(" * the Free Software Foundation; either version 3 of the License, or"); pl(" * (at your option) any later version."); pl(" *"); pl(" * Electric(tm) is distributed in the hope that it will be useful,"); pl(" * but WITHOUT ANY WARRANTY; without even the implied warranty of"); pl(" * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the"); pl(" * GNU General Public License for more details."); pl(" *"); pl(" * You should have received a copy of the GNU General Public License"); pl(" * along with Electric(tm); see the file COPYING. If not, write to"); pl(" * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,"); pl(" * Boston, Mass 02111-1307, USA."); pl(" */"); out.println("-->"); l(); b(XmlKeyword.technology); a("name", t.techName); a("class", t.className); l(); a("xmlns", "http://electric.sun.com/Technology"); l(); a("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance"); l(); a("xsi:schemaLocation", "http://electric.sun.com/Technology ../../technology/Technology.xsd"); cl(
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -