本文整理汇总了Java中com.rapidminer.repository.Repository类的典型用法代码示例。如果您正苦于以下问题:Java Repository类的具体用法?Java Repository怎么用?Java Repository使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Repository类属于com.rapidminer.repository包,在下文中一共展示了Repository类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: RepositoryConfigurationDialog
import com.rapidminer.repository.Repository; //导入依赖的package包/类
public RepositoryConfigurationDialog(Repository repository) {
super(ApplicationFrame.getApplicationFrame(), RemoteRepository.class.isAssignableFrom(repository.getClass())
? "remoterepositoryconfigdialog" : "repositoryconfigdialog", ModalityType.APPLICATION_MODAL,
new Object[] {});
this.repository = repository;
JButton okButton = makeOkButton("repository_configuration_dialog.save");
configurationPanel = repository.makeConfigurationPanel();
configurationPanel.setOkButton(okButton);
configurationPanel.configureUIElementsFrom(repository);
List<AbstractButton> buttons = new LinkedList<>();
buttons.addAll(configurationPanel.getAdditionalButtons());
buttons.add(okButton);
buttons.add(makeCancelButton());
layoutDefault(configurationPanel.getComponent(), DEFAULT_SIZE, buttons);
}
示例2: saveExpansionState
import com.rapidminer.repository.Repository; //导入依赖的package包/类
/**
* Saves the currently selected paths and saves all expanded repositories and nodes.
*
* @param tree
* The related tree, containing the path(s)
*/
public void saveExpansionState(JTree tree) {
saveSelectionPaths(tree.getSelectionPaths());
expandedNodes = new HashSet<>();
expandedRepositories = new HashSet<>();
for (int i = 0; i < tree.getRowCount(); i++) {
TreePath path = tree.getPathForRow(i);
if (tree.isExpanded(path)) {
Entry entry = (Entry) path.getLastPathComponent();
String absoluteLocation = entry.getLocation().getAbsoluteLocation();
if (entry instanceof Repository) {
expandedRepositories.add(absoluteLocation);
} else {
expandedNodes.add(absoluteLocation);
}
}
}
}
示例3: actionPerformed
import com.rapidminer.repository.Repository; //导入依赖的package包/类
@Override
public void actionPerformed(Entry entry) {
// no renaming of repositores allowed, RepositoryConfigurationDialog is responsible for that
if (entry instanceof Repository) {
return;
}
String name = SwingTools.showRepositoryEntryInputDialog("file_chooser.rename", entry.getName(), entry.getName());
if ((name != null) && !name.equals(entry.getName())) {
boolean success = false;
try {
success = entry.rename(name);
} catch (Exception e) {
SwingTools.showSimpleErrorMessage("cannot_rename_entry", e, entry.getName(), name, e.getMessage());
return;
}
if (!success) {
SwingTools.showVerySimpleErrorMessage("cannot_rename_entry", entry.getName(), name);
}
}
}
示例4: configure
import com.rapidminer.repository.Repository; //导入依赖的package包/类
@Override
public boolean configure(Repository repository) {
File file = new File(fileField.getText());
String alias = aliasField.getText();
try {
// in case only the alias has changed the file stays the same
if (((LocalRepository) repository).getFile().equals(file)) {
file = null;
}
if (((LocalRepository) repository).getName().equals(alias)) {
alias = null;
}
checkConfiguration(file, alias);
if (alias != null) {
((LocalRepository) repository).rename(alias);
}
} catch (RepositoryException e) {
SwingTools.showSimpleErrorMessage("cannot_create_repository", e);
return false;
}
if (file != null) {
((LocalRepository) repository).setRoot(file);
}
return true;
}
示例5: checkConfiguration
import com.rapidminer.repository.Repository; //导入依赖的package包/类
/**
* Throws a {@link RepositoryException} if the given configuration is invalid.
*
* @param file
* @param alias
* @throws RepositoryException
*/
private void checkConfiguration(File file, String alias) throws RepositoryException {
// make sure that it's not possible to create multiple repositories in the same location or
// with the same alias
for (Repository repo : RepositoryManager.getInstance(null).getRepositories()) {
if (repo instanceof LocalRepository) {
if (((LocalRepository) repo).getRoot().equals(file)) {
throw new RepositoryException(I18N.getMessage(I18N.getErrorBundle(),
"repository.repository_creation_duplicate_location"));
}
}
if (repo.getName().equals(alias)) {
throw new RepositoryException(I18N.getMessage(I18N.getErrorBundle(),
"repository.repository_creation_duplicate_alias"));
}
}
}
示例6: initialize
import com.rapidminer.repository.Repository; //导入依赖的package包/类
/**
* Inits the {@link ConfigurationManager}. This includes initial configuration loading as well
* as registering listeners to remote repositories.
*/
public void initialize() {
if (initialized) {
loadConfiguration();
return;
}
loadConfiguration();
RepositoryManager.getInstance(null).addObserver(new Observer<Repository>() {
@Override
public void update(Observable<Repository> observable, final Repository arg) {
if (arg instanceof RemoteRepository) {
loadFromRepository((RemoteRepository) arg);
((RemoteRepository) arg).addConnectionListener(loadOnConnectListener);
arg.addRepositoryListener(loadOnRefreshListener);
}
}
}, false);
for (RemoteRepository ra : RepositoryManager.getInstance(null).getRemoteRepositories()) {
//ra.addConnectionListener(this.loadOnConnectListener);
//ra.addRepositoryListener(this.loadOnRefreshListener);
}
initialized = true;
}
示例7: initialize
import com.rapidminer.repository.Repository; //导入依赖的package包/类
/**
* Inits the {@link ConfigurationManager}. This includes initial configuration loading as well
* as registering listeners to remote repositories.
*/
public void initialize() {
if (initialized) {
loadConfiguration();
return;
}
loadConfiguration();
RepositoryManager.getInstance(null).addObserver(new Observer<Repository>() {
@Override
public void update(Observable<Repository> observable, final Repository arg) {
if (arg instanceof RemoteRepository) {
loadFromRepository((RemoteRepository) arg);
((RemoteRepository) arg).addConnectionListener(loadOnConnectListener);
arg.addRepositoryListener(loadOnRefreshListener);
}
}
}, false);
for (RemoteRepository ra : RepositoryManager.getInstance(null).getRemoteRepositories()) {
ra.addConnectionListener(this.loadOnConnectListener);
ra.addRepositoryListener(this.loadOnRefreshListener);
}
initialized = true;
}
示例8: updateExecutionQueueComboBox
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private void updateExecutionQueueComboBox() {
Repository selected = (Repository) repositoryBox.getSelectedItem();
if (selected != null) {
if (selected instanceof RemoteRepository) {
RemoteRepository remoteRepo = (RemoteRepository) selected;
List<String> processQueueNames = remoteRepo.getProcessQueueNames();
updateQueueComoboxModel(processQueueNames);
if (processQueueNames == null || processQueueNames.isEmpty()) {
enableQueueSelection(false);
} else {
enableQueueSelection(true);
}
} else {
enableQueueSelection(false);
updateQueueComoboxModel(null);
}
}
}
示例9: saveExpansionState
import com.rapidminer.repository.Repository; //导入依赖的package包/类
public void saveExpansionState(JTree tree) {
expandedNodes = new HashSet<String>();
expandedRepositories = new HashSet<String>();
saveSelectionPath(tree.getSelectionPath());
for (int i = 0; i < tree.getRowCount(); i++) {
TreePath path = tree.getPathForRow(i);
if (tree.isExpanded(path)) {
Entry entry = (Entry) path.getLastPathComponent();
String absoluteLocation = entry.getLocation().getAbsoluteLocation();
if (entry instanceof Repository) {
expandedRepositories.add(absoluteLocation);
} else {
expandedNodes.add(absoluteLocation);
}
}
}
}
示例10: initialize
import com.rapidminer.repository.Repository; //导入依赖的package包/类
public void initialize() {
if (initialized) {
return;
}
loadConfiguration();
RepositoryManager.getInstance(null).addObserver(new Observer<Repository>() {
@Override
public void update(Observable<Repository> observable, final Repository arg) {
if (arg instanceof RemoteRepository) {
loadFromRepository((RemoteRepository) arg);
((RemoteRepository) arg).addConnectionListener(loadOnConnectListener);
arg.addRepositoryListener(loadOnRefreshListener);
}
}
}, false);
for (RemoteRepository ra : RepositoryManager.getInstance(null).getRemoteRepositories()) {
ra.addConnectionListener(this.loadOnConnectListener);
ra.addRepositoryListener(this.loadOnRefreshListener);
}
initialized = true;
}
示例11: refreshDB
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private void refreshDB() {
try {
Repository dbRepository = RepositoryManager.getInstance(null).getRepository("DB");
dbRepository.refresh();
} catch (RepositoryException e1) {
LogService.getRoot().warning("Repository DB is missing");
}
}
示例12: makeChangeEvent
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private TreeModelEvent makeChangeEvent(Entry entry) {
TreePath path = getPathTo(entry.getContainingFolder());
int index;
if (entry instanceof Repository) {
index = RepositoryManager.getInstance(null).getRepositories().indexOf(entry);
} else {
index = getIndexOfChild(entry.getContainingFolder(), entry);
}
return new TreeModelEvent(RepositoryTreeModel.this, path, new int[] { index }, new Object[] { entry });
}
示例13: getWritableRepositories
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private List<Repository> getWritableRepositories(RepositoryManager manager) {
List<Repository> repositories = manager.getRepositories();
List<Repository> writeableRepositories = new LinkedList<>();
for (Repository repository : repositories) {
if (!repository.isReadOnly()) {
writeableRepositories.add(repository);
}
}
return writeableRepositories;
}
示例14: refresh
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private void refresh() {
for (Repository repo : root.getRepositories()) {
final TreeModelEvent e = makeChangeEvent(repo);
SwingTools.invokeAndWait(new Runnable() {
@Override
public void run() {
for (TreeModelListener l : listeners.getListeners(TreeModelListener.class)) {
l.treeStructureChanged(e);
}
}
});
}
}
示例15: getWritableRepositories
import com.rapidminer.repository.Repository; //导入依赖的package包/类
private List<Repository> getWritableRepositories(RepositoryManager manager) {
List<Repository> repositories = manager.getRepositories();
List<Repository> writeableRepositories = new ArrayList<>();
for (Repository repository : repositories) {
if (!repository.isReadOnly()) {
writeableRepositories.add(repository);
}
}
return writeableRepositories;
}