use of org.knime.workbench.editor2.figures.MetaNodeOutPortFigure in project knime-core by knime.
the class MetaNodeOutPortEditPart method stateChanged.
/**
* {@inheritDoc}
*/
@Override
public void stateChanged(final NodeStateEvent state) {
if (m_updateInProgress.compareAndSet(false, true)) {
Display display = Display.getDefault();
if (display.isDisposed()) {
return;
}
display.asyncExec(new Runnable() {
@Override
public void run() {
m_updateInProgress.set(false);
if (!isActive()) {
return;
}
MetaNodeOutPortFigure fig = (MetaNodeOutPortFigure) getFigure();
WorkflowOutPortUI model = (WorkflowOutPortUI) getModel();
fig.setState(model.getNodeState());
rebuildTooltip();
WorkflowOutPortUI outPort = (WorkflowOutPortUI) getModel();
fig.setInactive(outPort.isInactive());
fig.repaint();
}
});
}
}
use of org.knime.workbench.editor2.figures.MetaNodeOutPortFigure in project knime-core by knime.
the class MetaNodeOutPortEditPart method createFigure.
/**
* {@inheritDoc}
*/
@Override
protected IFigure createFigure() {
NodeContainerUI nc = getNodeContainer();
LOGGER.debug("returning new sub metanode out port figure " + " with type " + getType() + " index " + getIndex() + " nr outports " + nc.getNrOutPorts() + " and tooltip " + nc.getOutPort(getIndex()).getPortName());
WorkflowOutPortUI model = (WorkflowOutPortUI) getModel();
LOGGER.debug("model: " + getModel() + " state: " + model.getNodeState());
NodeOutPortUI port = nc.getOutPort(getIndex());
String tooltip = getTooltipText(port.getPortName(), port);
MetaNodeOutPortFigure f = new MetaNodeOutPortFigure(getType(), getIndex(), nc.getNrOutPorts(), tooltip, model.getNodeState());
f.setInactive(model.isInactive());
f.setIsConnected(isConnected());
return f;
}
Aggregations