當前位置: 首頁>>代碼示例>>Java>>正文


Java Repository類代碼示例

本文整理匯總了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);
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:18,代碼來源:RepositoryConfigurationDialog.java

示例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);
			}

		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:28,代碼來源:RepositoryTreeUtil.java

示例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);
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:21,代碼來源:RenameRepositoryEntryAction.java

示例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;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:26,代碼來源:LocalRepositoryPanel.java

示例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"));
		}
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:24,代碼來源:LocalRepositoryPanel.java

示例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;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:28,代碼來源:ConfigurationManager.java

示例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;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:28,代碼來源:ConfigurationManager.java

示例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);
		}
	}
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:19,代碼來源:RunRemoteDialog.java

示例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);
				}

			}
		}
	}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:22,代碼來源:RepositoryTreeUtil.java

示例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;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-5,代碼行數:23,代碼來源:ConfigurationManager.java

示例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");
    }
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:9,代碼來源:ManageDatabaseConnectionsDialog.java

示例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 });
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:11,代碼來源:RepositoryTreeModel.java

示例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;
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:11,代碼來源:RepositoryTreeModel.java

示例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);
				}
			}
		});
	}
}
 
開發者ID:transwarpio,項目名稱:rapidminer,代碼行數:14,代碼來源:RepositoryTreeModel.java

示例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;
}
 
開發者ID:rapidminer,項目名稱:rapidminer-studio,代碼行數:11,代碼來源:RepositoryTreeModel.java


注:本文中的com.rapidminer.repository.Repository類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。