本文整理汇总了Java中com.rapidminer.operator.ResultObject类的典型用法代码示例。如果您正苦于以下问题:Java ResultObject类的具体用法?Java ResultObject怎么用?Java ResultObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ResultObject类属于com.rapidminer.operator包,在下文中一共展示了ResultObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: deliver
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
public void deliver(List<? extends IOObject> inputs) {
int i = 0;
for (OutputPort port : getManagedPorts()) {
if (port.isConnected()) {
if (i >= inputs.size()) {
getPorts().getOwner().getOperator().getLogger().fine("Insufficient input for " + port.getSpec());
} else {
IOObject input = inputs.get(i);
port.deliver(input);
if (input != null) {
String name;
if (input instanceof ResultObject) {
name = ((ResultObject) input).getName();
} else {
name = input.getClass().getName();
}
if (input.getSource() != null) {
name += " (" + input.getSource() + ")";
}
getPorts().getOwner().getOperator().getLogger().fine("Delivering " + name + " to " + port.getSpec());
}
}
i++;
}
}
}
示例2: showAsResult
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/** Loads the data held by the given entry (in the background) and opens it as a result. */
public static void showAsResult(final IOObjectEntry data) {
if (data == null) {
throw new IllegalArgumentException("data entry must not be null");
}
final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {
@Override
public void run() {
try {
ResultObject result = (ResultObject) data.retrieveData(this.getProgressListener());
if (isCancelled()) {
return;
}
result.setSource(data.getLocation().toString());
RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
} catch (Exception e1) {
SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
}
}
};
downloadProgressThread.start();
}
示例3: getTreeCellRendererComponent
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf,
int row, boolean hasFocus) {
JLabel label = (JLabel) super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
CollectionTreeElement treeElement = (CollectionTreeElement) value;
IOObject ioobject = treeElement.getIOObject();
if (ioobject instanceof ResultObject) {
ResultObject ro = (ResultObject) ioobject;
String name = childNames.get(ro);
if (name == null) {
name = ro.getName();
}
String source = ro.getSource() != null ? " (<small>" + ro.getSource() + "</small>)" : "";
label.setText("<html>" + name + source + "</html>");
if (ro instanceof IOObjectCollection) {
label.setIcon(expanded ? ICON_FOLDER_OPEN : ICON_FOLDER_CLOSED);
} else {
Icon resultIcon = ro.getResultIcon();
label.setIcon(resultIcon);
}
} else if (ioobject instanceof IOObject) {
IOObject ioo = ioobject;
label.setText(ioo.getClass().getSimpleName());
}
return label;
}
示例4: showResult
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/** Creates the display in a ProgressThread. */
private void showResult(final ResultObject result, final String tabName, final String id) {
SwingUtilities.invokeLater(new Runnable() {
@Override
public void run() {
showResultNow(result, tabName, id);
}
});
// new ProgressThread("creating_display") {
// @Override
// public void run() {
// getProgressListener().setTotal(100);
// getProgressListener().setCompleted(10);
// showResultNow(result, tabName, id);
// getProgressListener().setCompleted(100);
// getProgressListener().complete();
// }
// }.start();
}
示例5: showResult
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/**
* Show result in a new tab.
*/
void showResult() {
if (resultObjects == null) return;
int i = 1;
for(IOObject result: resultObjects) {
if(result instanceof ResultObject) {
String resultName = result instanceof ExampleSet ?
((ResultObject) result).getName() :
RendererService.getName(result.getClass());
String tabName = prunedProcessName + " - " + resultName;
RapidMinerGUI.getMainFrame()
.getRemoteResultDisplay()
.showResultWithName((ResultObject) result, tabName);
i ++;
}
}
}
示例6: deliver
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
public void deliver(List<? extends IOObject> inputs) {
int i = 0;
for (OutputPort port : getManagedPorts()) {
if (port.isConnected()) {
if (i >= inputs.size()) {
getPorts().getOwner().getOperator().getLogger().fine("Insufficient input for "+port.getSpec());
} else {
IOObject input = inputs.get(i);
port.deliver(input);
String name;
if (input instanceof ResultObject) {
name = ((ResultObject)input).getName();
} else {
name = input.getClass().getName();
}
name += " ("+input.getSource()+")";
getPorts().getOwner().getOperator().getLogger().fine("Delivering " + name + " to " + port.getSpec());
}
i++;
}
}
}
示例7: showAsResult
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/** Loads the data held by the given entry (in the background) and opens it as a result. */
public static void showAsResult(final IOObjectEntry data) {
if (data == null) {
throw new IllegalArgumentException("data entry must not be null");
}
final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {
@Override
public void run() {
try {
ResultObject result = (ResultObject)data.retrieveData(this.getProgressListener());
if (isCancelled()) {
return;
}
result.setSource(data.getLocation().toString());
RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
} catch (Exception e1) {
SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
}
}
};
downloadProgressThread.start();
}
示例8: RadioCardPanel
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
public RadioCardPanel(String name, IOObject object, boolean showRepositoryStorageButton, boolean showExportMenuButton, boolean showCloseAllResultsButton) {
setLayout(new BorderLayout());
add(mainPanel, BorderLayout.CENTER);
add(toolBar, BorderLayout.NORTH);
if (showCloseAllResultsButton) {
toolBar.add(new CloseAllResultsAction(RapidMinerGUI.getMainFrame()), ViewToolBar.RIGHT);
}
if (showRepositoryStorageButton) {
toolBar.add(new StoreInRepositoryAction(object), ViewToolBar.RIGHT);
}
if (showExportMenuButton) {
DropDownButton exportButton = PrintingTools.makeExportPrintDropDownButton(mainPanel, (object instanceof ResultObject ? ((ResultObject)object).getName() : "result") + " " + object.getSource());
exportButton.addToToolBar(toolBar, ViewToolBar.RIGHT);
}
}
示例9: createComponent
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
private JPanel createComponent(ResultObject resultObject, IOContainer resultContainer) {
final String resultName = RendererService.getName(resultObject.getClass());
String usedResultName = resultObject.getName();
if (usedResultName == null) {
usedResultName = resultName;
}
synchronized (currentResultNames) {
Integer oldCount = currentResultNames.get(usedResultName);
int myIndex;
if (oldCount == null) {
myIndex = 1;
} else {
myIndex = oldCount+1;
}
currentResultNames.put(usedResultName, myIndex);
if (myIndex > 1) {
usedResultName += "(" + myIndex + ")";
}
}
return ResultDisplayTools.createVisualizationComponent(resultObject, resultContainer, usedResultName);
}
示例10: actionPerformed
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
final ProgressThread downloadProgressThread = new ProgressThread("download_from_repository") {
public void run() {
try {
RepositoryLocation location = new RepositoryLocation(repositoryLocation);
Entry entry = location.locateEntry();
if (entry instanceof IOObjectEntry) {
IOObjectEntry data = (IOObjectEntry) entry;
ResultObject result = (ResultObject) data.retrieveData(this.getProgressListener());
result.setSource(data.getLocation().toString());
RapidMinerGUI.getMainFrame().getResultDisplay().showResult(result);
} else {
SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", "Not an IOObject.");
}
} catch (Exception e1) {
SwingTools.showSimpleErrorMessage("cannot_fetch_data_from_repository", e1);
}
}
};
downloadProgressThread.start();
}
示例11: getTreeCellRendererComponent
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
@Override
public Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus) {
JLabel label = (JLabel)super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
if (value instanceof ResultObject) {
ResultObject ro = (ResultObject) value;
String name = childNames.get(ro);
if (name == null) {
name = ro.getName();
}
label.setText("<html>" + name + " (<small>"+ro.getSource()+"</small>)</html>");
if (ro instanceof IOObjectCollection) {
label.setIcon(expanded ? ICON_FOLDER_OPEN : ICON_FOLDER_CLOSED);
} else {
Icon resultIcon = ro.getResultIcon();
label.setIcon(resultIcon);
}
} else if (value instanceof IOObject) {
IOObject ioo = (IOObject) value;
label.setText(ioo.getClass().getSimpleName());
}
return label;
}
示例12: createComponent
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/**
* Creates an appropriate name, appending a number to make names unique, and calls
* {@link #createVisualizationComponent(IOObject, IOContainer, String)}.
*/
private JPanel createComponent(ResultObject resultObject, IOContainer resultContainer) {
final String resultName = RendererService.getName(resultObject.getClass());
String usedResultName = resultObject.getName();
if (usedResultName == null) {
usedResultName = resultName;
}
this.resultObject = resultObject;
return ResultDisplayTools.createVisualizationComponent(resultObject, resultContainer, id + ": " + usedResultName);
}
示例13: actionPerformed
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent e) {
ResultObject referenced = ioObject.get();
if (referenced != null) {
if (remote) {
RapidMinerGUI.getMainFrame().getRemoteResultDisplay().showResultWithName(referenced, tabName);
} else {
RapidMinerGUI.getMainFrame().getResultDisplay().showResultWithName(referenced, tabName);
}
}
}
示例14: makeTextRenderer
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
/**
* Create a text renderer for this result.
*
* @param result
* @return
*/
private Component makeTextRenderer(IOObject result) {
if (result instanceof ResultObject) {
String resultString = ((ResultObject) result).toResultString();
if (resultString.length() > MAX_RESULT_STRING_LENGTH) {
resultString = resultString.substring(0, MAX_RESULT_STRING_LENGTH);
}
return makeMainLabel("<html><pre>" + resultString + "</pre></html>");
} else {
return makeMainLabel("No information available.");
}
}
示例15: showData
import com.rapidminer.operator.ResultObject; //导入依赖的package包/类
@Override
public void showData(final IOContainer container, final String statusMessage) {
if (container == null || container.size() == 0) {
return;
}
final List<IOObject> ioobjects = Arrays.asList(container.getIOObjects());
new ProgressThread("creating_display") {
@Override
public void run() {
try {
getProgressListener().setTotal(ioobjects.size() + 1);
overview.addResults(RapidMinerGUI.getMainFrame().getProcess(), ioobjects, statusMessage);
getProgressListener().setCompleted(1);
int i = 0;
for (IOObject ioobject : ioobjects) {
if (ioobject instanceof ResultObject) {
i++;
showResultNow((ResultObject) ioobject, "", "process_" + i);
getProgressListener().setCompleted(i + 1);
}
}
} finally {
getProgressListener().complete();
}
}
}.start();
askForPerspectiveSwitch();
}