本文整理汇总了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());
}
}
示例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());
}
}
示例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;
}
}
});
}
}
示例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());
}
}
示例5: open
import com.rapidminer.FileProcessLocation; //导入依赖的package包/类
public static void open(final File file) {
OpenAction.open(new FileProcessLocation(file), true);
}
示例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;
}
}
});
}