本文整理汇总了Java中com.rapidminer.ProcessLocation类的典型用法代码示例。如果您正苦于以下问题:Java ProcessLocation类的具体用法?Java ProcessLocation怎么用?Java ProcessLocation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ProcessLocation类属于com.rapidminer包,在下文中一共展示了ProcessLocation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateRecentFileList
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/** Updates the list of recently used files. */
public void updateRecentFileList() {
recentFilesMenu.removeAll();
List<ProcessLocation> recentFiles = RapidMinerGUI.getRecentFiles();
int j = 1;
for (final ProcessLocation recentLocation : recentFiles) {
JMenuItem menuItem = new JMenuItem(j + " " + recentLocation.toMenuString());
menuItem.setMnemonic('0' + j);
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (RapidMinerGUI.getMainFrame().close()) {
com.rapidminer.gui.actions.OpenAction.open(recentLocation, true);
}
}
});
recentFilesMenu.add(menuItem);
j++;
}
}
示例2: saveRecentFileList
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
private static void saveRecentFileList() {
File file = FileSystemService.getUserConfigFile("history");
PrintWriter out = null;
try {
out = new PrintWriter(new FileWriter(file));
for (ProcessLocation loc : recentFiles) {
out.println(loc.toHistoryFileString());
}
} catch (IOException e) {
SwingTools.showSimpleErrorMessage("cannot_write_history_file", e);
} finally {
if (out != null) {
out.close();
}
}
}
示例3: updateRecentFileList
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/** Updates the list of recently used files. */
public void updateRecentFileList() {
recentFilesMenu.removeAll();
List<ProcessLocation> recentFiles = RapidMinerGUI.getRecentFiles();
int j = 1;
for (final ProcessLocation recentLocation : recentFiles) {
JMenuItem menuItem = new JMenuItem(j + " " + recentLocation.toMenuString());
menuItem.setMnemonic('0' + j);
menuItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
if (RapidMinerGUI.getMainFrame().close()) {
OpenAction.open(recentLocation, true);
}
}
});
recentFilesMenu.add(menuItem);
j++;
}
welcomeScreen.updateRecentFileList();
}
示例4: print
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
public int print(Graphics g, java.awt.print.PageFormat pageFormat, int pageIndex) {
if (pageIndex >= 1)
return NO_SUCH_PAGE;
String title = "RapidMiner";
Process process = RapidMinerGUI.getMainFrame().getProcess();
if (process != null) {
ProcessLocation loc = process.getProcessLocation();
if (loc != null) {
title += ": " + loc.getShortName();
}
}
Rectangle2D rect = TITLE_FONT.getStringBounds(title, ((Graphics2D) g).getFontRenderContext());
g.setFont(TITLE_FONT);
g.drawString(title, (int) (pageFormat.getImageableX() + pageFormat.getImageableWidth() / 2 - rect.getWidth() / 2), (int) (pageFormat.getImageableY() - rect.getY()));
Graphics2D translated = (Graphics2D) g.create((int) pageFormat.getImageableX(), (int) (pageFormat.getImageableY() + rect.getHeight() * 2), (int) pageFormat.getImageableWidth(), (int) (pageFormat.getImageableHeight() - rect.getHeight() * 2));
double widthFactor = pageFormat.getImageableWidth() / component.getWidth();
double heightFactor = pageFormat.getImageableHeight() / component.getHeight();
double scaleFactor = Math.min(widthFactor, heightFactor);
translated.scale(scaleFactor, scaleFactor);
component.print(translated);
translated.dispose();
return PAGE_EXISTS;
}
示例5: getIdentifier
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
@Override
public String getIdentifier() {
Process process = RapidMinerGUI.getMainFrame().getProcess();
if (process != null) {
ProcessLocation processLocation = process.getProcessLocation();
if (processLocation != null) {
return processLocation.toString();
}
}
return null;
}
示例6: setTitle
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/**
* Sets the window title (RapidMiner + filename + an asterisk if process was modified.
*/
public void setTitle() {
if (hostname == null) {
try {
hostname = " @ " + InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostname = "";
}
}
if (this.process != null) {
ProcessLocation loc = process.getProcessLocation();
if (loc != null) {
String locString = loc.toString();
// location string exceeding arbitrary number will be cut into repository name +
// /.../ + process name
if (locString.length() > MAX_LOCATION_TITLE_LENGTH) {
locString = RepositoryLocation.REPOSITORY_PREFIX + process.getRepositoryLocation().getRepositoryName()
+ RepositoryLocation.SEPARATOR + "..." + RepositoryLocation.SEPARATOR + loc.getShortName();
}
setTitle(locString + (changed ? "*" : "") + " \u2013 " + getFrameTitle());
} else {
setTitle("<new process" + (changed ? "*" : "") + "> \u2013 " + getFrameTitle());
}
} else {
setTitle(getFrameTitle());
}
}
示例7: handleBrokenProxessXML
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
public void handleBrokenProxessXML(final ProcessLocation location, final String xml, final Exception e) {
SwingTools.showSimpleErrorMessage("while_loading", e, location.toString(), e.getMessage());
Process process = new Process();
process.setProcessLocation(location);
setProcess(process, true);
perspectiveController.showPerspective(PerspectiveModel.DESIGN);
xmlEditor.setText(xml);
}
示例8: openProcess
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
private void openProcess() {
this.owner.dispose();
ProcessLocation location = (ProcessLocation)this.getSelectedValue();
if(RapidMinerGUI.getMainFrame().close()) {
GettingStartedDialog.logStats("open_process_card", "open_previous");
OpenAction.open(location, true);
}
}
示例9: setToStep
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/**
* Restores the state of the process according to the given index. Will return a thrown
* exception if a problem occurs.
*/
private Exception setToStep(int index) {
String stateXML = undoManager.getXML(index);
synchronized (process) {
undoManager.clearSnapshot();
try {
String currentXML = process.getRootOperator().getXML(true);
ProcessLocation procLoc = process.getProcessLocation();
if (!stateXML.equals(currentXML)) {
process = undoManager.restoreProcess(index);
process.setProcessLocation(procLoc);
hasChanged = true;
fireProcessChanged();
}
// restore displayed chain
OperatorChain restoredOperatorChain = undoManager.restoreDisplayedChain(process, index);
if (restoredOperatorChain != null) {
displayedChain = restoredOperatorChain;
fireDisplayedChainChanged();
}
// restore selected operator
List<Operator> restoredOperators = undoManager.restoreSelectedOperators(process, index);
if (restoredOperators != null) {
setRestore(restoredOperators.get(0));
selectedOperators = Collections.unmodifiableList(restoredOperators);
fireOperatorSelectionChanged(selectedOperators);
}
fireProcessUpdated();
} catch (Exception e) {
return e;
}
}
return null;
}
示例10: addToRecentFiles
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
public static void addToRecentFiles(final ProcessLocation location) {
if (location != null) {
while (recentFiles.contains(location)) {
recentFiles.remove(location);
}
recentFiles.addFirst(location);
while (recentFiles.size() > NUMBER_OF_RECENT_FILES) {
recentFiles.removeLast();
}
saveRecentFileList();
}
}
示例11: saveRecentFileList
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
private static void saveRecentFileList() {
File file = FileSystemService.getUserConfigFile("history");
try (FileWriter fw = new FileWriter(file); PrintWriter out = new PrintWriter(fw)) {
for (ProcessLocation loc : recentFiles) {
out.println(loc.toHistoryFileString());
}
} catch (IOException e) {
SwingTools.showSimpleErrorMessage("cannot_write_history_file", e);
}
}
示例12: setTitle
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/**
* Sets the window title (RapidMiner + filename + an asterisk if process was modified.
*/
public void setTitle() {
if (hostname == null) {
try {
hostname = " @ " + InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostname = "";
}
}
Process process = getProcess();
if (process != null) {
ProcessLocation loc = process.getProcessLocation();
String locString;
if (loc != null) {
locString = loc.toString();
// location string exceeding arbitrary number will be cut into repository name +
// /.../ + process name
if (locString.length() > MAX_LOCATION_TITLE_LENGTH) {
locString = RepositoryLocation.REPOSITORY_PREFIX + process.getRepositoryLocation().getRepositoryName()
+ RepositoryLocation.SEPARATOR + "..." + RepositoryLocation.SEPARATOR + loc.getShortName();
}
} else {
locString = "<new process";
}
setTitle(locString + (isChanged() ? "*" : "") + (loc == null ? ">" : "") + " \u2013 " + getFrameTitle()
+ hostname);
} else {
setTitle(getFrameTitle() + hostname);
}
}
示例13: addToRecentFiles
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
public static void addToRecentFiles(ProcessLocation location) {
if (location != null) {
while (recentFiles.contains(location)) {
recentFiles.remove(location);
}
recentFiles.addFirst(location);
while (recentFiles.size() > NUMBER_OF_RECENT_FILES) {
recentFiles.removeLast();
}
saveRecentFileList();
}
}
示例14: setTitle
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
/**
* Sets the window title (RapidMiner + filename + an asterisk if process was
* modified.
*/
private void setTitle() {
if (hostname == null) {
try {
hostname = " @ " + InetAddress.getLocalHost().getHostName();
} catch (UnknownHostException e) {
hostname = "";
}
}
if (this.process != null) {
ProcessLocation loc = process.getProcessLocation();
if (loc != null) {
String locString = loc.toString();
// location string exceeding arbitrary number will be cut into repository name + /.../ + process name
if (locString.length() > MAX_LOCATION_TITLE_LENGTH) {
locString = RepositoryLocation.REPOSITORY_PREFIX +
process.getRepositoryLocation().getRepositoryName() +
RepositoryLocation.SEPARATOR +
"..." +
RepositoryLocation.SEPARATOR +
loc.getShortName();
}
setTitle(locString + (changed ? "*" : "") + " \u2013 " + TITLE + hostname);
} else {
setTitle("<new process" + (changed ? "*" : "") + "> \u2013 " + TITLE + hostname);
}
} else {
setTitle(TITLE + hostname);
}
}
示例15: exit
import com.rapidminer.ProcessLocation; //导入依赖的package包/类
public void exit(boolean relaunch) {
if (changed) {
ProcessLocation loc = process.getProcessLocation();
String locName;
if (loc != null) {
locName = loc.getShortName();
} else {
locName = "unnamed";
}
switch (SwingTools.showConfirmDialog("save", ConfirmDialog.YES_NO_CANCEL_OPTION, locName)) {
case ConfirmDialog.YES_OPTION:
SaveAction.save(process);
if (changed)
return;
break;
case ConfirmDialog.NO_OPTION:
break;
case ConfirmDialog.CANCEL_OPTION:
default:
return;
}
} else {
if (!relaunch) { // in this case we have already confirmed
// ask for special confirmation before exiting RapidMiner while a process is running!
if (getProcessState() == Process.PROCESS_STATE_RUNNING || getProcessState() == Process.PROCESS_STATE_PAUSED) {
if (SwingTools.showConfirmDialog("exit_despite_running_process", ConfirmDialog.YES_NO_OPTION) == ConfirmDialog.NO_OPTION) {
return;
}
} else {
int answer = ConfirmDialog.showConfirmDialog("exit", ConfirmDialog.YES_NO_OPTION, RapidMinerGUI.PROPERTY_CONFIRM_EXIT, ConfirmDialog.YES_OPTION);
if (answer != ConfirmDialog.YES_OPTION) {
return;
}
}
}
}
stopProcess();
dispose();
RapidMinerGUI.quit(relaunch ? RapidMiner.ExitMode.RELAUNCH : RapidMiner.ExitMode.NORMAL);
}