当前位置: 首页>>代码示例>>Java>>正文


Java OutputPorts类代码示例

本文整理汇总了Java中com.rapidminer.operator.ports.OutputPorts的典型用法代码示例。如果您正苦于以下问题:Java OutputPorts类的具体用法?Java OutputPorts怎么用?Java OutputPorts使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


OutputPorts类属于com.rapidminer.operator.ports包,在下文中一共展示了OutputPorts类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderConnectionsBackground

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
/**
 * Draws the connections background (round pipe) for the given ports.
 *
 * @param inputPorts
 *            the input ports for which to draw connection backgrounds
 * @param ports
 *            the output ports for which to draw connection backgrounds
 * @param g2
 *            the graphics context to draw upon
 */
@SuppressWarnings("deprecation")
private void renderConnectionsBackground(final InputPorts inputPorts, final OutputPorts ports, final Graphics2D g2) {
	for (int i = 0; i < ports.getNumberOfPorts(); i++) {
		OutputPort from = ports.getPortByIndex(i);
		Port to = from.getDestination();
		if (to != null) {
			Shape connector = ProcessDrawUtils.createConnector(from, to, model);

			// the first paint can come before any of the operator register listeners fire
			// thus we need to check the shape for null; subsequent calls will have a valid
			// shape
			if (connector == null) {
				return;
			}

			g2.setColor(Color.WHITE);
			if (from.getMetaData() instanceof CollectionMetaData) {
				g2.setStroke(CONNECTION_COLLECTION_LINE_BACKGROUND_STROKE);
			} else {
				g2.setStroke(CONNECTION_LINE_BACKGROUND_STROKE);
			}
			g2.draw(connector);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:36,代码来源:ProcessDrawer.java

示例2: ProcessContextEditor

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
/**
 * Constructs an editor for the given process and edited context. See class comment to find out
 * why you can pass in a context here.
 */
public ProcessContextEditor(Process process, ProcessContext alternativeContext) {
	inputEditor = new RepositoryLocationsEditor<OutputPorts>(true, "context.input", "input");
	outputEditor = new RepositoryLocationsEditor<InputPorts>(false, "context.output", "result");
	macroEditor = new MacroEditor(true);

	setLayout(new GridLayout(3, 1));
	((GridLayout) getLayout()).setHgap(0);
	((GridLayout) getLayout()).setVgap(10);

	add(inputEditor);
	add(outputEditor);
	add(macroEditor);

	setProcess(process, alternativeContext);
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:20,代码来源:ProcessContextEditor.java

示例3: exportConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void exportConnections(OutputPorts outputPorts, ExecutionUnit processInScope, Element insertInto, Document doc) {
	for (OutputPort outputPort : outputPorts.getAllPorts()) {
		if (outputPort.isConnected()) {
			Element portElement = doc.createElement("connect");
			if (processInScope.getEnclosingOperator() != outputPorts.getOwner().getOperator()) {
				portElement.setAttribute("from_op", outputPorts.getOwner().getOperator().getName());
			}
			portElement.setAttribute("from_port", outputPort.getName());
			InputPort destination = outputPort.getDestination();
			if (processInScope.getEnclosingOperator() != destination.getPorts().getOwner().getOperator()) {
				portElement.setAttribute("to_op", destination.getPorts().getOwner().getOperator().getName());
			}
			portElement.setAttribute("to_port", destination.getName());
			insertInto.appendChild(portElement);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:18,代码来源:XMLExporter.java

示例4: exportConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void exportConnections(OutputPorts outputPorts, ExecutionUnit processInScope, Element insertInto, Document doc) {
  for (OutputPort outputPort : outputPorts.getAllPorts()) {
    if (outputPort.isConnected()) {
      Element portElement = doc.createElement("connect");
      if (processInScope.getEnclosingOperator() != outputPorts.getOwner().getOperator()) {
        portElement.setAttribute("from_op", outputPorts.getOwner().getOperator().getName());
      }
      portElement.setAttribute("from_port", outputPort.getName());
      InputPort destination = outputPort.getDestination();
      if (processInScope.getEnclosingOperator() != destination.getPorts().getOwner().getOperator()) {
        portElement.setAttribute("to_op", destination.getPorts().getOwner().getOperator().getName());
      }
      portElement.setAttribute("to_port", destination.getName());
      insertInto.appendChild(portElement);
    }
  }
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:18,代码来源:MidasXMLExporter.java

示例5: exportConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private List<ConnectMsg> exportConnections(OutputPorts outputPorts, ExecutionUnit processInScope){
    List<ConnectMsg> connects = new ArrayList<>();
    for (OutputPort outputPort : outputPorts.getAllPorts()) {
        if (outputPort.isConnected()) {
            ConnectMsg connect = new ConnectMsg();
            if (processInScope.getEnclosingOperator() != outputPorts.getOwner().getOperator()) {
                connect.setFromOp(outputPorts.getOwner().getOperator().getName());
            }
            connect.setFromPort(outputPort.getName());
            InputPort destination = outputPort.getDestination();
            if (processInScope.getEnclosingOperator() != destination.getPorts().getOwner().getOperator()) {
                connect.setToOp(destination.getPorts().getOwner().getOperator().getName());
            }
            connect.setToPort(destination.getName());

            connects.add(connect);
        }
    }
    return connects;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:21,代码来源:MidasJsonExporter.java

示例6: ProcessContextEditor

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
/** Constructs an editor for the given process and edited context. See class comment to find out why you can pass in
 *  a context here. */
public ProcessContextEditor(Process process, ProcessContext alternativeContext) {
	inputEditor = new RepositoryLocationsEditor<OutputPorts>(true, "context.input", "input"); 
	outputEditor = new RepositoryLocationsEditor<InputPorts>(false, "context.output", "result");
	macroEditor = new MacroEditor(true);

	setLayout(new GridLayout(3, 1));
	((GridLayout) getLayout()).setHgap(0);
	((GridLayout) getLayout()).setVgap(10);
	
	inputEditor.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));
	outputEditor.setBorder(BorderFactory.createMatteBorder(0, 0, 1, 0, Color.LIGHT_GRAY));

	add(inputEditor);
	add(outputEditor);
	add(macroEditor);
	
	setProcess(process, alternativeContext);
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:21,代码来源:ProcessContextEditor.java

示例7: exportConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void exportConnections(OutputPorts outputPorts, ExecutionUnit processInScope, Element insertInto, Document doc) {
    for (OutputPort outputPort : outputPorts.getAllPorts()) {
        if (outputPort.isConnected()) {
            Element portElement = doc.createElement("connect");
            if (processInScope.getEnclosingOperator() != outputPorts.getOwner().getOperator()) {
                portElement.setAttribute("from_op", outputPorts.getOwner().getOperator().getName());
            }
            portElement.setAttribute("from_port", outputPort.getName());
            InputPort destination = outputPort.getDestination();
            if (processInScope.getEnclosingOperator() != destination.getPorts().getOwner().getOperator()) {
                portElement.setAttribute("to_op", destination.getPorts().getOwner().getOperator().getName());
            }
            portElement.setAttribute("to_port", destination.getName());
            insertInto.appendChild(portElement);
        }
    }
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:18,代码来源:XMLExporter.java

示例8: addReadyOutputs

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void addReadyOutputs(LinkedList<OutputPort> readyOutputs, OutputPorts ports) {
	// add the parameters in a stack-like fashion like in pre-5.0
	Iterator<OutputPort> i = new LinkedList<OutputPort>(ports.getAllPorts()).descendingIterator();
	while (i.hasNext()) {
		OutputPort port = i.next();
		if (!port.isConnected() && port.shouldAutoConnect()) {
			readyOutputs.addLast(port);
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:11,代码来源:ExecutionUnit.java

示例9: addReadyOutputs

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void addReadyOutputs(LinkedList<OutputPort> readyOutputs, OutputPorts ports) {
	// add the parameters in a stack-like fashion like in pre-5.0
	//Iterator<OutputPort> i = ports.getAllPorts().iterator();
	Iterator<OutputPort> i = new LinkedList<OutputPort>(ports.getAllPorts()).descendingIterator();
	while (i.hasNext()) {
		OutputPort port = i.next();
		if (!port.isConnected() && port.shouldAutoConnect()) {
			readyOutputs.addLast(port);				
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:12,代码来源:ExecutionUnit.java

示例10: cloneConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void cloneConnections(OutputPorts originalPorts,
								Map<String, Operator> originalOperatorsByName,
								Map<String, Operator> clonedOperatorsByName) {
	for (OutputPort originalSource : originalPorts.getAllPorts()) {
		if (originalSource.isConnected()) {
			OutputPort mySource;
			Operator mySourceOperator = clonedOperatorsByName.get(originalSource.getPorts().getOwner().getOperator().getName());
			if (mySourceOperator == null) {
				continue;
			}
			mySource = mySourceOperator.getOutputPorts().getPortByName(originalSource.getName());
			if (mySource == null) {
				throw new RuntimeException("Error during clone: Corresponding source for " + originalSource + " not found (no such output port).");
			}

			InputPort originalDestination = originalSource.getDestination();
			InputPort myDestination;
			Operator myDestOperator = clonedOperatorsByName.get(originalDestination.getPorts().getOwner().getOperator().getName());
			if (myDestOperator == null) {
				continue;
			}
			myDestination = myDestOperator.getInputPorts().getPortByName(originalDestination.getName());
			if (myDestination == null) {
				throw new RuntimeException("Error during clone: Corresponding destination for " + originalDestination + " not found (no such input port).");
			}
			mySource.connectTo(myDestination);
		}
	}
}
 
开发者ID:rapidminer,项目名称:rapidminer-5,代码行数:30,代码来源:ReceivingOperatorTransferHandler.java

示例11: getInnerSources

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
public OutputPorts getInnerSources() {
	return innerOutputPorts;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:ExecutionUnit.java

示例12: OneToManyPassThroughRule

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
public OneToManyPassThroughRule(InputPort inputPort, OutputPorts outputPorts) {
	this(inputPort, outputPorts.getAllPorts());
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:4,代码来源:OneToManyPassThroughRule.java

示例13: ManyToManyPassThroughRule

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
public ManyToManyPassThroughRule(InputPorts inputPorts, OutputPorts outputPorts) {
	this.inputPorts = inputPorts;
	this.outputPorts = outputPorts;
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:5,代码来源:ManyToManyPassThroughRule.java

示例14: renderConnections

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
/**
 * Draws the connections for the given ports.
 *
 * @param ports
 *            the output ports for which to draw connections
 * @param g2
 *            the graphics context to draw upon
 */
@SuppressWarnings("deprecation")
private void renderConnections(final OutputPorts ports, final Graphics2D g2) {
	for (int i = 0; i < ports.getNumberOfPorts(); i++) {
		OutputPort from = ports.getPortByIndex(i);
		Port to = from.getDestination();
		g2.setColor(ProcessDrawUtils.getColorFor(from, Color.LIGHT_GRAY, true));
		if (to != null) {
			Shape connector = ProcessDrawUtils.createConnector(from, to, model);

			// the first paint can come before any of the operator register listeners fire
			// thus we need to check the shape for null; subsequent calls will have a valid
			// shape
			if (connector == null) {
				return;
			}

			// determine current state variables
			boolean isConHovered = from == model.getHoveringConnectionSource();
			boolean isConSelected = from == model.getSelectedConnectionSource();
			boolean isConDirectlyHovered = isConHovered && model.getHoveringPort() == null
					&& model.getHoveringOperator() == null && model.getConnectingPortSource() == null;
			boolean isConDirectlySelected = isConSelected && model.getConnectingPortSource() == null;
			Operator draggedOp = !model.getDraggedOperators().isEmpty() ? model.getDraggedOperators().get(0) : null;
			boolean isDragTarget = isConHovered && model.getDraggedOperators().size() == 1
					&& ProcessDrawUtils.canOperatorBeInsertedIntoConnection(model, draggedOp);
			boolean portHovered = from == model.getHoveringPort() || to == model.getHoveringPort();

			if (from.getMetaData() instanceof CollectionMetaData) {
				if (isDragTarget) {
					g2.setStroke(CONNECTION_COLLECTION_HIGHLIGHT_STROKE);
				} else if (isConDirectlyHovered) {
					g2.setStroke(CONNECTION_COLLECTION_HIGHLIGHT_STROKE);
				} else if (isConDirectlySelected) {
					g2.setStroke(CONNECTION_COLLECTION_HIGHLIGHT_STROKE);
				} else if (portHovered) {
					g2.setStroke(CONNECTION_COLLECTION_HIGHLIGHT_STROKE);
				} else {
					g2.setStroke(CONNECTION_COLLECTION_LINE_STROKE);
				}
				g2.draw(connector);
				g2.setColor(Color.white);
				g2.setStroke(LINE_STROKE);
				g2.draw(connector);
			} else {
				if (isDragTarget) {
					g2.setStroke(CONNECTION_HIGHLIGHT_STROKE);
				} else if (isConDirectlyHovered) {
					g2.setStroke(CONNECTION_HIGHLIGHT_STROKE);
				} else if (isConDirectlySelected) {
					g2.setStroke(CONNECTION_HIGHLIGHT_STROKE);
				} else if (portHovered) {
					g2.setStroke(CONNECTION_HIGHLIGHT_STROKE);
				} else {
					g2.setStroke(CONNECTION_LINE_STROKE);
				}
				g2.draw(connector);
			}
		}
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:69,代码来源:ProcessDrawer.java

示例15: parseConnection

import com.rapidminer.operator.ports.OutputPorts; //导入依赖的package包/类
private void parseConnection(Element connectionElement, ExecutionUnit executionUnit) throws XMLException {
	final OutputPorts outputPorts;
	if (connectionElement.hasAttribute("from_op")) {
		String fromOp = connectionElement.getAttribute("from_op");
		Operator from = executionUnit.getOperatorByName(fromOp);
		if (from == null) {
			addMessage("<em class=\"error\">Unknown operator " + fromOp + " referenced in <code>from_op</code>.</em>");
			return;
		}
		outputPorts = from.getOutputPorts();
	} else {
		outputPorts = executionUnit.getInnerSources();
	}
	String fromPort = connectionElement.getAttribute("from_port");
	OutputPort out = outputPorts.getPortByName(fromPort);
	if (out == null) {
		addMessage("<em class=\"error\">The output port <var>" + fromPort + "</var> is unknown at operator <var>"
				+ outputPorts.getOwner().getName() + "</var>.</em>");
		return;
	}

	final InputPorts inputPorts;
	if (connectionElement.hasAttribute("to_op")) {
		String toOp = connectionElement.getAttribute("to_op");
		Operator to = executionUnit.getOperatorByName(toOp);
		if (to == null) {
			addMessage("<em class=\"error\">Unknown operator " + toOp + " referenced in <code>to_op</code>.</em>");
			return;
		}
		inputPorts = to.getInputPorts();
	} else {
		inputPorts = executionUnit.getInnerSinks();
	}
	String toPort = connectionElement.getAttribute("to_port");
	InputPort in = inputPorts.getPortByName(toPort);
	if (in == null) {
		addMessage("<em class=\"error\">The input port <var>" + toPort + "</var> is unknown at operator <var>"
				+ inputPorts.getOwner().getName() + "</var>.</em>");
		return;
	}
	try {
		out.connectTo(in);
	} catch (PortException e) {
		addMessage("<em class=\"error\">Faild to connect ports: " + e.getMessage() + "</var>.</em>");
	}
}
 
开发者ID:transwarpio,项目名称:rapidminer,代码行数:47,代码来源:XMLImporter.java


注:本文中的com.rapidminer.operator.ports.OutputPorts类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。