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

📄 manipulate.java

📁 The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
			case Info.LAYERPATTERN:      modLayerPattern(wnd, ni);           break;			case Info.LAYERPATCONT:      doPatternControl(wnd, ni, 0);       break;			case Info.LAYERPATCLEAR:     doPatternControl(wnd, ni, 1);       break;			case Info.LAYERPATINVERT:    doPatternControl(wnd, ni, 2);       break;			case Info.LAYERPATCOPY:      doPatternControl(wnd, ni, 3);       break;			case Info.LAYERPATPASTE:     doPatternControl(wnd, ni, 4);       break;			case Info.LAYERPATCH:        modLayerPatch(wnd, ni);             break;			case Info.LAYERCOVERAGE:     modLayerCoverage(wnd, ni);          break;			case Info.ARCFIXANG:         modArcFixAng(wnd, ni);              break;			case Info.ARCFUNCTION:       modArcFunction(wnd, ni);            break;			case Info.ARCINC:            modArcAngInc(wnd, ni);              break;			case Info.ARCNOEXTEND:       modArcExtension(wnd, ni);           break;			case Info.ARCWIPESPINS:      modArcWipes(wnd, ni);               break;			case Info.ARCANTENNARATIO:   modArcAntennaRatio(wnd, ni);        break;			case Info.ARCWIDTHOFFSET:    modArcWidthOffset(wnd, ni);         break;			case Info.NODEFUNCTION:      modNodeFunction(wnd, ni);           break;			case Info.NODELOCKABLE:      modNodeLockability(wnd, ni);        break;			case Info.NODESERPENTINE:    modNodeSerpentine(wnd, ni);         break;			case Info.NODESQUARE:        modNodeSquare(wnd, ni);             break;			case Info.NODEWIPES:         modNodeWipes(wnd, ni);              break;			case Info.NODESPICETEMPLATE: modNodeSpiceTemplate(wnd, ni);      break;			case Info.PORTOBJ:           modPort(wnd, ni);                   break;			case Info.HIGHLIGHTOBJ:				System.out.println("Cannot modify highlight boxes");				break;			default:				System.out.println("Cannot modify this object");				break;		}	}	/***************************** OBJECT MODIFICATION *****************************/	private static void modTechMinResistance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Minimum Resistance",			"Minimum resistance (for parasitics):", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Minimum Resistance: " + newUnit);	}	private static void modTechMinCapacitance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Minimum Capacitance",			"Minimum capacitance (for parasitics):", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Minimum Capacitance: " + newUnit);	}	private static void modTechMaxSeriesResistance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Maximum Series Resistance",			"Maximum Series Resistance (for parasitics):", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Maximum Series Resistance: " + newUnit);	}	private static void modArcAntennaRatio(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Antenna Ratio",			"Maximum antenna ratio for this layer:", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Antenna Ratio: " + newUnit);	}	private static void modArcWidthOffset(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Width Offset",			"ELIB width offset for this arc:", initialMsg);		if (newUnit != null) new SetTextJob(ni, "ELIB width offset: " + newUnit);	}	private static void modLayerCoverage(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Coverage Percent",			"Desired coverage percentage:", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Coverage percent: " + newUnit);	}	private static void modTechGateShrinkage(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newUnit = PromptAt.showPromptAt(wnd, ni, "Change Gate Shrinkage",			"Gate shrinkage (in um):", initialMsg);		if (newUnit != null) new SetTextJob(ni, "Gate Shrinkage: " + newUnit);	}	private static void modTechGateIncluded(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		boolean initialChoice = initialMsg.equalsIgnoreCase("yes");		boolean finalChoice = PromptAt.showPromptAt(wnd, ni, "Change Whether Gate is Included in Resistance",			"Should the gate be included in resistance?", initialChoice);		if (finalChoice != initialChoice)		{			new SetTextJob(ni, "Gates Included in Resistance: " + (finalChoice ? "Yes" : "No"));		}	}	private static void modTechGroundIncluded(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		boolean initialChoice = initialMsg.equalsIgnoreCase("yes");		boolean finalChoice = PromptAt.showPromptAt(wnd, ni, "Change Whether parasitics include the ground network",			"Should parasitics include the ground network?", initialChoice);		if (finalChoice != initialChoice)		{			new SetTextJob(ni, "Parasitics Includes Ground: " + (finalChoice ? "Yes" : "No"));		}	}	private static void modTechTransparentColors(EditWindow wnd, NodeInst ni)	{		Color [] colors = GeneralInfo.getTransparentColors(ni);		if (colors == null) return;		for(;;)		{			PromptAt.Field [][] fields = new PromptAt.Field[colors.length+1][2];			for(int i=0; i<colors.length; i++)			{				fields[i][0] = new PromptAt.Field("Transparent layer " + (i+1) + ":", colors[i]);				JButton but = new JButton("Remove");				fields[i][1] = new PromptAt.Field(""+(i+1), but);			}			JButton addBut = new JButton("Add");			fields[colors.length][0] = new PromptAt.Field("add", addBut);			String choice = PromptAt.showPromptAt(wnd, ni, "Change Transparent Colors", fields);			if (choice == null) return;			if (choice.length() == 0)			{				// done				for(int i=0; i<colors.length; i++)					colors[i] = (Color)fields[i][0].getFinal();				new SetTransparentColorJob(ni, GeneralInfo.makeTransparentColorsLine(colors));				// redraw the demo layer in this cell				new RedoLayerGraphicsJob(ni.getParent());				break;			}			if (choice.equals("add"))			{				// add a layer				Color [] newColors = new Color[colors.length+1];				for(int i=0; i<colors.length; i++)					newColors[i] = (Color)fields[i][0].getFinal();				newColors[colors.length] = new Color(128, 128, 128);				colors = newColors;				continue;			}			// a layer was removed			int remove = TextUtils.atoi(choice);			Color [] newColors = new Color[colors.length-1];			int j = 0;			for(int i=0; i<colors.length; i++)			{				if (i+1 == remove) continue;				newColors[j++] = (Color)fields[i][0].getFinal();			}			colors = newColors;		}	}	private static void modLayerHeight(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newHei = PromptAt.showPromptAt(wnd, ni, "Change 3D Height",			"New 3D height (depth) for this layer:", initialMsg);		if (newHei != null) new SetTextJob(ni, "3D Height: " + newHei);	}	private static void modLayerThickness(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newThk = PromptAt.showPromptAt(wnd, ni, "Change 3D Thickness",			"New 3D thickness for this layer:", initialMsg);		if (newThk != null) new SetTextJob(ni, "3D Thickness: " + newThk);	}	private static void modLayerColor(EditWindow wnd, NodeInst ni)	{		String initialString = Info.getValueOnNode(ni);		StringTokenizer st = new StringTokenizer(initialString, ",");		if (st.countTokens() != 5)		{			System.out.println("Color information must have 5 fields, separated by commas");			return;		}		PromptAt.Field [] fields = new PromptAt.Field[3];		int r = TextUtils.atoi(st.nextToken());		int g = TextUtils.atoi(st.nextToken());		int b = TextUtils.atoi(st.nextToken());		fields[0] = new PromptAt.Field("Color:", new Color(r, g, b));		fields[1] = new PromptAt.Field("Opacity (0-1):", st.nextToken());		fields[2] = new PromptAt.Field("Foreground:", new String [] {"on", "off"}, st.nextToken());		String choice = PromptAt.showPromptAt(wnd, ni, "Change Color", fields);		if (choice == null) return;		Color col = (Color)fields[0].getFinal();		r = col.getRed();		g = col.getGreen();		b = col.getBlue();		double o = TextUtils.atof((String)fields[1].getFinal());		String oo = (String)fields[2].getFinal();		new SetTextJob(ni, "Color: " + r + "," + g + "," + b + ", " + o + "," + oo);		// redraw the demo layer in this cell		new RedoLayerGraphicsJob(ni.getParent());	}	private static void modLayerTransparency(EditWindow wnd, NodeInst ni)	{		String initialTransLayer = Info.getValueOnNode(ni);		String [] transNames = new String[11];		transNames[0] = "none";		transNames[1] = "layer-1";		transNames[2] = "layer-2";		transNames[3] = "layer-3";		transNames[4] = "layer-4";		transNames[5] = "layer-5";		transNames[6] = "layer-6";		transNames[7] = "layer-7";		transNames[8] = "layer-8";		transNames[9] = "layer-9";		transNames[10] = "layer-10";		String choice = PromptAt.showPromptAt(wnd, ni, "Change Transparent Layer",			"New transparent layer number for this layer:", initialTransLayer, transNames);		if (choice == null) return;		new SetTextJob(ni, "Transparency: " + choice);		// redraw the demo layer in this cell		new RedoLayerGraphicsJob(ni.getParent());	}	private static final String PRINTSOLID = "PRINTER: Solid";	private static final String PRINTPATTERNED = "PRINTER: Patterned";	private static void modLayerStyle(EditWindow wnd, NodeInst ni)	{		String initialStyleName = Info.getValueOnNode(ni);		String printerPart;		int commaPos = initialStyleName.indexOf(',');		if (commaPos < 0) printerPart = ""; else		{			printerPart = initialStyleName.substring(commaPos);			initialStyleName = initialStyleName.substring(0, commaPos);		}		List<EGraphics.Outline> outlines = EGraphics.Outline.getOutlines();		String [] styleNames = new String[outlines.size()+3];		styleNames[0] = "Solid";		int i = 1;		for(EGraphics.Outline o : outlines)		{			styleNames[i++] = "Patterned/Outline=" + o.getName();		}		styleNames[i++] = PRINTSOLID;		styleNames[i++] = PRINTPATTERNED;		String choice = PromptAt.showPromptAt(wnd, ni, "Change Layer Drawing Style",			"New drawing style for this layer:", initialStyleName, styleNames);		if (choice == null) return;		if (choice.equals(PRINTSOLID))		{			choice = initialStyleName + ",PrintSolid";		} else if (choice.equals(PRINTPATTERNED))		{			choice = initialStyleName;		} else choice += printerPart;		new SetTextJob(ni, "Style: " + choice);		// redraw the demo layer in this cell		new RedoLayerGraphicsJob(ni.getParent());	}	private static void modLayerCIF(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newCIF = PromptAt.showPromptAt(wnd, ni, "Change CIF layer name", "New CIF symbol for this layer:", initialMsg);		if (newCIF != null) new SetTextJob(ni, "CIF Layer: " + newCIF);	}	private static void modLayerGDS(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newGDS = PromptAt.showPromptAt(wnd, ni, "Change GDS layer name", "New GDS symbol for this layer:", initialMsg);		if (newGDS != null) new SetTextJob(ni, "GDS-II Layer: " + newGDS);	}	private static void modLayerResistance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newRes = PromptAt.showPromptAt(wnd, ni, "Change SPICE Layer Resistance",			"New SPICE resistance for this layer:", initialMsg);		if (newRes != null) new SetTextJob(ni, "SPICE Resistance: " + newRes);	}	private static void modLayerCapacitance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newCap = PromptAt.showPromptAt(wnd, ni, "Change SPICE Layer Capacitance",			"New SPICE capacitance for this layer:", initialMsg);		if (newCap != null) new SetTextJob(ni, "SPICE Capacitance: " + newCap);	}	private static void modLayerEdgeCapacitance(EditWindow wnd, NodeInst ni)	{		String initialMsg = Info.getValueOnNode(ni);		String newCap = PromptAt.showPromptAt(wnd, ni, "Change SPICE Layer Edge Capacitance",			"New SPICE edge capacitance for this layer:", initialMsg);		if (newCap != null) new SetTextJob(ni, "SPICE Edge Capacitance: " + newCap);	}	private static void modLayerFunction(EditWindow wnd, NodeInst ni)	{		String initialFuncName = Info.getValueOnNode(ni);		int commaPos = initialFuncName.indexOf(',');		if (commaPos >= 0) initialFuncName = initialFuncName.substring(0, commaPos);		// make a list of all layer functions and extras		List<Layer.Function> funs = Layer.Function.getFunctions();		int [] extraBits = Layer.Function.getFunctionExtras();		String [] functionNames = new String[funs.size() + extraBits.length];		int j = 0;		for(Layer.Function fun : funs)		{			functionNames[j++] = fun.toString();		}		for(int i=0; i<extraBits.length; i++)			functionNames[j++] = Layer.Function.getExtraName(extraBits[i]);		// prompt for a new layer function		String choice = PromptAt.showPromptAt(wnd, ni, "Change Layer Function", "New function for this layer:", initialFuncName, functionNames);		if (choice == null) return;		// see if the choice is an extra		int thisExtraBit = -1;		for(int i=0; i<extraBits.length; i++)		{			if (choice.equals(Layer.Function.getExtraName(extraBits[i]))) { thisExtraBit = extraBits[i];   break; }		}		LayerInfo li = LayerInfo.parseCell(ni.getParent());		if (li == null) return;		if (thisExtraBit > 0)		{			// adding (or removing) an extra bit			if ((li.funExtra & thisExtraBit) != 0) li.funExtra &= ~thisExtraBit; else				li.funExtra |= thisExtraBit;		} else		{			li.funExtra = 0;			for(Layer.Function fun : funs)			{				if (fun.toString().equalsIgnoreCase(choice))				{					li.fun = fun;					break;				}			}		}		new SetTextJob(ni, "Function: " + LayerInfo.makeLayerFunctionName(li.fun, li.funExtra));	}	private static int [] copiedPattern = null;	private static void doPatternControl(EditWindow wnd, NodeInst ni, int forced)	{		if (forced == 0)		{			String [] operationNames = new String[4];			operationNames[0] = "Clear Pattern";			operationNames[1] = "Invert Pattern";			operationNames[2] = "Copy Pattern";			operationNames[3] = "Paste Pattern";			String choice = PromptAt.showPromptAt(wnd, ni, "Pattern Operations", null, "", operationNames);			if (choice == null) return;			if (choice.equals("Clear Pattern")) forced = 1; else			if (choice.equals("Invert Pattern")) forced = 2; else			if (choice.equals("Copy Pattern")) forced = 3; else			if (choice.equals("Paste Pattern")) forced = 4;		}		switch (forced)		{			case 1:		// clear pattern				for(Iterator<NodeInst> it = ni.getParent().getNodes(); it.hasNext(); )				{					NodeInst pni = it.next();					int opt = getOptionOnNode(pni);					if (opt != Info.LAYERPATTERN) continue;					int color = getLayerColor(pni);

⌨️ 快捷键说明

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