Search in sources :

Example 6 with ConnectionID

use of org.knime.core.node.workflow.ConnectionID in project knime-core by knime.

the class HorizAlignCommand method undo.

/**
 * {@inheritDoc}
 */
@Override
public void undo() {
    Map<NodeID, NodeUIInformation> oldPositions = m_alignMgr.getOldNodeCoordinates();
    Map<ConnectionID, ConnectionUIInformation> oldBendpoints = m_alignMgr.getOldBendpoints();
    // re-position nodes
    for (Map.Entry<NodeID, NodeUIInformation> e : oldPositions.entrySet()) {
        NodeContainer nc = m_wfm.getNodeContainer(e.getKey());
        if (nc == null) {
            continue;
        }
        nc.setUIInformation(e.getValue());
    }
    // re-create bendpoints
    for (Map.Entry<ConnectionID, ConnectionUIInformation> e : oldBendpoints.entrySet()) {
        ConnectionContainer cc = m_wfm.getConnection(e.getKey());
        if (cc == null) {
            continue;
        }
        cc.setUIInfo(e.getValue());
    }
}
Also used : ConnectionID(org.knime.core.node.workflow.ConnectionID) ConnectionContainer(org.knime.core.node.workflow.ConnectionContainer) NodeUIInformation(org.knime.core.node.workflow.NodeUIInformation) NodeID(org.knime.core.node.workflow.NodeID) ConnectionUIInformation(org.knime.core.node.workflow.ConnectionUIInformation) NodeContainer(org.knime.core.node.workflow.NodeContainer) Map(java.util.Map)

Example 7 with ConnectionID

use of org.knime.core.node.workflow.ConnectionID in project knime-core by knime.

the class VerticAlignCommand method undo.

/**
 * {@inheritDoc}
 */
@Override
public void undo() {
    Map<NodeID, NodeUIInformation> oldPositions = m_alignMgr.getOldNodeCoordinates();
    Map<ConnectionID, ConnectionUIInformation> oldBendpoints = m_alignMgr.getOldBendpoints();
    // re-position nodes
    for (Map.Entry<NodeID, NodeUIInformation> e : oldPositions.entrySet()) {
        NodeContainer nc = m_wfm.getNodeContainer(e.getKey());
        if (nc == null) {
            continue;
        }
        nc.setUIInformation(e.getValue());
    }
    // re-create bendpoints
    for (Map.Entry<ConnectionID, ConnectionUIInformation> e : oldBendpoints.entrySet()) {
        ConnectionContainer cc = m_wfm.getConnection(e.getKey());
        if (cc == null) {
            continue;
        }
        cc.setUIInfo(e.getValue());
    }
}
Also used : ConnectionID(org.knime.core.node.workflow.ConnectionID) ConnectionContainer(org.knime.core.node.workflow.ConnectionContainer) NodeUIInformation(org.knime.core.node.workflow.NodeUIInformation) NodeID(org.knime.core.node.workflow.NodeID) ConnectionUIInformation(org.knime.core.node.workflow.ConnectionUIInformation) NodeContainer(org.knime.core.node.workflow.NodeContainer) Map(java.util.Map)

Aggregations

ConnectionID (org.knime.core.node.workflow.ConnectionID)7 NodeID (org.knime.core.node.workflow.NodeID)7 ConnectionUIInformation (org.knime.core.node.workflow.ConnectionUIInformation)6 NodeUIInformation (org.knime.core.node.workflow.NodeUIInformation)6 Map (java.util.Map)5 ConnectionContainer (org.knime.core.node.workflow.ConnectionContainer)4 HashMap (java.util.HashMap)3 NodeContainer (org.knime.core.node.workflow.NodeContainer)3 NodeContainerUI (org.knime.core.ui.node.workflow.NodeContainerUI)3 NodeContainerEditPart (org.knime.workbench.editor2.editparts.NodeContainerEditPart)2 Point2D (java.awt.geom.Point2D)1 Point (org.eclipse.draw2d.geometry.Point)1 SubNodeContainer (org.knime.core.node.workflow.SubNodeContainer)1 WorkflowManager (org.knime.core.node.workflow.WorkflowManager)1 ConnectionContainerUI (org.knime.core.ui.node.workflow.ConnectionContainerUI)1 Edge (org.knime.workbench.ui.layout.Graph.Edge)1 Node (org.knime.workbench.ui.layout.Graph.Node)1 SimpleLayeredLayouter (org.knime.workbench.ui.layout.layeredlayout.SimpleLayeredLayouter)1