当前位置: 首页>>代码示例>>Java>>正文


Java FileProcessLocation类代码示例

本文整理汇总了Java中com.rapidminer.FileProcessLocation的典型用法代码示例。如果您正苦于以下问题:Java FileProcessLocation类的具体用法?Java FileProcessLocation怎么用?Java FileProcessLocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FileProcessLocation类属于com.rapidminer包,在下文中一共展示了FileProcessLocation类的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loggedActionPerformed

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
@Override
public void loggedActionPerformed(ActionEvent e) {
	File file = SwingTools.chooseFile(RapidMinerGUI.getMainFrame(), "export_process", null, false, false, new String[] {
			RapidMiner.PROCESS_FILE_EXTENSION, "xml" }, new String[] { "Process File", "Process File" });
	if (file == null) {
		return;
	}
	try {
		new FileProcessLocation(file).store(RapidMinerGUI.getMainFrame().getProcess(), null);
	} catch (IOException e1) {
		SwingTools.showSimpleErrorMessage("cannot_save_process", e1, RapidMinerGUI.getMainFrame().getProcess()
				.getProcessLocation(), e1.getMessage());
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-studio,代码行数:15,代码来源:ExportProcessAction.java

示例2: actionPerformed

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	File file = SwingTools.chooseFile(RapidMinerGUI.getMainFrame(), "export_process", null, false, false, 
			new String[] { RapidMiner.PROCESS_FILE_EXTENSION, "xml" } , 
			new String[] { "Process File", "Process File" });
	if (file == null) {
		return;
	}			
	try {
		new FileProcessLocation(file).store(RapidMinerGUI.getMainFrame().getProcess(), null);
	} catch (IOException e1) {
		SwingTools.showSimpleErrorMessage("cannot_save_process", e1, RapidMinerGUI.getMainFrame().getProcess().getProcessLocation(), e1.getMessage());
	}		
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:15,代码来源:ExportProcessAction.java

示例3: saveProcess

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
private void saveProcess(final Process process) {
	if (autoSaveEnabled) {
		this.autoSaveQueue.execute(new Runnable() {

			@Override
			public void run() {

				ProcessLocation processLocation = process.getProcessLocation();
				if (processLocation != null) {
					if (processLocation instanceof FileProcessLocation) {
						locationInfo = "autosave.process.type=file" + "\n" + "autosave.process.path=" + ((FileProcessLocation) processLocation).getFile().getAbsolutePath();
					} else if (processLocation instanceof RepositoryProcessLocation) {
						locationInfo = "autosave.process.type=repository_object" + "\n" + "autosave.process.path=" + ((RepositoryProcessLocation) processLocation).getRepositoryLocation().getAbsoluteLocation();
					}
				} else {
					//process is not saved yet
					locationInfo = "autosave.process.type=none" + "\n" + "autosave.process.path=none";
				}
				String processXML = process.getRootOperator().getXML(false);

				try {
					FileWriter infoWriter = new FileWriter(autoSavedProcessProperties);
					infoWriter.write(locationInfo);
					infoWriter.flush();
					infoWriter.close();

					FileWriter processWriter = new FileWriter(autoSavedProcess);
					processWriter.write(processXML);
					processWriter.flush();
					processWriter.close();
				} catch (IOException e) {
					LogService.getRoot().log(Level.INFO, "com.rapidminer.gui.autosave.AutoSave.dir_creation_failed", e);
					AutoSave.this.autoSaveEnabled = false;
				}

			}
		});
	}

}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:41,代码来源:AutoSave.java

示例4: actionPerformed

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
	File file = SwingTools.chooseFile(RapidMinerGUI.getMainFrame(), "export_process", null, false, false, new String[] {
			RapidMiner.PROCESS_FILE_EXTENSION, "xml" }, new String[] { "Process File", "Process File" });
	if (file == null) {
		return;
	}
	try {
		new FileProcessLocation(file).store(RapidMinerGUI.getMainFrame().getProcess(), null);
	} catch (IOException e1) {
		SwingTools.showSimpleErrorMessage("cannot_save_process", e1, RapidMinerGUI.getMainFrame().getProcess()
				.getProcessLocation(), e1.getMessage());
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:15,代码来源:ExportProcessAction.java

示例5: open

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
public static void open(final File file) {
	OpenAction.open(new FileProcessLocation(file), true);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:ImportProcessAction.java

示例6: saveProcess

import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
/**
 * Save the given process as an auto save.
 *
 * @param process
 *            the process to save
 */
private void saveProcess(final Process process) {
	// no need to do anything if auto save is disabled
	if (!autoSaveEnabled) {
		return;
	}

	// store saving in update queue to avoid multiple saves in a row
	this.autoSaveQueue.execute(new Runnable() {

		@Override
		public void run() {

			ProcessLocation processLocation = process.getProcessLocation();
			if (processLocation != null) {
				if (processLocation instanceof FileProcessLocation) {
					autoSaveProperties.put(PROPERTY_PROCESS_PATH,
							((FileProcessLocation) processLocation).getFile().getAbsolutePath());
					autoSaveProperties.put(PROPERTY_PROCESS_TYPE, LOCATION_TYPE_FILE);
				} else if (processLocation instanceof RepositoryProcessLocation) {
					autoSaveProperties.put(PROPERTY_PROCESS_PATH,
							((RepositoryProcessLocation) processLocation).getRepositoryLocation().getAbsoluteLocation());
					autoSaveProperties.put(PROPERTY_PROCESS_TYPE, LOCATION_TYPE_REPOSITORY);
				}
			} else {
				// process is not saved yet
				autoSaveProperties.put(PROPERTY_PROCESS_PATH, LOCATION_TYPE_NONE);
				autoSaveProperties.put(PROPERTY_PROCESS_TYPE, LOCATION_TYPE_NONE);
			}
			String processXML = process.getRootOperator().getXML(false);

			try (OutputStreamWriter infoWriter = new OutputStreamWriter(
					new FileOutputStream(autoSavedProcessPropertiesPath.toFile()), StandardCharsets.UTF_8);
					OutputStreamWriter processWriter = new OutputStreamWriter(
							new FileOutputStream(autoSavedProcessPath.toFile()), StandardCharsets.UTF_8)) {
				autoSaveProperties.store(infoWriter, null);

				processWriter.write(processXML);
				processWriter.flush();

				// process has been overwritten, we do not longer provide the recovery process
				isRecoveryProcessPresent = false;
			} catch (IOException e) {
				LogService.getRoot().log(Level.INFO, "com.rapidminer.gui.autosave.AutoSave.dir_creation_failed", e);
				AutoSave.this.autoSaveEnabled = false;
			}

		}
	});
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:56,代码来源:AutoSave.java


注:本文中的com.rapidminer.FileProcessLocation类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。