Package java.lang

Examples of java.lang.Runtime$SubProcess


import java.lang.Runtime;
import java.lang.Process;

public class RuntimeExec {
  public static void main(String[] args) throws java.io.IOException, java.lang.InterruptedException {
    Runtime runtime = Runtime.getRuntime();
    String ieStr = null;
    String charmapStr = null;
    String[] firefox = new String[2];
   
    if(System.getProperty("os.name").equals("windows")){
      System.out.println("Executing internet explorer");
      ieStr = "\"c:\\program files\\internet explorer\\iexplore.exe\" http://www.google.com";
    } else {
      System.out.println("Executing Firefox using string");
      ieStr = "firefox http://www.google.com";
    }
    Process ie = runtime.exec(ieStr);
   
    if(System.getProperty("os.name").equals("windows")){
      System.out.println("Executing firefox");
      firefox[0] = "c:\\program files\\mozilla firefox\\firefox.exe";
      firefox[1] = "http://www.google.com";
    } else {
      System.out.println("Executing Firefox using array");
      firefox[0] = "firefox";
      firefox[1] = "http://www.google.com";
    }
    Process ff = runtime.exec(firefox);

    boolean ffSuccess = false;
    boolean ieSuccess = false;
    while(!(ieSuccess && ffSuccess)){
      if(!ffSuccess){
        try{
          System.out.println("Exit value from string exec: " + ff.exitValue());
          ffSuccess = true;
        } catch(IllegalThreadStateException e) {}
      }
      if(!ieSuccess){
        try{
          System.out.println("Exit value from array exec: " + ie.exitValue());
          ieSuccess = true;
        } catch(IllegalThreadStateException e) {}
      }
    }
    if(System.getProperty("os.name").equals("windows")){
      System.out.println("Executing and waiting for charmap");
      charmapStr = "c:\\windows\\system32\\charmap.exe";
    } else {
      System.out.println("Executing and waiting for firefox");
      charmapStr = "firefox http://www.google.com";
    }
    Process cm = runtime.exec(charmapStr);
    System.out.println("Exit value: " + cm.waitFor());
  }
View Full Code Here


  return (result);
}
public boolean action (Event evt, Object arg)
{

Runtime r=Runtime.getRuntime();


if (isinapp)
  mfe=new MyFrameError("An error occured , You can't launch xlock");
  else
  mfe=new MyFrameError("An error occured , You can't launch xlock");
  //mfe=new MyFrameError("You can't launch by a Browser");

mfe.resize(350,150);

if (evt.target == blaunch || evt.target == blaunchinw)
  {
  String label= (String) arg;
  String cmdlinexlock="xlock ";
  if (evt.target == blaunchinw ) cmdlinexlock=cmdlinexlock.concat("-inwindow ");
  for (int i=0;i<nbcoption;i++)
    {
    if (!valueOption[i].equals(""))
      {
      cmdlinexlock=cmdlinexlock.concat(cmdlineOption[i]+" "+valueOption[i]+" ");
      }
    }
  cmdlinexlock=cmdlinexlock.concat(getBooleanOption());
  cmdlinexlock=cmdlinexlock.concat(" -mode ");
  cmdlinexlock=cmdlinexlock.concat(lst.getSelectedItem());
  try {
  System.out.println(cmdlinexlock);
  r.getRuntime().exec(cmdlinexlock); }
      catch ( Exception e )
        {mfe.show();}
  return true;}
else
  if (evt.target == coptions)
View Full Code Here

        if (element instanceof StartEvent) {

            outgoing = ((StartEvent) element).getOutgoing();
        } else if (element instanceof SubProcess) {
           
            SubProcess subProcess = ((SubProcess) element);
            outgoing = subProcess.getOutgoing();
        } else if (element instanceof Event) {
           
            outgoing = ((Event) element).getOutgoing();
        } else if (element instanceof Activity) {
View Full Code Here

public class EmbeddedSubprocessHandler extends MainElementHandler {

   
    public boolean handle(FlowElement element, PathContextManager manager) {
        SubProcess subProcess = ((SubProcess) element);
       
        // process internal nodes of the sub process
        List<FlowElement> sbElements = subProcess.getFlowElements();
        StartEvent start = null;
        for (FlowElement sbElement : sbElements) {
            if (sbElement instanceof StartEvent) {
                start = (StartEvent) sbElement;
                break;
View Full Code Here

            if (result == null)
                result = defaultCase(theEObject);
            return result;
        }
        case Bpmn2Package.SUB_PROCESS: {
            SubProcess subProcess = (SubProcess) theEObject;
            T result = caseSubProcess(subProcess);
            if (result == null)
                result = caseActivity(subProcess);
            if (result == null)
                result = caseFlowElementsContainer(subProcess);
View Full Code Here

      if (flowElement instanceof SequenceFlow) {
        SequenceFlow flow = (SequenceFlow) flowElement;
        flowSourceMap.put(flow.getSourceRef().getId(), flow);
        flowTargetMap.put(flow.getTargetRef().getId(), flow);
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        addAllSequenceFlows(subProcess.getFlowElements(), flowSourceMap, flowTargetMap);
      }
    }
  }
View Full Code Here

        } else {
          boundaryEvent.setAttachedToRef(activity);
          activity.getBoundaryEventRefs().add(boundaryEvent);
        }
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        postProcessElements(process, subProcess.getFlowElements(), flowSourceMap, flowTargetMap);
      }
    }
  }
View Full Code Here

  private Activity retrieveAttachedRefObject(String attachedToRefId, Collection<FlowElement> flowElementList) {
    for (FlowElement flowElement : flowElementList) {
      if (attachedToRefId.equals(flowElement.getId())) {
        return (Activity) flowElement;
      } else if (flowElement instanceof SubProcess) {
        SubProcess subProcess = (SubProcess) flowElement;
        Activity activity = retrieveAttachedRefObject(attachedToRefId, subProcess.getFlowElements());
        if (activity != null) {
          return activity;
        }
      }
    }
View Full Code Here

  }

  private void loadEventObj(BaseElement baseElement) {
    BaseElementImpl baseElementImpl = (BaseElementImpl) baseElement;
    if (baseElement instanceof SubProcess) {
      SubProcess subProcess = (SubProcess) baseElement;
      List<FlowElement> flowElements = subProcess.getFlowElements();
      for (FlowElement flowElement : flowElements) {
        if (flowElement instanceof Activity) {
          loadEventObj(flowElement);
        }
      }
View Full Code Here

  protected String getStencilId(FlowElement flowElement) {
    return STENCIL_SUB_PROCESS;
  }

  protected void convertElementToJson(ObjectNode propertiesNode, FlowElement flowElement) {
    SubProcess subProcess = (SubProcess) flowElement;
    propertiesNode.put("activitytype", "Sub-Process");
    propertiesNode.put("subprocesstype", "Embedded");
    ArrayNode subProcessShapesArrayNode = objectMapper.createArrayNode();
  
    Bounds graphicInfo =  BpmnModelUtil.getBpmnShape(model, flowElement.getId()).getBounds();
    processor.processFlowElements(subProcess.getFlowElements(), model, subProcessShapesArrayNode,
        graphicInfo.getX(), graphicInfo.getY(),null);
    flowElementNode.put("childShapes", subProcessShapesArrayNode);
  }
View Full Code Here

TOP

Related Classes of java.lang.Runtime$SubProcess

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.