亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? updatejob.java

?? The ElectricTM VLSI Design System is an open-source Electronic Design Automation (EDA) system that c
?? JAVA
字號:
/* -*- tab-width: 4 -*- * * Electric(tm) VLSI Design System * * File: UpdateJob.java * Project management tool: update libraries from the repository * Written by: Steven M. Rubin * * Copyright (c) 2006 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.project;import com.sun.electric.database.hierarchy.Cell;import com.sun.electric.database.hierarchy.Library;import com.sun.electric.database.network.NetworkTool;import com.sun.electric.database.prototype.NodeProto;import com.sun.electric.database.text.TextUtils;import com.sun.electric.database.topology.NodeInst;import com.sun.electric.database.variable.Variable;import com.sun.electric.tool.Job;import com.sun.electric.tool.JobException;import com.sun.electric.tool.io.input.LibraryFiles;import com.sun.electric.tool.user.ui.WindowFrame;import java.io.File;import java.util.ArrayList;import java.util.HashMap;import java.util.HashSet;import java.util.Iterator;import java.util.List;import java.util.Set;/** * This class updates cells from the Project Management repository. */public class UpdateJob extends Job{	private ProjectDB pdb;	private DisplayedCells displayedCells;	/**	 * Method to update the project libraries from the repository.	 */	public static void updateProject()	{		// make sure there is a valid user name and repository		if (Users.needUserName()) return;		if (Project.ensureRepository()) return;		new UpdateJob();	}	private UpdateJob()	{		super("Update all Cells from Repository", Project.getProjectTool(), Job.Type.CHANGE, null, null, Job.Priority.USER);		this.pdb = Project.projectDB;		// save the current window configuration		displayedCells = new DisplayedCells();		startJob();	}	public boolean doIt() throws JobException	{		Set<ProjectLibrary> projectLibs = new HashSet<ProjectLibrary>();		for(Iterator<Library> lIt = Library.getLibraries(); lIt.hasNext(); )		{			Library lib = lIt.next();			if (lib.isHidden()) continue;			ProjectLibrary pl = pdb.findProjectLibrary(lib);			if (pl.getProjectDirectory() == null) continue;			projectLibs.add(pl);		}		// lock access to the project files (throws JobException on error)		ProjectLibrary.lockManyProjectFiles(projectLibs);		// make a list of all cells that need to be updated		List<ProjectCell> updatedProjectCells = new ArrayList<ProjectCell>();		for(ProjectLibrary pl : projectLibs)		{			// add ProjectCells that need to be updated to the list			addNewProjectCells(pl, updatedProjectCells);		// CHANGES DATABASE		}		// lock library projects		boolean allLocked = true;		for(ProjectCell pc : updatedProjectCells)		{			ProjectLibrary pl = pc.getProjectLibrary();			if (projectLibs.contains(pl)) continue;			try			{				pl.lockProjectFile();			} catch (JobException e)			{				allLocked = false;				break;			}			projectLibs.add(pl);		}		int total = 0;		if (allLocked)		{			// prevent tools (including this one) from seeing the change			Project.setChangeStatus(true);			for(;;)			{				Iterator<ProjectCell> it = updatedProjectCells.iterator();				if (!it.hasNext()) break;				ProjectCell pc = it.next();				total += updateCellFromRepository(pdb, pc, updatedProjectCells);		// CHANGES DATABASE			}			// restore change broadcast			Project.setChangeStatus(false);		}		// relase project file locks and validate all cell locks		for(ProjectLibrary pl : projectLibs)		{			pl.releaseProjectFileLock(false);			validateLocks(pdb, pl.getLibrary());		// CHANGES DATABASE		}		// summarize		if (total == 0) System.out.println("Project is up-to-date"); else			System.out.println("Updated " + total + " cells");		fieldVariableChanged("pdb");		fieldVariableChanged("displayedCells");		return true;	}    public void terminateOK()    {    	// take the new version of the project database from the server    	Project.projectDB = pdb;    	// redisplay windows to show current versions    	displayedCells.updateWindows();		// update explorer tree		WindowFrame.wantToRedoLibraryTree();    }	private void validateLocks(ProjectDB pdb, Library lib)	{		for(Iterator<Cell> it = lib.getCells(); it.hasNext(); )		{			Cell cell = it.next();			ProjectCell pc = pdb.findProjectCell(cell);			if (pc == null)			{				// cell not in the project: writable				Project.markLocked(cell, false);		// CHANGES DATABASE			} else			{				if (cell.getVersion() < pc.getVersion())				{					// cell is an old version: writable					Project.markLocked(cell, false);		// CHANGES DATABASE				} else				{					if (pc.getOwner().equals(Project.getCurrentUserName()))					{						// cell checked out to current user: writable						Project.markLocked(cell, false);		// CHANGES DATABASE					} else					{						// cell checked out to someone else: not writable						Project.markLocked(cell, true);		// CHANGES DATABASE					}				}			}		}	}	/**	 * Method to recursively update the project.	 * @param pc the ProjectCell to update.	 * If subcells need to be updated first, that will happen.	 * @return the number of cells that were updated.	 */	private int updateCellFromRepository(ProjectDB pdb, ProjectCell pc, List<ProjectCell> updatedProjectCells)	{		ProjectLibrary pl = pc.getProjectLibrary();		Library lib = pl.getLibrary();		Cell oldCell = lib.findNodeProto(pc.describe());		Cell newCell = null;		// read the library with the new cell		int total = 0;		String libName = pl.getProjectDirectory() + File.separator + pc.getCellName() + File.separator + pc.getVersion() + "-" +			pc.getView().getFullName() + "." + pc.getLibExtension();		String tempLibName = Project.getTempLibraryName();		NetworkTool.setInformationOutput(false);		Library fLib = LibraryFiles.readLibrary(TextUtils.makeURLToFile(libName), tempLibName, pc.getLibType(), true);		NetworkTool.setInformationOutput(true);		if (fLib == null) System.out.println("Cannot read library " + libName); else		{			String cellNameInRepository = pc.describe();			Cell cur = fLib.findNodeProto(cellNameInRepository);			if (cur == null) System.out.println("Cannot find cell " + cellNameInRepository + " in library " + libName); else			{				// build node map and see if others should be copied first				HashMap<NodeInst,NodeProto> nodePrototypes = new HashMap<NodeInst,NodeProto>();				for(Iterator<NodeInst> it = cur.getNodes(); it.hasNext(); )				{					NodeInst ni = it.next();					NodeProto np = ni.getProto();					nodePrototypes.put(ni, np);					if (!ni.isCellInstance()) continue;					Cell subCell = (Cell)np;					if (subCell.getView().isTextView()) continue;					Library subLib = lib;					String subCellName = Project.describeFullCellName(subCell);					Variable var = subCell.getVar(Project.PROJLIBRARYKEY);					if (var != null)					{						String subLibName = (String)var.getObject();						subLib = Library.findLibrary(subLibName);						if (subCellName.startsWith(subLibName+"__"))							subCellName = subCellName.substring(subLibName.length()+2);						if (subLib == null)						{							// find a new library in the repository							subLib = Library.newInstance(subLibName, null);							String projFile = Project.getRepositoryLocation() + File.separator + subLibName + File.separator + Project.PROJECTFILE;							File pf = new File(projFile);							if (!pf.exists())							{								System.out.println("Cannot find project file '" + projFile + "'...retrieve aborted.");							} else							{								subLib.newVar(Project.PROJPATHKEY, projFile);								ProjectLibrary subPL = pdb.findProjectLibrary(subLib);								// get all recent cells								addNewProjectCells(subPL, updatedProjectCells);							}						}					}					Cell foundSubCell = subLib.findNodeProto(subCellName);					if (foundSubCell == null)					{						ProjectLibrary subPL = pdb.findProjectLibrary(subLib);						ProjectCell subCellPC = subPL.findProjectCellByNameViewVersion(subCell.getName(), subCell.getView(), subCell.getVersion());						if (subCellPC != null)						{							if (subCellPC.getCell() != null)							{								System.out.println("ERROR: cell " + subCellName + " does not exist, but it appears as " +									subCellPC.getCell());							}							if (!updatedProjectCells.contains(subCellPC))							{								System.out.println("ERROR: cell " + subCellName + " needs to be updated but isn't in the list");							}							total += updateCellFromRepository(pdb, subCellPC, updatedProjectCells);							foundSubCell = subCellPC.getCell();						}					}					nodePrototypes.put(ni, foundSubCell);				}				String cellName = Project.describeFullCellName(cur);				newCell = Cell.copyNodeProtoUsingMapping(cur, lib, cellName, nodePrototypes);				if (newCell == null) System.out.println("Cannot copy " + cur + " from new library");			}			// kill the library			fLib.kill("delete");		}		// return the new cell		if (newCell != null)		{			pl.linkProjectCellToCell(pc, newCell);			if (oldCell != null)			{				if (Project.useNewestVersion(oldCell, newCell))		// CHANGES DATABASE				{					System.out.println("Error replacing instances of new " + oldCell);				} else				{					ProjectCell oldPC = pl.findProjectCell(oldCell);					pl.linkProjectCellToCell(oldPC, null);					// record that cells changed so that displays get updated		        	displayedCells.swap(oldCell, newCell);					System.out.println("Updated " + newCell);				}			} else			{				System.out.println("Added new " + newCell);			}			total++;		}		updatedProjectCells.remove(pc);		return total;	}	private void addNewProjectCells(ProjectLibrary pl, List<ProjectCell> updatedProjectCells)	{		HashMap<String,ProjectCell> versionToGet = new HashMap<String,ProjectCell>();		for(Iterator<ProjectCell> it = pl.getProjectCells(); it.hasNext(); )		{			ProjectCell pc = it.next();			String cellName = pc.getCellName() + pc.getView().getAbbreviationExtension();			ProjectCell pcToGet = versionToGet.get(cellName);			if (pcToGet != null)			{				if (pc.getVersion() <= pcToGet.getVersion()) continue;				if (pc.getOwner().length() > 0)				{					// this version is checked-out					Cell oldCell = pl.getLibrary().findNodeProto(pc.describeWithVersion());					if (oldCell != null)					{						// found the cell in the library						if (pc.getOwner().equals(Project.getCurrentUserName()))						{							versionToGet.remove(cellName);						} else						{							System.out.println("WARNING: " + oldCell + " is checked-out to " + pc.getOwner());						}						continue;					}					// the cell is not in the library					if (!pc.getOwner().equals(Project.getCurrentUserName())) continue;					System.out.println("WARNING: Cell " + pl.getLibrary().getName() + ":" + pc.describe() +						" is checked-out to you but is missing from this library.  Re-building it.");					// prevent tools (including this one) from seeing the changes					Project.setChangeStatus(true);					oldCell = pl.getLibrary().findNodeProto(pc.describe());					Library lib = oldCell.getLibrary();					String newName = oldCell.getName() + ";" + pc.getVersion() + pc.getView().getAbbreviationExtension();					if (oldCell != null)					{						Cell newVers = Cell.copyNodeProto(oldCell, lib, newName, true);						if (newVers == null)						{							System.out.println("Error making new version of cell " + oldCell.describe(false));							Project.setChangeStatus(false);							continue;						}						// replace former usage with new version						if (Project.useNewestVersion(oldCell, newVers))		// CHANGES DATABASE						{							System.out.println("Error replacing instances of cell " + oldCell.describe(false));							Project.setChangeStatus(false);							continue;						}						pl.ignoreCell(oldCell);						pl.linkProjectCellToCell(pc, newVers);						Project.markLocked(newVers, false);		// CHANGES DATABASE					} else					{						// the cell never existed before: create it						Cell newVers = Cell.makeInstance(lib, newName);						pl.linkProjectCellToCell(pc, newVers);					}					Project.setChangeStatus(false);				}			}			versionToGet.put(cellName, pc);		}		for(String cellName : versionToGet.keySet())		{			ProjectCell pc = versionToGet.get(cellName);			Cell oldCellAny = pl.getLibrary().findNodeProto(pc.describe());			Cell oldCell = pl.getLibrary().findNodeProto(pc.describeWithVersion());			if (oldCellAny != null && oldCellAny.getVersion() > pc.getVersion())				System.out.println("WARNING: " + oldCellAny + " is newer than what is in the repository.  Updating it from the repository version");			if (oldCell == null) updatedProjectCells.add(pc);		}	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品福利一区二区三区| 日韩美一区二区三区| 亚洲精品在线免费播放| 韩国三级在线一区| 精品一区二区国语对白| 亚洲人成网站精品片在线观看| 麻豆精品国产91久久久久久| 91国产免费看| 中文字幕成人网| 久久99精品久久久久久动态图 | 国产综合色视频| 欧美日韩亚洲综合| 国产精品国产自产拍高清av王其| 蜜桃视频在线一区| 欧美色视频在线观看| 国产精品欧美久久久久无广告 | 亚洲色图在线视频| 国产美女精品人人做人人爽 | 成人夜色视频网站在线观看| 欧美一区二区网站| 亚洲地区一二三色| 一本色道**综合亚洲精品蜜桃冫| 久久精品视频一区| 久久99国内精品| 在线不卡的av| 亚洲国产精品视频| 日本黄色一区二区| 亚洲欧美日韩综合aⅴ视频| 国内精品写真在线观看| 欧美一卡二卡在线| 丝袜亚洲另类欧美| 欧美三区在线观看| 亚洲国产va精品久久久不卡综合| 在线观看日韩国产| 亚洲一二三四久久| 色噜噜狠狠成人网p站| 亚洲日本在线观看| 91免费观看国产| 自拍av一区二区三区| 久久亚洲精华国产精华液| 日本视频在线一区| 日韩视频免费直播| 日本视频在线一区| 欧美v亚洲v综合ⅴ国产v| 久久精品国产99国产| 欧美tickle裸体挠脚心vk| 国内精品久久久久影院色| 久久午夜色播影院免费高清| 国产美女精品在线| 国产精品天干天干在线综合| 成人开心网精品视频| 亚洲欧洲在线观看av| 91免费在线播放| 亚洲综合免费观看高清在线观看| 在线视频国内一区二区| 天天爽夜夜爽夜夜爽精品视频| 欧美巨大另类极品videosbest | 国产精品色哟哟| eeuss鲁片一区二区三区在线看| 一区二区中文字幕在线| 日本高清免费不卡视频| 午夜欧美2019年伦理| 日韩欧美一区电影| 国产精品一卡二卡在线观看| 中文字幕制服丝袜成人av| 91在线一区二区三区| 亚洲电影在线免费观看| 欧美tickling挠脚心丨vk| 成人中文字幕合集| 一区二区三区精品在线| 欧美伦理影视网| 国内偷窥港台综合视频在线播放| 中文字幕va一区二区三区| 一本久久精品一区二区| 天堂成人免费av电影一区| 精品入口麻豆88视频| 粉嫩aⅴ一区二区三区四区五区| 国产精品电影院| 欧美视频中文字幕| 狠狠色综合播放一区二区| 国产精品美女久久久久久久| 在线观看网站黄不卡| 久久国产精品色婷婷| 欧美国产禁国产网站cc| 欧美日韩一区在线| 国内精品久久久久影院一蜜桃| 成人欧美一区二区三区白人| 一区二区三区精品在线观看| 欧美一区二区精品在线| 国产经典欧美精品| 亚洲精选视频免费看| 日韩免费高清电影| 91色综合久久久久婷婷| 爽好多水快深点欧美视频| 国产婷婷一区二区| 欧美色综合网站| 国产精品影视在线| 性久久久久久久| 欧美激情综合五月色丁香小说| 在线观看日韩一区| 高清不卡在线观看| 婷婷激情综合网| 中文字幕一区二区三区色视频| 91精品久久久久久久久99蜜臂| 成人午夜av在线| 蜜臀久久99精品久久久久宅男 | 日韩一级在线观看| 91在线你懂得| 久草这里只有精品视频| 亚洲三级电影全部在线观看高清| 日韩欧美精品三级| 欧美亚洲综合网| 国产91丝袜在线观看| 免费人成在线不卡| 一区二区三区免费| 国产精品热久久久久夜色精品三区 | 午夜视频在线观看一区二区| 国产精品美女久久久久高潮| 91精品黄色片免费大全| 色八戒一区二区三区| 国产精品一二三四五| 日韩精品91亚洲二区在线观看| 一区免费观看视频| 久久久99精品免费观看不卡| 91精品国产免费久久综合| 91福利国产精品| 成人app软件下载大全免费| 久久成人精品无人区| 一区二区日韩av| 中文字幕一区二区5566日韩| 久久青草国产手机看片福利盒子| 制服.丝袜.亚洲.中文.综合| 欧洲人成人精品| 91视频免费播放| 成人精品国产一区二区4080| 国产在线精品一区二区| 免费看黄色91| 日韩不卡一区二区| 日韩和欧美一区二区三区| 亚洲午夜日本在线观看| 一区二区三区鲁丝不卡| 亚洲精品一二三区| 亚洲精品美国一| 亚洲欧洲韩国日本视频| 国产精品美女久久久久av爽李琼| 国产欧美日韩精品一区| 久久美女高清视频| 久久综合国产精品| 日韩精品最新网址| 精品理论电影在线观看| 精品伦理精品一区| 精品国产一区二区三区四区四| 91精品国产综合久久蜜臀| 欧美中文字幕一二三区视频| 色婷婷久久久综合中文字幕 | 国产精品一区在线观看乱码| 久久精品72免费观看| 麻豆91在线看| 麻豆精品新av中文字幕| 麻豆成人91精品二区三区| 麻豆91在线播放免费| 欧美人xxxx| 欧美电影影音先锋| 91精品国产欧美一区二区| 欧美不卡一二三| 久久九九久久九九| 日本一区二区久久| 中文字幕一区在线观看视频| 中文字幕中文字幕在线一区 | 中文av一区特黄| 久久久国产午夜精品| 国产欧美日韩视频在线观看| 国产精品久久久久久久岛一牛影视| 中文字幕欧美日韩一区| 亚洲视频一区在线观看| 亚洲精品写真福利| 亚洲第一成年网| 久久国产剧场电影| 国产91丝袜在线观看| 97se狠狠狠综合亚洲狠狠| 欧美色综合久久| 日韩欧美电影一区| 久久久精品综合| 亚洲天堂精品在线观看| 洋洋av久久久久久久一区| 日韩中文字幕一区二区三区| 久久不见久久见中文字幕免费| 国产美女精品人人做人人爽| av一区二区三区四区| 欧美午夜在线观看| 欧美不卡激情三级在线观看| 日本一区二区免费在线观看视频| 亚洲视频图片小说| 亚洲成人免费影院| 久久成人18免费观看| 成人av午夜影院| 欧美日韩不卡一区二区| 精品成人免费观看| 亚洲人123区| 美女视频一区二区三区|