當前位置: 首頁>>代碼示例>>Java>>正文


Java Loader類代碼示例

本文整理匯總了Java中com.cburch.logisim.file.Loader的典型用法代碼示例。如果您正苦於以下問題:Java Loader類的具體用法?Java Loader怎麽用?Java Loader使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


Loader類屬於com.cburch.logisim.file包,在下文中一共展示了Loader類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createEmptyFile

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
private static LogisimFile createEmptyFile(Loader loader) {
	InputStream templReader = AppPreferences.getEmptyTemplate().createStream();
	LogisimFile file;
	try {
		file = loader.openLogisimFile(templReader);
	} catch (Throwable t) {
		file = LogisimFile.createNew(loader);
		file.addCircuit(new Circuit("main"));
	} finally {
		try {
			templReader.close();
		} catch (IOException e) {
		}
	}
	return file;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:17,代碼來源:ProjectActions.java

示例2: doOpen

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static void doOpen(Component parent, Project baseProject) {
	JFileChooser chooser;
	if (baseProject != null) {
		Loader oldLoader = baseProject.getLogisimFile().getLoader();
		chooser = oldLoader.createChooser();
		if (oldLoader.getMainFile() != null) {
			chooser.setSelectedFile(oldLoader.getMainFile());
		}
	} else {
		chooser = JFileChoosers.create();
	}
	chooser.setFileFilter(Loader.LOGISIM_FILTER);

	int returnVal = chooser.showOpenDialog(parent);
	if (returnVal != JFileChooser.APPROVE_OPTION)
		return;
	File selected = chooser.getSelectedFile();
	if (selected != null) {
		doOpen(parent, baseProject, selected);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:22,代碼來源:ProjectActions.java

示例3: createEmptyFile

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
private static LogisimFile createEmptyFile(Loader loader,Project proj) {
	InputStream templReader = AppPreferences.getEmptyTemplate()
			.createStream();
	LogisimFile file;
	try {
		file = loader.openLogisimFile(templReader);
	} catch (Exception t) {
		file = LogisimFile.createNew(loader,proj);
		file.addCircuit(new Circuit("main", file,proj));
	} finally {
		try {
			templReader.close();
		} catch (IOException e) {
		}
	}
	return file;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:18,代碼來源:ProjectActions.java

示例4: doOpen

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static boolean doOpen(Component parent, Project baseProject) {
	JFileChooser chooser;
	if (baseProject != null) {
		Loader oldLoader = baseProject.getLogisimFile().getLoader();
		chooser = oldLoader.createChooser();
		if (oldLoader.getMainFile() != null) {
			chooser.setSelectedFile(oldLoader.getMainFile());
		}
	} else {
		chooser = JFileChoosers.create();
	}
	chooser.setFileFilter(Loader.LOGISIM_FILTER);
	chooser.setDialogTitle(Strings.get("FileOpenItem"));

	int returnVal = chooser.showOpenDialog(parent);
	if (returnVal != JFileChooser.APPROVE_OPTION)
		return false;
	File selected = chooser.getSelectedFile();
	if (selected != null) {
		doOpen(parent, baseProject, selected);
	}
	return true;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:24,代碼來源:ProjectActions.java

示例5: doOpen

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static void doOpen(Component parent, Project baseProject) {
	JFileChooser chooser;
	if (baseProject != null) {
		Loader oldLoader = baseProject.getLogisimFile().getLoader();
		chooser = oldLoader.createChooser();
		if (oldLoader.getMainFile() != null) {
			chooser.setSelectedFile(oldLoader.getMainFile());
		}
	} else {
		chooser = JFileChoosers.create();
	}
	chooser.setFileFilter(Loader.LOGISIM_FILTER);
				
	int returnVal = chooser.showOpenDialog(parent);
	if (returnVal != JFileChooser.APPROVE_OPTION) return;
	File selected = chooser.getSelectedFile();
	if (selected != null) {
		doOpen(parent, baseProject, selected);
	}
}
 
開發者ID:franciscaconcha,項目名稱:ProyectoLogisim,代碼行數:21,代碼來源:ProjectActions.java

示例6: completeProject

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
private static Project completeProject(SplashScreen monitor, Loader loader, LogisimFile file, boolean isStartup) {
	if (monitor != null)
		monitor.setProgress(SplashScreen.PROJECT_CREATE);
	Project ret = new Project(file);

	if (monitor != null)
		monitor.setProgress(SplashScreen.FRAME_CREATE);
	SwingUtilities.invokeLater(new CreateFrame(loader, ret, isStartup));
	return ret;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:11,代碼來源:ProjectActions.java

示例7: doSave

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static boolean doSave(Project proj) {
	Loader loader = proj.getLogisimFile().getLoader();
	File f = loader.getMainFile();
	if (f == null)
		return doSaveAs(proj, true);
	else
		return doSave(proj, f);
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:9,代碼來源:ProjectActions.java

示例8: findProjectFor

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static Project findProjectFor(File query) {
	for (Project proj : openProjects) {
		Loader loader = proj.getLogisimFile().getLoader();
		if (loader == null)
			continue;
		File f = loader.getMainFile();
		if (query.equals(f))
			return proj;
	}
	return null;
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:12,代碼來源:Projects.java

示例9: loadTemplate

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
private void loadTemplate(Loader loader, File templFile, boolean templEmpty) {
	if (showSplash)
		monitor.setProgress(SplashScreen.TEMPLATE_OPEN);
	if (templFile != null) {
		AppPreferences.setTemplateFile(templFile);
		AppPreferences.setTemplateType(AppPreferences.TEMPLATE_CUSTOM);
	} else if (templEmpty) {
		AppPreferences.setTemplateType(AppPreferences.TEMPLATE_EMPTY);
	} else if (templPlain) {
		AppPreferences.setTemplateType(AppPreferences.TEMPLATE_PLAIN);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:13,代碼來源:Startup.java

示例10: doLoadLogisimLibrary

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static void doLoadLogisimLibrary(Project proj) {
	Loader loader = proj.getLogisimFile().getLoader();
	JFileChooser chooser = loader.createChooser();
	chooser.setDialogTitle(Strings.get("loadLogisimDialogTitle"));
	chooser.setFileFilter(Loader.LOGISIM_FILTER);
	int check = chooser.showOpenDialog(proj.getFrame());
	if (check == JFileChooser.APPROVE_OPTION) {
		File f = chooser.getSelectedFile();
		Library lib = loader.loadLogisimLibrary(f);
		if (lib != null) {
			proj.doAction(LogisimFileActions.loadLibrary(lib));
		}
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:15,代碼來源:ProjectLibraryActions.java

示例11: actionPerformed

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
@Override
public void actionPerformed(ActionEvent e) {
	Object src = e.getSource();
	if (src == unload) {
		ProjectLibraryActions.doUnloadLibrary(proj, lib);
	} else if (src == reload) {
		Loader loader = proj.getLogisimFile().getLoader();
		loader.reload((LoadedLibrary) lib);
	}
}
 
開發者ID:LogisimIt,項目名稱:Logisim,代碼行數:11,代碼來源:Popups.java

示例12: completeProject

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
private static Project completeProject(SplashScreen monitor, Loader loader,
		LogisimFile file, boolean isStartup) {
	if (monitor != null)
		monitor.setProgress(SplashScreen.PROJECT_CREATE);
	Project ret = new Project(file);
	if (monitor != null)
		monitor.setProgress(SplashScreen.FRAME_CREATE);
	SwingUtilities.invokeLater(new CreateFrame(loader, ret, isStartup));
	updatecircs(file,ret);
	return ret;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:12,代碼來源:ProjectActions.java

示例13: doOpenNoWindow

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static Project doOpenNoWindow(SplashScreen monitor, File source)
		throws LoadFailedException {
	Loader loader = new Loader(monitor);
	LogisimFile file = loader.openLogisimFile(source);
	Project ret = new Project(file);
	updatecircs(file,ret);
	return ret;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:9,代碼來源:ProjectActions.java

示例14: doSave

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static boolean doSave(Project proj) {
	Loader loader = proj.getLogisimFile().getLoader();
	File f = loader.getMainFile();
	if (f == null)
		return doSaveAs(proj);
	else
		return doSave(proj, f);
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:9,代碼來源:ProjectActions.java

示例15: findProjectFor

import com.cburch.logisim.file.Loader; //導入依賴的package包/類
public static Project findProjectFor(File query) {
	for (Project proj : openProjects) {
		Loader loader = proj.getLogisimFile().getLoader();
		if (loader == null) {
			continue;
		}
		File f = loader.getMainFile();
		if (query.equals(f)) {
			return proj;
		}
	}
	return null;
}
 
開發者ID:reds-heig,項目名稱:logisim-evolution,代碼行數:14,代碼來源:Projects.java


注:本文中的com.cburch.logisim.file.Loader類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。