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

📄 getinfonode.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		double initXSize = ni.getLambdaBaseXSize();		double initYSize = ni.getLambdaBaseYSize();		initialRotation = ni.getAngle();		swapXY = false;		if (initialRotation == 900 || initialRotation == 2700) swapXY = true;		String protoName = np.describe(false);		String extra = ni.getTechSpecificAddition();		if (extra.length() > 0) protoName += " (" + extra + ")";		type.setText(protoName);		name.setText(initialName);		xPos.setText(TextUtils.formatDouble(initialXPos));		yPos.setText(TextUtils.formatDouble(initialYPos));		boolean realMirrorX = ni.isXMirrored();		boolean realMirrorY = ni.isYMirrored();		if (swapXY)		{			xSize.setText(TextUtils.formatDouble(initYSize));			ySize.setText(TextUtils.formatDouble(initXSize));			initialMirrorX = realMirrorY;			initialMirrorY = realMirrorX;		} else		{			xSize.setText(TextUtils.formatDouble(initXSize));			ySize.setText(TextUtils.formatDouble(initYSize));			initialMirrorX = realMirrorX;			initialMirrorY = realMirrorY;		}		initialXSize = xSize.getText();		initialYSize = ySize.getText();		mirrorX.setSelected(initialMirrorX);		mirrorY.setSelected(initialMirrorY);		rotation.setText(TextUtils.formatDouble(initialRotation / 10.0));		// special case for transistors		PrimitiveNodeSize npSize = ni.getPrimitiveDependentNodeSize(null);		if (npSize != null) {			xsizeLabel.setText("Width:");	        xsizeLabel.setDisplayedMnemonic('w');			ysizeLabel.setText("Length:");	        ysizeLabel.setDisplayedMnemonic('l');            String finalW = npSize.getWidthInString(), finalH = npSize.getLengthInString();            xSize.setText(finalW);            ySize.setText(finalH);            initialXSize = xSize.getText();			initialYSize = ySize.getText();		} else {			xsizeLabel.setText("X size:");	        xsizeLabel.setDisplayedMnemonic('s');			ysizeLabel.setText("Y size:");	        ysizeLabel.setDisplayedMnemonic('z');		}		// in "more" version		easyToSelect.setEnabled(true);		invisibleOutsideCell.setEnabled(true);		ports.setEnabled(true);		attributes.setEnabled(true);		attributesTable.setEnabled(true);		busMembers.setEnabled(true);		listPane.setEnabled(true);		locked.setEnabled(true);		editParameters.setEnabled(false);		if (ni.isCellInstance()) editParameters.setEnabled(true);		colorAndPattern.setEnabled(ni.getProto().getTechnology() == Artwork.tech());		// grab all attributes and parameters		allAttributes.clear();		for(Iterator<Variable> it = ni.getParametersAndVariables(); it.hasNext(); )		{			Variable var = it.next();			String name = var.getKey().getName();			if (!name.startsWith("ATTR_")) continue;			// found an attribute			AttributesTable.AttValPair avp = new AttributesTable.AttValPair();			avp.key = var.getKey();			avp.trueName = var.getTrueName();			avp.value = var.getObject().toString();			avp.code = var.isCode();			allAttributes.add(avp);		}		boolean hasAttributes = allAttributes.size() != 0 || ni.getParameters().hasNext();		attributes.setEnabled(hasAttributes);		attributesTable.setEnabled(hasAttributes);		attributesTable.setElectricObject(ni);		if (attributes.isSelected() && !hasAttributes) ports.setSelected(true);		int busWidth = 1;		Netlist nl = shownNode.getParent().acquireUserNetlist();		if (nl != null)		{			if (shownPort != null && shownPort instanceof Export)				busWidth = nl.getBusWidth((Export)shownPort);		}		if (busWidth <= 1)		{			if (busMembers.isSelected()) ports.setSelected(true);			busMembers.setEnabled(false);		}		showProperList(false);		// special lines default to empty		textFieldLabel.setText("");		textField.setText("");		textField.setEditable(false);		popupLabel.setText("");		popup.removeAllItems();		popup.setEnabled(false);		// see if this node has outline information		Point2D [] outline = ni.getTrace();		if (outline != null)		{			sizeEditable = false;		}		// if there is outline information on a transistor, remember that		initialTextField = null;		boolean lengthEditable = false;		if (ni.isSerpentineTransistor())			lengthEditable = true;		// set the expansion button		if (np instanceof Cell)		{			expanded.setEnabled(true);			unexpanded.setEnabled(true);			initialExpansion = ni.isExpanded();			if (initialExpansion) expanded.setSelected(true); else				unexpanded.setSelected(true);			sizeEditable = false;		} else		{			expanded.setEnabled(false);			unexpanded.setEnabled(false);		}		if (sizeEditable) {			xSize.setEditable(true);			ySize.setEditable(true);		} else {			xSize.setEditable(false);			ySize.setEditable(lengthEditable);		}		// load visible-outside-cell state		initialInvisibleOutsideCell = ni.isVisInside();		invisibleOutsideCell.setSelected(initialInvisibleOutsideCell);		// load easy of selection		initialEasyToSelect = !ni.isHardSelect();		easyToSelect.setSelected(initialEasyToSelect);		if (np instanceof Cell && !User.isEasySelectionOfCellInstances())			easyToSelect.setEnabled(false);		// load locked state		initialLocked = ni.isLocked();		locked.setSelected(initialLocked);		// load special node information		PrimitiveNode.Function fun = ni.getFunction();		if (np == Schematics.tech().transistorNode || np == Schematics.tech().transistor4Node)		{			if (!ni.getFunction().isFET())			{				textField.setEditable(true);				textFieldLabel.setText("Area:");				Variable var = ni.getVar(Schematics.ATTR_AREA);				textField.setText(var.getPureValue(-1));			}		}		scalableTrans = false;		if (!ni.isCellInstance())		{			if (np.getTechnology() == Technology.getMocmosTechnology())			{				if (np.getName().equals("P-Transistor-Scalable") ||					np.getName().equals("N-Transistor-Scalable"))						scalableTrans = true;			}		}		if (scalableTrans)		{			popupLabel.setText("Contacts:");			popup.addItem("Top & Bottom / normal spacing");			popup.addItem("Top & Bottom / half-unit closer");			popup.addItem("Only Bottom / normal spacing");			popup.addItem("Only Bottom / half-unit closer");			popup.addItem("None");			String pt = ni.getVarValue(Technology.TRANS_CONTACT, String.class);			int numContacts = 2;			boolean insetContacts = false;			if (pt != null)			{				for(int i=0; i<pt.length(); i++)				{					char chr = pt.charAt(i);					if (chr == '0' || chr == '1' || chr == '2')					{						numContacts = chr - '0';					} else if (chr == 'i' || chr == 'I') insetContacts = true;				}			}			initialPopupIndex = (2 - numContacts) * 2;			if (insetContacts && numContacts > 0) initialPopupIndex++;			popup.setSelectedIndex(initialPopupIndex);			popup.setEnabled(true);			textFieldLabel.setText("Width:");			Variable var = ni.getVar(Schematics.ATTR_WIDTH);			double width = ni.getLambdaBaseXSize();			if (var != null) width = TextUtils.atof(var.getPureValue(-1));			initialTextField = Double.toString(width);			textField.setEditable(true);			textField.setText(initialTextField);		}		if (fun.isResistor())		{			if (fun == PrimitiveNode.Function.RESPPOLY || fun == PrimitiveNode.Function.RESNPOLY)				textFieldLabel.setText("Poly resistance:");            else if (fun == PrimitiveNode.Function.RESPWELL || fun == PrimitiveNode.Function.RESNWELL)				textFieldLabel.setText("Well resistance:");            else                textFieldLabel.setText("Resistance:");//			formatinfstr(infstr, x_(" (%s):"),//				TRANSLATE(us_resistancenames[(us_electricalunits&INTERNALRESUNITS) >> INTERNALRESUNITSSH]));			Variable var = ni.getVar(Schematics.SCHEM_RESISTANCE);			if (var == null) initialTextField = "0"; else				initialTextField = new String(var.getObject().toString());			textField.setEditable(true);			textField.setText(initialTextField);		}		if (fun.isCapacitor())		{			if (fun == PrimitiveNode.Function.ECAPAC)				textFieldLabel.setText("Electrolytic cap:"); else					textFieldLabel.setText("Capacitance:");//			formatinfstr(infstr, x_(" (%s):"),//				TRANSLATE(us_capacitancenames[(us_electricalunits&INTERNALCAPUNITS) >> INTERNALCAPUNITSSH]));			Variable var = ni.getVar(Schematics.SCHEM_CAPACITANCE);			if (var == null) initialTextField = "0"; else				initialTextField = new String(var.getObject().toString());			textField.setEditable(true);			textField.setText(initialTextField);		}		if (fun == PrimitiveNode.Function.INDUCT)		{			textFieldLabel.setText("Inductance:");//			formatinfstr(infstr, x_(" (%s):"),//				TRANSLATE(us_inductancenames[(us_electricalunits&INTERNALINDUNITS) >> INTERNALINDUNITSSH]));			Variable var = ni.getVar(Schematics.SCHEM_INDUCTANCE);			if (var == null) initialTextField = "0"; else				initialTextField = new String(var.getObject().toString());			textField.setEditable(true);			textField.setText(initialTextField);		}		if (np == Schematics.tech().bboxNode)		{			textFieldLabel.setText("Function:");			Variable var = ni.getVar(Schematics.SCHEM_FUNCTION);			if (var == null) initialTextField = ""; else				initialTextField = new String(var.getObject().toString());			textField.setEditable(true);			textField.setText(initialTextField);		}		if (np == Schematics.tech().globalNode)		{			textFieldLabel.setText("Global name:");			Variable var = ni.getVar(Schematics.SCHEM_GLOBAL_NAME);			if (var == null) initialTextField = ""; else				initialTextField = new String(var.getObject().toString());			textField.setEditable(true);			textField.setText(initialTextField);			popupLabel.setText("Characteristics:");			List<PortCharacteristic> characteristics = PortCharacteristic.getOrderedCharacteristics();			for(PortCharacteristic ch : characteristics)			{				popup.addItem(ch.getName());			}			PortCharacteristic ch = PortCharacteristic.findCharacteristic(ni.getTechSpecific());			initialPopupEntry = ch.getName();			popup.setSelectedItem(initialPopupEntry);			popup.setEnabled(true);		}		// handle technology editor primitives		if (ni.getParent().isInTechnologyLibrary())		{			popupLabel.setText("Tech. editor:");			popup.addItem(Manipulate.describeNodeMeaning(ni));		}		// load the degrees of a circle if appropriate		if (np == Artwork.tech().circleNode || np == Artwork.tech().thickCircleNode)		{			double [] arcData = ni.getArcDegrees();			double start = DBMath.round(arcData[0] * 180.0 / Math.PI);			double curvature = DBMath.round(arcData[1] * 180.0 / Math.PI);			if (start != 0.0)			{				textFieldLabel.setText("Offset angle / Degrees of circle:");				initialTextField = new String(start + " / " + curvature);			} else			{				textFieldLabel.setText("Degrees of circle:");				if (curvature == 0) initialTextField = "360"; else					initialTextField = new String(Double.toString(curvature));			}			textField.setEditable(true);			textField.setText(initialTextField);		}        // Setting the initial focus        EDialog.focusOnTextField(name);	}	private void showProperList(boolean showAll)	{		listModel.clear();		portObjects.clear();		if (ports.isSelected())		{			// show ports			listPane.setViewportView(list);			NodeProto np = shownNode.getProto();			List<String> portMessages = new ArrayList<String>();			int selectedLine = 0;			int total = 0;			for(Iterator<PortInst> it = shownNode.getPortInsts(); it.hasNext(); )			{				PortInst pi = it.next();				if (!showAll && total++ > 100)				{					int numLeft = 1;					while(it.hasNext()) { pi = it.next();   numLeft++; }					String description = "*** Plus " + numLeft + " more ports.  Use 'Show All' to see them.";					portMessages.add(description);					portObjects.add(null);					showAllButton.setEnabled(true);					break;				}				PortProto pp = pi.getPortProto();				PortCharacteristic ch = pp.getCharacteristic();				String description;				if (ch == PortCharacteristic.UNKNOWN) description = "Port "; else					description = ch.getName() + " port ";

⌨️ 快捷键说明

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