use of org.knime.workbench.editor2.figures.NodeOutPortFigure 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.workbench.editor2.figures.NodeOutPortFigure in project knime-core by knime.
the class NodeOutPortEditPart method stateChanged.
/**
* {@inheritDoc}
*/
@Override
public void stateChanged(final NodeStateEvent state) {
if (m_updateInProgressFlag.compareAndSet(false, true)) {
Display display = Display.getDefault();
if (display.isDisposed()) {
return;
}
display.asyncExec(new Runnable() {
@Override
public void run() {
if (!isActive()) {
return;
}
m_updateInProgressFlag.set(false);
NodeOutPortUI outPort = (NodeOutPortUI) getModel();
NodeOutPortFigure fig = (NodeOutPortFigure) getFigure();
rebuildTooltip();
fig.setInactive(outPort.isInactive());
fig.repaint();
}
});
}
}
Aggregations