本文整理汇总了Java中com.rapidminer.gui.actions.OpenAction类的典型用法代码示例。如果您正苦于以下问题:Java OpenAction类的具体用法?Java OpenAction怎么用?Java OpenAction使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
OpenAction类属于com.rapidminer.gui.actions包,在下文中一共展示了OpenAction类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: openProcess
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
/** Opens the process held by the given entry (in the background) and opens it. */
public static void openProcess(final ProcessEntry processEntry) {
RepositoryProcessLocation processLocation = new RepositoryProcessLocation(processEntry.getLocation());
if (RapidMinerGUI.getMainFrame().close()) {
OpenAction.open(processLocation, true);
}
/*
* PRE FIX OF BUG 308: When opening process with double click all changes are discarded
* ProgressThread openProgressThread = new ProgressThread("open_process") {
*
* @Override public void run() { try { RepositoryProcessLocation processLocation = new
* RepositoryProcessLocation(processEntry.getLocation()); String xml =
* processEntry.retrieveXML(); try { final Process process = new Process(xml);
* process.setProcessLocation(processLocation); SwingUtilities.invokeLater(new Runnable() {
* public void run() { RapidMinerGUI.getMainFrame().setOpenedProcess(process, true,
* processEntry.getLocation().toString()); } }); } catch (Exception e) {
* RapidMinerGUI.getMainFrame().handleBrokenProxessXML(processLocation, xml, e); } } catch
* (Exception e1) { SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository",
* e1); }
*
* } }; openProgressThread.start();
*/
}
示例2: updateRecentFileList
import com.rapidminer.gui.actions.OpenAction; //导入依赖的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();
}
示例3: openProcess
import com.rapidminer.gui.actions.OpenAction; //导入依赖的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);
}
}
示例4: createSelectButton
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
private JComponent createSelectButton(final RepositoryLocationChooser chooser) {
JButton selectButton = new JButton(new ResourceAction("getting_started.open", new Object[0]) {
private static final long serialVersionUID = 1L;
public void actionPerformed(ActionEvent e) {
if(RapidMinerGUI.getMainFrame().close()) {
try {
GettingStartedDialog.logStats("open_process_card", "open_from_location");
String e1 = chooser.getRepositoryLocation();
if(e1 != null) {
try {
RepositoryLocation e11 = new RepositoryLocation(e1);
Entry entry = e11.locateEntry();
if(entry instanceof ProcessEntry) {
OpenAction.open(new RepositoryProcessLocation(e11), true);
OpenProcessCard.this.owner.dispose();
} else if(entry instanceof IOObjectEntry) {
OpenAction.showAsResult((IOObjectEntry)entry);
OpenProcessCard.this.owner.dispose();
} else {
SwingTools.showVerySimpleErrorMessage("no_data_or_process", new Object[0]);
}
} catch (MalformedRepositoryLocationException | RepositoryException var5) {
SwingTools.showSimpleErrorMessage("while_loading", var5, new Object[]{e1, var5.getMessage()});
}
}
} catch (MalformedRepositoryLocationException var6) {
SwingTools.showSimpleErrorMessage("while_loading", var6, new Object[]{"", var6.getMessage()});
}
}
}
});
selectButton.setFocusable(false);
this.styleButton(selectButton);
return selectButton;
}
示例5: openProcess
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
/** Opens the process held by the given entry (in the background) and opens it. */
public static void openProcess(final ProcessEntry processEntry) {
RepositoryProcessLocation processLocation = new RepositoryProcessLocation(processEntry.getLocation());
if (RapidMinerGUI.getMainFrame().close()) {
OpenAction.open(processLocation, true);
}
/* PRE FIX OF BUG 308: When opening process with double click all changes are discarded
ProgressThread openProgressThread = new ProgressThread("open_process") {
@Override
public void run() {
try {
RepositoryProcessLocation processLocation = new RepositoryProcessLocation(processEntry.getLocation());
String xml = processEntry.retrieveXML();
try {
final Process process = new Process(xml);
process.setProcessLocation(processLocation);
SwingUtilities.invokeLater(new Runnable() {
public void run() {
RapidMinerGUI.getMainFrame().setOpenedProcess(process, true, processEntry.getLocation().toString());
}
});
} catch (Exception e) {
RapidMinerGUI.getMainFrame().handleBrokenProxessXML(processLocation, xml, e);
}
} catch (Exception e1) {
SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
}
}
};
openProgressThread.start();*/
}
示例6: openRecentProcess
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
public void openRecentProcess() {
int selectedIndex = recentFileList.getSelectedIndex();
if (selectedIndex < 0)
selectedIndex = 0;
if (RapidMinerGUI.getRecentFiles().size() > 0)
OpenAction.open(RapidMinerGUI.getRecentFiles().get(selectedIndex), true);
else
OpenAction.open();
}
示例7: RepositoryBrowser
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
/**
* @param dragListener
* registers a dragListener at the repository tree transferhandler. The listener is
* informed when a drag starts and a drag ends.
*/
public RepositoryBrowser(DragListener dragListener) {
tree = new RepositoryTree();
if (dragListener != null) {
((AbstractPatchedTransferHandler) tree.getTransferHandler()).addDragListener(dragListener);
}
tree.addRepositorySelectionListener(new RepositorySelectionListener() {
@Override
public void repositoryLocationSelected(RepositorySelectionEvent e) {
Entry entry = e.getEntry();
if (entry instanceof ProcessEntry) {
RepositoryTree.openProcess((ProcessEntry) entry);
} else if (entry instanceof IOObjectEntry) {
OpenAction.showAsResult((IOObjectEntry) entry);
}
}
});
setLayout(new BorderLayout());
final JPopupMenu furtherActionsMenu = new JPopupMenu();
furtherActionsMenu.add(ADD_REPOSITORY_ACTION);
furtherActionsMenu.add(tree.CREATE_FOLDER_ACTION);
final JMenu sortActionsMenu = new JMenu(SORT_REPOSITORY_ACTION);
sortActionsMenu.add(tree.SORT_BY_NAME_ACTION.createMenuItem());
sortActionsMenu.add(tree.SORT_BY_LAST_MODIFIED_DATE_ACTION.createMenuItem());
furtherActionsMenu.add(sortActionsMenu);
furtherActionsMenu.add(tree.REFRESH_ACTION);
furtherActionsMenu.add(tree.SHOW_PROCESS_IN_REPOSITORY_ACTION);
JPanel northPanel = new JPanel(new GridBagLayout());
northPanel.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
c.weightx = 1;
c.insets = new Insets(2, 2, 2, 2);
JButton addDataButton = new JButton(new ImportDataAction(true));
addDataButton.setPreferredSize(new Dimension(100, 30));
northPanel.add(addDataButton, c);
DropDownPopupButton furtherActionsButton = new DropDownPopupButton("gui.action.further_repository_actions",
new PopupMenuProvider() {
@Override
public JPopupMenu getPopupMenu() {
return furtherActionsMenu;
}
});
furtherActionsButton.setPreferredSize(new Dimension(50, 30));
c.gridx = 1;
c.gridy = 0;
c.weightx = 0;
northPanel.add(furtherActionsButton, c);
add(northPanel, BorderLayout.NORTH);
JScrollPane scrollPane = new ExtendedJScrollPane(tree);
scrollPane.setBorder(BorderFactory.createMatteBorder(1, 0, 0, 0, Colors.TEXTFIELD_BORDER));
add(scrollPane, BorderLayout.CENTER);
}
示例8: RepositoryBrowser
import com.rapidminer.gui.actions.OpenAction; //导入依赖的package包/类
/**
* @param dragListener registers a dragListener at the repository tree transferhandler. The listener is informed when a drag starts and a drag ends.
*/
public RepositoryBrowser(DragListener dragListener) {
tree = new RepositoryTree();
if(dragListener != null) {
((AbstractPatchedTransferHandler) tree.getTransferHandler()).addDragListener(dragListener);
}
tree.addRepositorySelectionListener(new RepositorySelectionListener() {
@Override
public void repositoryLocationSelected(RepositorySelectionEvent e) {
Entry entry = e.getEntry();
if (entry instanceof ProcessEntry) {
RepositoryTree.openProcess((ProcessEntry)entry);
} else if (entry instanceof IOObjectEntry) {
OpenAction.showAsResult((IOObjectEntry) entry);
}
}
});
setLayout(new BorderLayout());
JToolBar toolBar = new ExtendedJToolBar();
toolBar.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));
toolBar.add(ADD_REPOSITORY_ACTION);
(new DropDownButton(new ResourceActionAdapter(true, "import")) {
private static final long serialVersionUID = -5482452738124971463L;
@Override
protected JPopupMenu getPopupMenu() {
JPopupMenu menu = new JPopupMenu();
menu.add(RapidMinerGUI.getMainFrame().IMPORT_CSV_FILE_ACTION);
menu.add(RapidMinerGUI.getMainFrame().IMPORT_EXCEL_FILE_ACTION);
menu.add(RapidMinerGUI.getMainFrame().IMPORT_XML_FILE_ACTION);
menu.add(RapidMinerGUI.getMainFrame().IMPORT_ACCESS_FILE_ACTION);
menu.add(RapidMinerGUI.getMainFrame().IMPORT_DATABASE_TABLE_ACTION);
menu.add(BlobImportWizard.IMPORT_BLOB_ACTION);
return menu;
}
}).addToToolBar(toolBar);
toolBar.add(tree.OPEN_ACTION);
toolBar.add(tree.REFRESH_ACTION);
toolBar.add(tree.CREATE_FOLDER_ACTION);
toolBar.add(tree.SHOW_PROCESS_IN_REPOSITORY_ACTION);
add(toolBar, BorderLayout.NORTH);
JScrollPane scrollPane = new ExtendedJScrollPane(tree);
scrollPane.setBorder(null);
add(scrollPane, BorderLayout.CENTER);
}