package org.simantics.plant3d.actions; import org.eclipse.jface.action.Action; import org.simantics.g3d.scenegraph.base.INode; import org.simantics.g3d.vtk.common.VTKNodeMap; import org.simantics.plant3d.Activator; import org.simantics.plant3d.scenegraph.PipeRun; import org.simantics.plant3d.scenegraph.controlpoint.PipingRules; public class ReversePipeRunAction extends Action{ private VTKNodeMap nodeMap; PipeRun run; public ReversePipeRunAction(VTKNodeMap nodeMap) { setText("Reverse"); setImageDescriptor(Activator.imageDescriptorFromPlugin("com.famfamfam.silk", "icons/arrow_refresh.png")); this.nodeMap = nodeMap; } public void setNode(INode node) { if (node instanceof PipeRun) { run = (PipeRun)node; setEnabled(true); } else { setEnabled(false); } } @Override public void run() { PipingRules.reverse(run); nodeMap.commit("Reverse run " + run.getName()); } }