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

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

?? projectlibrary.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: ProjectLibrary.java * Project management tool: library information * 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.hierarchy.View;import com.sun.electric.database.text.TextUtils;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.FileType;import com.sun.electric.tool.user.dialogs.OpenFile;import java.io.File;import java.io.FileNotFoundException;import java.io.IOException;import java.io.RandomAccessFile;import java.io.Serializable;import java.net.URL;import java.nio.ByteBuffer;import java.nio.channels.FileChannel;import java.nio.channels.FileLock;import java.util.ArrayList;import java.util.Collections;import java.util.Comparator;import java.util.HashMap;import java.util.Iterator;import java.util.List;import java.util.Set;/** * Class to describe libraries checked into the Project Management system. */public class ProjectLibrary implements Serializable{	/** the project directory */				private String                     projDirectory;	/** Library associated with project file */	private Library                    lib;	/** all cell records in the project */		private List<ProjectCell>          allCells;	/** cell records by Cell in the project */	private HashMap<Cell,ProjectCell>  byCell;	/** I/O channel for project file */			private transient RandomAccessFile raf;	/** Lock on file when updating it */		private transient FileLock         lock;//	void validate()//	{//		for(ProjectCell pc : allCells)//		{//			Cell c = pc.getCell();//			if (c != null && !c.isLinked()) System.out.println("HEY! "+c+" IS NOT LINKED");//		}//		for(Cell c : byCell.keySet())//		{//			if (c != null && !c.isLinked()) System.out.println("HEY! "+c+" IS NOT LINKED IN BYCELLS");//		}//	}	private ProjectLibrary()	{		allCells = new ArrayList<ProjectCell>();		byCell = new HashMap<Cell,ProjectCell>();	}	static ProjectLibrary createProject(Library lib)	{		// create a new project database		ProjectLibrary pl = new ProjectLibrary();		pl.lib = lib;		// figure out the location of the project file		Variable var = lib.getVar(Project.PROJPATHKEY);		if (var == null) return pl;		URL url = TextUtils.makeURLToFile((String)var.getObject());		if (!TextUtils.URLExists(url))		{			url = null;			if (Project.getRepositoryLocation().length() > 0)			{				url = TextUtils.makeURLToFile(Project.getRepositoryLocation() + File.separator + lib.getName() + File.separator + Project.PROJECTFILE);				if (!TextUtils.URLExists(url)) url = null;			}			if (url == null)			{				String userFile = OpenFile.chooseInputFile(FileType.PROJECT, "Find Project File for " + lib);				if (userFile == null) return pl;				url = TextUtils.makeURLToFile(userFile);			}		}		// prepare to read the project file		String projectFile = url.getFile();		String projDir = "";		int sepPos = projectFile.lastIndexOf('/');		if (sepPos >= 0) projDir = projectFile.substring(0, sepPos);		try		{			pl.raf = new RandomAccessFile(projectFile, "r");		} catch (FileNotFoundException e)		{			System.out.println("Cannot read file: " + projectFile);			return pl;		}		// learn the repository location if this path is valid		if (Project.getRepositoryLocation().length() == 0)		{			String repositoryLocation = null;			if (sepPos > 1)			{				int nextSepPos = projectFile.lastIndexOf('/', sepPos-1);				if (nextSepPos >= 0) repositoryLocation = projectFile.substring(0, nextSepPos);			}			if (repositoryLocation == null)			{				Job.getUserInterface().showInformationMessage(					"You should setup Project Management by choosing a Repository location.  Use the 'Project Management' tab under General Preferences",					"Setup Project Management");			} else			{				Project.setRepositoryLocation(repositoryLocation);			}		}		pl.projDirectory = projDir;		pl.loadProjectFile();		try		{			pl.raf.close();		} catch (IOException e)		{			System.out.println("Error closing project file");		}		return pl;	}	/**	 * Method to add a ProjectCell to this ProjectLibrary.	 * Keeps the list sorted.	 * @param pc the ProjectCell to add.	 */	void addProjectCell(ProjectCell pc)	{		allCells.add(pc);		Collections.sort(allCells, new OrderedProjectCells());	}	/**	 * Method to remove a ProjectCell from this ProjectLibrary.	 * Keeps the list sorted.	 * @param pc the ProjectCell to remove.	 */	void removeProjectCell(ProjectCell pc)	{		for(ProjectCell c : allCells)		{			if (!c.getCellName().equals(pc.getCellName())) continue;			if (c.getVersion() != pc.getVersion()) continue;			if (c.getView() != pc.getView()) continue;			allCells.remove(c);			break;		}		if (pc.getCell() != null) byCell.remove(pc.getCell());		Collections.sort(allCells, new OrderedProjectCells());	}	void linkProjectCellToCell(ProjectCell pc, Cell cell)	{		if (cell == null)		{			pc.setLatestVersion(false);			byCell.remove(pc.getCell());		} else		{			byCell.put(cell, pc);		}		pc.setCell(cell);	}	void ignoreCell(Cell cell)	{		byCell.remove(cell);	}	boolean isEmpty() { return allCells.size() == 0; }	Library getLibrary() { return lib; }	Iterator<ProjectCell> getProjectCells() { return allCells.iterator(); }	String getProjectDirectory() { return projDirectory; }	void setProjectDirectory(String dir) { projDirectory = dir; }	/**	 * Class to sort project cells.	 */    private static class OrderedProjectCells implements Comparator<ProjectCell>    {        public int compare(ProjectCell pc1, ProjectCell pc2)        {        	int diff = pc1.getCellName().compareTo(pc2.getCellName());        	if (diff != 0) return diff;        	diff = pc1.getView().getFullName().compareTo(pc2.getView().getFullName());        	if (diff != 0) return diff;        	return pc1.getVersion() - pc2.getVersion();        }    }	ProjectCell findProjectCell(Cell cell)	{		ProjectCell pc = byCell.get(cell);		return pc;	}	ProjectCell findProjectCellByNameView(String name, View view)	{		for(ProjectCell pc : allCells)		{			if (pc.getCellName().equals(name) && pc.getView() == view) return pc;		}		return null;	}	ProjectCell findProjectCellByNameViewVersion(String name, View view, int version)	{		for(ProjectCell pc : allCells)		{			if (pc.getCellName().equals(name) && pc.getView() == view && pc.getVersion() == version) return pc;		}		return null;	}	/**	 * Method to lock this project file.	 * Throws JobException on error.	 */	void lockProjectFile()		throws JobException	{		String errMsg = tryLockProjectFile();		if (errMsg != null)		{			throw new JobException(				"Cannot lock the project file (" + errMsg + ").  It may be in use by another user, or it may be damaged.");		}	}	/**	 * Method to lock a set of project files.	 * @param projectFiles the set of project files.	 * Throws JobException on error.	 */	static void lockManyProjectFiles(Set<ProjectLibrary> projectFiles)		throws JobException	{		List<ProjectLibrary> didThem = new ArrayList<ProjectLibrary>();		for(ProjectLibrary pl : projectFiles)		{			String errMsg = pl.tryLockProjectFile();			if (errMsg != null)			{				// failed, unlock those already locked				for(ProjectLibrary uPl : didThem)					uPl.releaseProjectFileLock(false);				throw new JobException(					"Cannot lock the project file for library " + pl.lib.getName() +					"(" + errMsg + ").  It may be in use by another user, or it may be damaged.");			}			didThem.add(pl);		}	}	/**	 * Method to lock this project file.	 * @return error message on error, null on success.	 */	private String tryLockProjectFile()	{		// prepare to read the project file		String projectFile = projDirectory + File.separator + Project.PROJECTFILE;		try		{			raf = new RandomAccessFile(projectFile, "rw");		} catch (FileNotFoundException e)		{			return "Cannot read file " + projectFile;		}		FileChannel fc = raf.getChannel();		try		{			lock = fc.lock();		} catch (IOException e1)		{			String errMsg = "Unable to lock project file";			try			{				raf.close();			} catch (IOException e2)			{				errMsg = "Unable to close project file";			}			raf = null;			return errMsg;		}		String errMsg = loadProjectFile();		if (errMsg != null)		{			try			{				lock.release();				raf.close();			} catch (IOException e)			{				errMsg += "; Unable to release project file lock";			}			raf = null;		}		return errMsg;	}	/**	 * Method to release the lock on this project file.	 * @param save true to rewrite it first.	 */	void releaseProjectFileLock(boolean save)	{		if (save)		{			FileChannel fc = raf.getChannel();			try			{				fc.position(0);				fc.truncate(0);				for(ProjectCell pc : allCells)				{					String line = "::" + pc.getCellName() + ":" + pc.getVersion() + "-" +						pc.getView().getFullName() + "." + pc.getLibExtension() + ":" +						pc.getOwner() + ":" + pc.getLastOwner() + ":" + pc.getComment() + "\n";					ByteBuffer bb = ByteBuffer.wrap(line.getBytes());					fc.write(bb);				}			} catch (IOException e)			{				System.out.println("Error saving project file");			}		}		try		{			lock.release();			raf.close();		} catch (IOException e)		{			System.out.println("Unable to unlock and close project file");			lock = null;		}	}	/**	 * Method to unlock a set of project files.	 * @param projectFiles the set of project files.	 */	static void releaseManyProjectFiles(Set<ProjectLibrary> projectFiles)	{		for(ProjectLibrary pl : projectFiles)		{			pl.releaseProjectFileLock(true);		}	}	/**	 * Method to read the project file into memory.	 * @return an error message on error (null if OK).	 */	private String loadProjectFile()	{		allCells.clear();		byCell.clear();		// read the project file		int [] colonPos = new int[6];		for(;;)		{			String userLine = null;			try			{				userLine = raf.readLine();			} catch (IOException e)			{				userLine = null;			}			if (userLine == null) break;			ProjectCell pc = new ProjectCell(null, this);			int prevPos = 0;			for(int i=0; i<6; i++)			{				colonPos[i] = userLine.indexOf(':', prevPos);				prevPos = colonPos[i] + 1;				if (prevPos <= 0)				{					return "Too few keywords in project file: " + userLine;				}			}			if (colonPos[0] != 0)			{				return "Missing initial ':' in project file: " + userLine;			}			// get cell name			pc.setCellName(userLine.substring(colonPos[1]+1, colonPos[2]));			// get version			String section = userLine.substring(colonPos[2]+1, colonPos[3]);			int dashPos = section.indexOf('-');			if (dashPos < 0)			{				return "Missing '-' after version number in project file: " + userLine;			}			int dotPos = section.indexOf('.');			if (dotPos < 0)			{				return "Missing '.' after view type in project file: " + userLine;			}			pc.setVersion(TextUtils.atoi(section.substring(0, dashPos)));			// get view			String viewPart = section.substring(dashPos+1, dotPos);			pc.setView(View.findView(viewPart));			// get file type			String fileType = section.substring(dotPos+1);			if (fileType.equals("elib")) pc.setLibType(FileType.ELIB); else				if (fileType.equals("jelib")) pc.setLibType(FileType.JELIB); else					if (fileType.equals("txt")) pc.setLibType(FileType.READABLEDUMP); else			{				return "Unknown library type in project file: " + userLine;			}			// get owner			pc.setOwner(userLine.substring(colonPos[3]+1, colonPos[4]));			// get last owner			pc.setLastOwner(userLine.substring(colonPos[4]+1, colonPos[5]));			// get comments			pc.setComment(userLine.substring(colonPos[5]+1));			// check for duplication			for(ProjectCell opc : allCells)			{				if (opc == pc) continue;				if (!opc.getCellName().equalsIgnoreCase(pc.getCellName())) continue;				if (opc.getView() != pc.getView()) continue;				if (opc.getVersion() != pc.getVersion()) continue;				System.out.println("Error in project file: version " + pc.getVersion() + ", view '" +					pc.getView().getFullName() + "' of cell '" + pc.getCellName() + "' exists twice");			}			// find the cell associated with this entry			pc.setLatestVersion(false);			String cellName = pc.describeWithVersion();			Cell cell = lib.findNodeProto(cellName);			pc.setCell(cell);			if (cell != null)			{				if (cell.getVersion() > pc.getVersion())				{					if (!pc.getOwner().equals(Project.getCurrentUserName()))					{						if (pc.getOwner().length() == 0)						{							System.out.println("WARNING: " + cell + " is being edited, but it is not checked-out");						} else						{							System.out.println("WARNING: " + cell + " is being edited, but it is checked-out to " + pc.getOwner());						}					}				}				byCell.put(cell, pc);			}			// link it in//			allCells.add(pc);		}		// determine the most recent views		HashMap<String,ProjectCell> mostRecent = new HashMap<String,ProjectCell>();		for(ProjectCell pc : allCells)		{			String cellEntry = pc.describe();			ProjectCell recent = mostRecent.get(cellEntry);			if (recent != null && recent.getVersion() > pc.getVersion()) continue;			mostRecent.put(cellEntry, pc);		}		for(ProjectCell pc : allCells)		{			String cellEntry = pc.describe();			ProjectCell recent = mostRecent.get(cellEntry);			pc.setLatestVersion(recent == pc);		}		return null;	}}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丝袜美腿亚洲综合| 蜜臀国产一区二区三区在线播放| 欧洲中文字幕精品| 国精产品一区一区三区mba桃花| 国产精品久久久久久久久免费桃花| 欧美日韩一本到| 福利91精品一区二区三区| 天堂久久一区二区三区| 中文字幕在线一区免费| 精品国产精品网麻豆系列| 在线视频国内自拍亚洲视频| 狠狠色综合播放一区二区| 亚洲国产精品久久一线不卡| 欧美国产日本视频| 欧美xxxxx裸体时装秀| 欧美少妇xxx| 成人avav在线| 国产成人日日夜夜| 国产美女娇喘av呻吟久久| 日韩综合一区二区| 亚洲国产色一区| 亚洲欧美日韩在线| **网站欧美大片在线观看| 久久久91精品国产一区二区三区| 日韩限制级电影在线观看| 欧美三级电影在线观看| 91丨九色丨国产丨porny| 国产高清亚洲一区| 国产一区二区视频在线| 久久精品国产澳门| 青青青伊人色综合久久| 亚洲1区2区3区4区| 亚洲国产精品久久人人爱蜜臀| 最新热久久免费视频| 国产精品无码永久免费888| 2023国产精品| 久久久久国色av免费看影院| 精品av久久707| 久久色.com| 国产三级精品在线| 国产精品女主播av| 亚洲欧洲99久久| 亚洲色图视频网| 亚洲综合一区在线| 日韩黄色一级片| 免费在线观看精品| 国产一区二区三区精品欧美日韩一区二区三区 | 国产精品一区二区视频| 久久福利视频一区二区| 另类的小说在线视频另类成人小视频在线| 婷婷综合五月天| 秋霞午夜av一区二区三区| 久久精品二区亚洲w码| 国产一区二区免费在线| 国产成人午夜99999| av在线不卡观看免费观看| 欧美中文字幕一区二区三区亚洲| 欧美午夜精品免费| 欧美一区二区久久久| 欧美一级日韩免费不卡| 久久久.com| 亚洲精选一二三| 日韩中文字幕91| 精品亚洲欧美一区| 成人精品一区二区三区四区| 99re6这里只有精品视频在线观看| 欧美系列在线观看| 日韩美女主播在线视频一区二区三区| 精品伦理精品一区| 亚洲欧美偷拍三级| 奇米精品一区二区三区四区| 国产成都精品91一区二区三 | 欧美一级生活片| 日本一区二区三级电影在线观看| 国产精品欧美久久久久无广告| 亚洲最色的网站| 久久91精品国产91久久小草| 成人av影院在线| 67194成人在线观看| 久久精品人人爽人人爽| 亚洲一区二区黄色| 国产麻豆欧美日韩一区| av在线不卡观看免费观看| 91精品欧美一区二区三区综合在| 久久免费精品国产久精品久久久久 | 白白色亚洲国产精品| 欧美日韩综合在线| 国产欧美一二三区| 日韩精品一二区| 成人精品国产免费网站| 欧美久久久久久蜜桃| 国产日韩欧美一区二区三区乱码 | 国产精品国产三级国产| 亚洲h动漫在线| 波多野结衣精品在线| 日韩三级av在线播放| 亚洲欧美在线高清| 国产真实乱子伦精品视频| 色吧成人激情小说| 国产丝袜美腿一区二区三区| 亚洲6080在线| 一本一道综合狠狠老| 久久亚洲精品小早川怜子| 亚洲一区二区在线免费看| 国产99久久久国产精品免费看| 欧美日韩色一区| 综合久久久久久| 国产成人在线色| 日韩欧美综合一区| 天天影视网天天综合色在线播放 | 成人动漫一区二区在线| 精品国产一区二区三区久久久蜜月| 亚洲狼人国产精品| 成人天堂资源www在线| 日韩免费在线观看| 日本午夜精品一区二区三区电影 | 欧美成人精品1314www| 午夜在线电影亚洲一区| 一本久道中文字幕精品亚洲嫩| 日本一区二区视频在线观看| 国产美女av一区二区三区| 日韩精品在线看片z| 免费在线看成人av| 欧美裸体一区二区三区| 一区二区三区四区五区视频在线观看| 成人激情图片网| 国产精品动漫网站| 成人午夜精品在线| 国产婷婷色一区二区三区四区 | 婷婷夜色潮精品综合在线| 色偷偷一区二区三区| 中文字幕一区二区不卡| 国产91精品一区二区麻豆网站| 久久久精品黄色| 久久99久久99精品免视看婷婷 | 国产成人在线观看免费网站| 精品成人一区二区| 经典一区二区三区| 久久久综合网站| 国产精品69久久久久水密桃| 久久久亚洲精品一区二区三区| 加勒比av一区二区| 久久久国产精品麻豆| 国产成人h网站| 中文成人av在线| 色屁屁一区二区| 亚洲第一久久影院| 日韩三级中文字幕| 国产精品一级片在线观看| 中文字幕免费观看一区| 99久久99精品久久久久久| 亚洲另类在线视频| 欧美日韩成人在线一区| 久久精品国产精品亚洲红杏| 久久久久9999亚洲精品| eeuss鲁一区二区三区| 亚洲另类春色校园小说| 9191成人精品久久| 国产乱子轮精品视频| 久久久精品国产99久久精品芒果| 成a人片亚洲日本久久| 一区二区三区在线免费观看| 欧美精品在线观看播放| 精品一区二区三区的国产在线播放| 久久久不卡影院| 91美女在线观看| 午夜精品福利一区二区三区av| 精品久久久久久无| 99久久精品免费| 调教+趴+乳夹+国产+精品| 久久久久久电影| 欧美亚洲禁片免费| 国产一本一道久久香蕉| 一区二区三区四区乱视频| 精品欧美一区二区三区精品久久| 成人永久aaa| 日韩av在线免费观看不卡| 中文字幕欧美激情| 欧美一区午夜视频在线观看 | 欧美色综合网站| 国产精品自在在线| 亚洲va欧美va人人爽午夜| 久久久久久久网| 欧美区在线观看| av激情亚洲男人天堂| 欧美a级理论片| 亚洲猫色日本管| 久久精品免视看| 欧美日韩高清一区二区| 成人午夜碰碰视频| 麻豆精品国产91久久久久久| 综合久久给合久久狠狠狠97色| 欧美va在线播放| 欧美性猛片xxxx免费看久爱| 国产精品一区二区三区四区| 午夜影视日本亚洲欧洲精品| 中文字幕在线观看不卡视频| 精品久久久久久久久久久久久久久久久| 一本到一区二区三区| 高清在线不卡av|