use of org.knime.core.ui.node.workflow.NodeOutPortUI in project knime-core by knime.
the class WorkflowInPortEditPart method createFigure.
/**
* Creates {@link WorkflowInPortFigure}, sets the tooltip and adds a
* {@link MouseListener} to the figure in order to detect if the figure was
* clicked and a context menu entry should be provided to open the port
* view.
*
* @see WorkflowContextMenuProvider#buildContextMenu(
* org.eclipse.jface.action.IMenuManager)
* @see WorkflowInPortFigure
*
* {@inheritDoc}
*/
@Override
protected IFigure createFigure() {
NodeOutPortUI port = getManager().getInPort(getIndex()).getUnderlyingPort();
String tooltip = getTooltipText(PORT_NAME + ": " + getIndex(), port);
WorkflowInPortFigure f = new WorkflowInPortFigure(getType(), getManager().getNrInPorts(), getIndex(), tooltip);
f.addMouseListener(new MouseListener() {
@Override
public void mouseDoubleClicked(final MouseEvent me) {
}
/**
* Set the selection state of the figure to true. This is
* evaluated in the context menu. If it is selected a context menu
* entry is provided to open the port view.
*
* @see WorkflowContextMenuProvider#buildContextMenu(
* org.eclipse.jface.action.IMenuManager)
*
* {@inheritDoc}
*/
@Override
public void mousePressed(final MouseEvent me) {
setSelected(true);
}
/**
* Set the selection state of the figure to true. This is
* evaluated in the context menu. If it is selected a context menu
* entry is provided to open the port view.
*
* @see WorkflowContextMenuProvider#buildContextMenu(
* org.eclipse.jface.action.IMenuManager)
*
* {@inheritDoc}
*/
@Override
public void mouseReleased(final MouseEvent me) {
setSelected(false);
}
});
return f;
}
use of org.knime.core.ui.node.workflow.NodeOutPortUI in project knime-core by knime.
the class AbstractPortEditPart method rebuildTooltip.
/**
* Tries to build the tooltip from the port name and if this is a data
* outport and the node is configured/executed, it appends also the number
* of columns and rows.
*/
public void rebuildTooltip() {
if (isInPort()) {
if (getIndex() < getNodeContainer().getNrInPorts()) {
NodeInPortUI port = getNodeContainer().getInPort(getIndex());
String tooltip = getTooltipText(port.getPortName(), port);
((NewToolTipFigure) getFigure().getToolTip()).setText(tooltip);
}
} else {
if (getIndex() < getNodeContainer().getNrOutPorts()) {
NodeOutPortUI port = getNodeContainer().getOutPort(getIndex());
String tooltip = getTooltipText(port.getPortName(), port);
((NewToolTipFigure) getFigure().getToolTip()).setText(tooltip);
}
}
}
use of org.knime.core.ui.node.workflow.NodeOutPortUI in project knime-core by knime.
the class NodeOutPortEditPart method createFigure.
/**
* {@inheritDoc}
*/
@Override
protected IFigure createFigure() {
// Create the figure, we need the number of ports from the parent
// container
NodeContainerUI container = getNodeContainer();
NodeOutPortUI port = container.getOutPort(getIndex());
String tooltip = getTooltipText(port.getPortName(), port);
boolean isMetaNode = !(container instanceof SingleNodeContainerUI);
NodeOutPortFigure portFigure = new NodeOutPortFigure(getType(), getIndex(), container.getNrOutPorts(), isMetaNode, tooltip);
portFigure.setInactive(port.isInactive());
portFigure.setIsConnected(isConnected());
return portFigure;
}
use of org.knime.core.ui.node.workflow.NodeOutPortUI in project knime-core by knime.
the class NodeOutPortEditPart method activate.
/**
* {@inheritDoc}
*/
@Override
public void activate() {
super.activate();
NodeOutPortUI outPort = (NodeOutPortUI) getModel();
outPort.addNodeStateChangeListener(this);
}
use of org.knime.core.ui.node.workflow.NodeOutPortUI in project knime-core by knime.
the class NodeOutPortEditPart method deactivate.
/**
* {@inheritDoc}
*/
@Override
public void deactivate() {
NodeOutPortUI outPort = (NodeOutPortUI) getModel();
outPort.removeNodeStateChangeListener(this);
super.deactivate();
}
Aggregations